From 7eb4c1166891ec63b165278baa86e5f4bd23aca8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 11 Feb 2014 14:56:03 +0000 Subject: [3f456a5bb9]: Patches for listbox right justify --- generic/tkListbox.c | 108 +++++++++++++++++++++++++++++++++++++++++++++-- library/demos/states.tcl | 9 ++++ macosx/tkMacOSXDefault.h | 1 + unix/tkUnixDefault.h | 1 + win/tkWinDefault.h | 1 + 5 files changed, 116 insertions(+), 4 deletions(-) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 437973a..22bb354 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -165,6 +165,8 @@ typedef struct { Pixmap gray; /* Pixmap for displaying disabled text. */ int flags; /* Various flag bits: see below for * definitions. */ + Tk_Justify justify; /* Justification */ + int oldMaxOffset; /* Used in scrolling for right/center justification */ } Listbox; /* @@ -308,6 +310,8 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING, "-listvariable", "listVariable", "Variable", DEF_LISTBOX_LIST_VARIABLE, -1, Tk_Offset(Listbox, listVarName), TK_OPTION_NULL_OK, 0, 0}, + {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", + DEF_LISTBOX_JUSTIFY, -1, Tk_Offset(Listbox, justify), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} }; @@ -435,6 +439,7 @@ static char * ListboxListVarProc(ClientData clientData, const char *name2, int flags); static void MigrateHashEntries(Tcl_HashTable *table, int first, int last, int offset); +static int GetMaxOffset(Listbox *listPtr); /* * The structure below defines button class behavior by means of procedures @@ -545,6 +550,8 @@ Tk_ListboxObjCmd( listPtr->cursor = None; listPtr->state = STATE_NORMAL; listPtr->gray = None; + listPtr->justify = TK_JUSTIFY_LEFT; + listPtr->oldMaxOffset = 0; /* * Keep a hold of the associated tkwin until we destroy the listbox, @@ -571,6 +578,13 @@ Tk_ListboxObjCmd( return TCL_ERROR; } + if (listPtr->justify == TK_JUSTIFY_RIGHT) { + listPtr->xOffset = GetMaxOffset(listPtr); + } else if (listPtr->justify == TK_JUSTIFY_CENTER) { + listPtr->xOffset = GetMaxOffset(listPtr) / 2; + listPtr->xOffset -= listPtr->xOffset % listPtr->xScrollUnit; + } + Tcl_SetObjResult(interp, TkNewWindowObj(listPtr->tkwin)); return TCL_OK; } @@ -1110,7 +1124,7 @@ ListboxBboxSubCmd( Tk_GetFontMetrics(listPtr->tkfont, &fm); pixelWidth = Tk_TextWidth(listPtr->tkfont, stringRep, stringLen); - x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset; + x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset; y = ((index - listPtr->topIndex)*listPtr->lineHeight) + listPtr->inset + listPtr->selBorderWidth; results[0] = Tcl_NewIntObj(x); @@ -1837,6 +1851,7 @@ DisplayListbox( * or right edge of the listbox is * off-screen. */ Pixmap pixmap; + int totalLength, height; listPtr->flags &= ~REDRAW_PENDING; if (listPtr->flags & LISTBOX_DELETED) { @@ -2055,12 +2070,22 @@ DisplayListbox( /* * Draw the actual text of this item. */ + Tcl_ListObjIndex(listPtr->interp, listPtr->listObj, i, &curElement); + stringRep = Tcl_GetStringFromObj(curElement, &stringLen); + Tk_ComputeTextLayout(listPtr->tkfont, + stringRep, stringLen, 0, + listPtr->justify, TK_IGNORE_NEWLINES, &totalLength, &height); Tk_GetFontMetrics(listPtr->tkfont, &fm); y += fm.ascent + listPtr->selBorderWidth; - x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset; - Tcl_ListObjIndex(listPtr->interp, listPtr->listObj, i, &curElement); - stringRep = Tcl_GetStringFromObj(curElement, &stringLen); + + if (listPtr->justify == TK_JUSTIFY_LEFT) { + x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset; + } else if (listPtr->justify == TK_JUSTIFY_RIGHT) { + x = width - totalLength - listPtr->inset - listPtr->selBorderWidth - listPtr->xOffset + GetMaxOffset(listPtr) - 1; + } else { + x = (width + GetMaxOffset(listPtr))/2 - totalLength/2 - listPtr->xOffset; + } Tk_DrawChars(listPtr->display, pixmap, gc, listPtr->tkfont, stringRep, stringLen, x, y); @@ -2581,6 +2606,7 @@ ListboxEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { + int tmpOffset, tmpOffset2, maxOffset; Listbox *listPtr = clientData; if (eventPtr->type == Expose) { @@ -2612,6 +2638,53 @@ ListboxEventProc( } listPtr->flags |= UPDATE_V_SCROLLBAR|UPDATE_H_SCROLLBAR; ChangeListboxView(listPtr, listPtr->topIndex); + if (listPtr->justify == TK_JUSTIFY_RIGHT) { + maxOffset = GetMaxOffset(listPtr); + if (maxOffset != listPtr->oldMaxOffset && listPtr->oldMaxOffset > 0) { // window has shrunk + if (maxOffset > listPtr->oldMaxOffset) { + tmpOffset = maxOffset - listPtr->oldMaxOffset; + } else { + tmpOffset = listPtr->oldMaxOffset - maxOffset; + } + tmpOffset -= tmpOffset % listPtr->xScrollUnit; + if ((tmpOffset + listPtr->xOffset) > maxOffset) { + tmpOffset = maxOffset - listPtr->xOffset; + } + if (tmpOffset < 0) { + tmpOffset = 0; + } + listPtr->xOffset += tmpOffset; + } else { + listPtr->xOffset = maxOffset; + } + listPtr->oldMaxOffset = maxOffset; + } else if (listPtr->justify == TK_JUSTIFY_CENTER) { + maxOffset = GetMaxOffset(listPtr); + if (maxOffset != listPtr->oldMaxOffset && listPtr->oldMaxOffset > 0) { // window has shrunk + tmpOffset2 = maxOffset / 2; + if (maxOffset > listPtr->oldMaxOffset) { + tmpOffset = maxOffset/2 - listPtr->oldMaxOffset/2; + } else { + tmpOffset = listPtr->oldMaxOffset/2 - maxOffset/2; + } + tmpOffset -= tmpOffset % listPtr->xScrollUnit; + if ((tmpOffset + listPtr->xOffset) > maxOffset) { + tmpOffset = maxOffset - listPtr->xOffset; + } + if (tmpOffset < 0) { + tmpOffset = 0; + } + if (listPtr->xOffset < tmpOffset2) { + listPtr->xOffset += tmpOffset; + } else { + listPtr->xOffset -= tmpOffset; + } + } else { + listPtr->xOffset = maxOffset/2; + listPtr->xOffset -= listPtr->xOffset % listPtr->xScrollUnit; + } + listPtr->oldMaxOffset = maxOffset; + } ChangeListboxOffset(listPtr, listPtr->xOffset); /* @@ -3549,6 +3622,33 @@ MigrateHashEntries( } /* + *---------------------------------------------------------------------- + * + * GetMaxOffset -- + * + * Passing in a listbox pointer, returns the maximum offset for the box + * + * Results: + * Listbox's maxOffset + * + * Side effects: + * None + * + *---------------------------------------------------------------------- +*/ +static int GetMaxOffset(register Listbox *listPtr) +{ + int maxOffset; + + maxOffset = listPtr->maxWidth - (Tk_Width(listPtr->tkwin) - 2*listPtr->inset - 2*listPtr->selBorderWidth) + listPtr->xScrollUnit - 1; + if (maxOffset < 0) { + maxOffset = 0; + } + maxOffset -= maxOffset % listPtr->xScrollUnit; + + return maxOffset; +} +/* * Local Variables: * mode: c * c-basic-offset: 4 diff --git a/library/demos/states.tcl b/library/demos/states.tcl index e76540d..09d2718 100644 --- a/library/demos/states.tcl +++ b/library/demos/states.tcl @@ -19,6 +19,15 @@ positionWindow $w label $w.msg -font $font -wraplength 4i -justify left -text "A listbox containing the 50 states is displayed below, along with a scrollbar. You can scan the list either using the scrollbar or by scanning. To scan, press button 2 in the widget and drag up or down." pack $w.msg -side top +foreach c {Left Center Right} { + set lower [string tolower $c] + radiobutton $w.$lower -text $c -variable just \ + -relief flat -value $lower -anchor w \ + -command "$w.frame.list configure -justify \$just" \ + -tristatevalue "multi" + pack $w.$lower -side left -pady 2 -fill x +} + ## See Code / Dismiss buttons set btns [addSeeDismiss $w.buttons $w] pack $btns -side bottom -fill x diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index 8565cdb..903f5f9 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -262,6 +262,7 @@ #define DEF_LISTBOX_RELIEF "solid" #define DEF_LISTBOX_SCROLL_COMMAND "" #define DEF_LISTBOX_LIST_VARIABLE "" +#define DEF_LISTBOX_JUSTIFY "left" #define DEF_LISTBOX_SELECT_COLOR SELECT_BG #define DEF_LISTBOX_SELECT_MONO BLACK #define DEF_LISTBOX_SELECT_BD "0" diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h index b922278..8768a2e 100644 --- a/unix/tkUnixDefault.h +++ b/unix/tkUnixDefault.h @@ -224,6 +224,7 @@ #define DEF_LISTBOX_RELIEF "sunken" #define DEF_LISTBOX_SCROLL_COMMAND "" #define DEF_LISTBOX_LIST_VARIABLE "" +#define DEF_LISTBOX_JUSTIFY "left" #define DEF_LISTBOX_SELECT_COLOR SELECT_BG #define DEF_LISTBOX_SELECT_MONO BLACK #define DEF_LISTBOX_SELECT_BD "0" diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h index 11c3e6d..6d1a0c9 100644 --- a/win/tkWinDefault.h +++ b/win/tkWinDefault.h @@ -227,6 +227,7 @@ #define DEF_LISTBOX_RELIEF "sunken" #define DEF_LISTBOX_SCROLL_COMMAND "" #define DEF_LISTBOX_LIST_VARIABLE "" +#define DEF_LISTBOX_JUSTIFY "left" #define DEF_LISTBOX_SELECT_COLOR SELECT_BG #define DEF_LISTBOX_SELECT_MONO BLACK #define DEF_LISTBOX_SELECT_BD "0" -- cgit v0.12 From 5c01788dc22a4a2f8e6d9e943dc61a5b73b28291 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 11 Feb 2014 19:05:15 +0000 Subject: Adapt documentation and test-case --- doc/listbox.n | 7 ++++--- tests/listbox.test | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/listbox.n b/doc/listbox.n index 4264823..1da40fd 100644 --- a/doc/listbox.n +++ b/doc/listbox.n @@ -17,9 +17,10 @@ listbox \- Create and manipulate 'listbox' item list widgets \-background \-borderwidth \-cursor \-disabledforeground \-exportselection \-font \-foreground \-highlightbackground \-highlightcolor -\-highlightthickness \-relief \-selectbackground -\-selectborderwidth \-selectforeground \-setgrid -\-takefocus \-xscrollcommand \-yscrollcommand +\-highlightthickness \-justify \-relief +\-selectbackground \-selectborderwidth \-selectforeground +\-setgrid \-takefocus \-xscrollcommand +\-yscrollcommand .SE .SH "WIDGET-SPECIFIC OPTIONS" .OP \-activestyle activeStyle ActiveStyle diff --git a/tests/listbox.test b/tests/listbox.test index e05d574..72b1cdf 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -455,7 +455,7 @@ test listbox-3.22 {ListboxWidgetCmd procedure, "cget" option} -body { } -result {0} test listbox-3.23 {ListboxWidgetCmd procedure, "configure" option} -body { llength [.l configure] -} -result {27} +} -result {28} test listbox-3.24 {ListboxWidgetCmd procedure, "configure" option} -body { .l configure -gorp } -returnCodes error -result {unknown option "-gorp"} -- cgit v0.12 From ea06f53f1af485fd1b367c29dfb8c7fc44397f28 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 8 Mar 2015 20:51:13 +0000 Subject: Fixed documentation regarding behaviour of embedded windows and embedded images in [text] - Bug [1581955fff] --- doc/text.n | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doc/text.n b/doc/text.n index a7eeffc..6b72eb5 100644 --- a/doc/text.n +++ b/doc/text.n @@ -753,6 +753,16 @@ the window is destroyed. Similarly if the text widget as a whole is deleted, then the window is destroyed. .VE 8.5 +.VS 8.5 +Eliding an embedded window immediately after scheduling it for creation +via \fIpathName \fBwindow create \fIindex \fB-create\fR will prevent it +from being effectively created. +Uneliding an elided embedded window scheduled for creation via +\fIpathName \fBwindow create \fIindex \fB-create\fR will automatically +trigger the associated creation script. +After destroying an elided embedded window, the latter won't get +automatically recreated. +.VE 8.5 .PP When an embedded window is added to a text widget with the \fIpathName \fBwindow create\fR widget command, several configuration @@ -836,6 +846,16 @@ its position in the widget's index space, or the name it is assigned when the image is inserted into the text widget with \fIpathName \fBimage create\fR. If the range of text containing the embedded image is deleted then that copy of the image is removed from the screen. +.VS 8.5 +Eliding an embedded image immediately after scheduling it for creation +via \fIpathName \fBimage create \fIindex \fB-create\fR will prevent it +from being effectively created. +Uneliding an elided embedded image scheduled for creation via +\fIpathName \fBimage create \fIindex \fB-create\fR will automatically +trigger the associated creation script. +After destroying an elided embedded image, the latter won't get +automatically recreated. +.VE 8.5 .PP When an embedded image is added to a text widget with the \fIpathName \fBimage create\fR widget command, a name unique to this instance of the image -- cgit v0.12 From 1a951d23a2aaf84d972e4349b51aa99333ba9045 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 13 Mar 2015 19:19:24 +0000 Subject: Slightly better formatting --- doc/text.n | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/text.n b/doc/text.n index 6b72eb5..b11363d 100644 --- a/doc/text.n +++ b/doc/text.n @@ -736,6 +736,7 @@ and any widget may be used as an embedded window (subject to the usual rules for geometry management, which require the text window to be the parent of the embedded window or a descendant of its parent). +.PP The embedded window's position on the screen will be updated as the text is modified or scrolled, and it will be mapped and unmapped as it moves into and out of the visible area of the text widget. @@ -753,6 +754,7 @@ the window is destroyed. Similarly if the text widget as a whole is deleted, then the window is destroyed. .VE 8.5 +.PP .VS 8.5 Eliding an embedded window immediately after scheduling it for creation via \fIpathName \fBwindow create \fIindex \fB-create\fR will prevent it @@ -834,6 +836,7 @@ at a particular point in the text. There may be any number of embedded images in a text widget, and a particular image may be embedded in multiple places in the same text widget. +.PP The embedded image's position on the screen will be updated as the text is modified or scrolled. Each embedded image occupies one @@ -846,6 +849,7 @@ its position in the widget's index space, or the name it is assigned when the image is inserted into the text widget with \fIpathName \fBimage create\fR. If the range of text containing the embedded image is deleted then that copy of the image is removed from the screen. +.PP .VS 8.5 Eliding an embedded image immediately after scheduling it for creation via \fIpathName \fBimage create \fIindex \fB-create\fR will prevent it -- cgit v0.12 From 6d849d232afb87840ffe3c1f9055e400e0907a63 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sun, 15 Mar 2015 20:22:13 +0000 Subject: Wish now launches in front when called from command line, and focus -force works correctly; thanks to Marc Culler for patch --- macosx/tkMacOSXMenu.c | 10 +++++++--- macosx/tkMacOSXSubwindows.c | 6 ++++-- macosx/tkMacOSXWindowEvent.c | 4 ++-- macosx/tkMacOSXWm.c | 39 +++++++++++++++++++++++++-------------- 4 files changed, 38 insertions(+), 21 deletions(-) diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 85e1d6c..ecdf1ab 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -830,11 +830,16 @@ TkpSetWindowMenuBar( * Puts the menu associated with a window into the menubar. Should only * be called when the window is in front. * + * This is a no-op on all other platforms. On OS X it is a no-op when + * passed a NULL menuName or a nonexistent menuName, with an exception + * for the first call in a new interpreter. In that special case, passing a + * NULL menuName installs the default menu. + * * Results: * None. * * Side effects: - * The menubar is changed. + * The menubar may be changed. * *---------------------------------------------------------------------- */ @@ -843,8 +848,7 @@ void TkpSetMainMenubar( Tcl_Interp *interp, /* The interpreter of the application */ Tk_Window tkwin, /* The frame we are setting up */ - const char *menuName) /* The name of the menu to put in front. If - * NULL, use the default menu bar. */ + const char *menuName) /* The name of the menu to put in front. */ { static Tcl_Interp *currentInterp = NULL; TKMenu *menu = nil; diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 1a71746..ee9167b 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -149,8 +149,10 @@ XMapWindow( if (Tk_IsTopLevel(macWin->winPtr)) { if (!Tk_IsEmbedded(macWin->winPtr)) { NSWindow *win = TkMacOSXDrawableWindow(window); - - [win makeKeyAndOrderFront:NSApp]; + [NSApp activateIgnoringOtherApps:YES]; + if ( [win canBecomeKeyWindow] ) { + [win makeKeyAndOrderFront:NSApp]; + } [win windowRef]; TkMacOSXApplyWindowAttributes(macWin->winPtr, win); } diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 5f782c5..3e2a437 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -48,7 +48,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification; #endif #endif -extern NSString *opaqueTag; +extern BOOL opaqueTag; @implementation TKApplication(TKWindowEvent) @@ -935,7 +935,7 @@ ExposeRestrictProc( { NSWindow *w = [self window]; - if (opaqueTag != NULL) { + if (opaqueTag) { return YES; } else { diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 4f7b066..d81e8d6 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -53,7 +53,7 @@ /*Objects for use in setting background color and opacity of window.*/ NSColor *colorName = NULL; -NSString *opaqueTag = NULL; +BOOL opaqueTag = FALSE; static const struct { const UInt64 validAttrs, defaultAttrs, forceOnAttrs, forceOffAttrs; @@ -786,13 +786,18 @@ TkWmDeadWindow( [[window parentWindow] removeChildWindow:window]; [window setExcludedFromWindowsMenu:YES]; [window close]; - TkMacOSXUnregisterMacWindow(window); - if (winPtr->window) { - ((MacDrawable *) winPtr->window)->view = nil; - } - TkMacOSXMakeCollectableAndRelease(wmPtr->window); + TkMacOSXUnregisterMacWindow(window); + if (winPtr->window) { + ((MacDrawable *) winPtr->window)->view = nil; + } + TkMacOSXMakeCollectableAndRelease(wmPtr->window); + /* Activate the highest window left on the screen. */ + NSArray *windows = [NSApp orderedWindows]; + NSWindow *front = [windows objectAtIndex:0]; + if ( front && [front canBecomeKeyWindow] ) { + [front makeKeyAndOrderFront:NSApp]; + } } - ckfree(wmPtr); winPtr->wmInfoPtr = NULL; } @@ -5117,7 +5122,7 @@ TkUnsupported1ObjCmd( colorName = [NSColor clearColor]; //use systemTransparent in Tk scripts to match } if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*opacity*")) { - opaqueTag = @"YES"; + opaqueTag = YES; } } @@ -5508,7 +5513,7 @@ TkMacOSXMakeRealWindowExist( [window setBackgroundColor: colorName]; } - if (opaqueTag != NULL) { + if (opaqueTag) { #ifdef TK_GOT_AT_LEAST_SNOW_LEOPARD [window setOpaque: opaqueTag]; #else @@ -5916,15 +5921,21 @@ TkpChangeFocus( * didn't originally belong to topLevelPtr's * application. */ { - /* - * We don't really need to do anything on the Mac. Tk will keep all this - * state for us. - */ - if (winPtr->atts.override_redirect) { return 0; } + if (Tk_IsTopLevel(winPtr) && !Tk_IsEmbedded(winPtr) ){ + NSWindow *win = TkMacOSXDrawableWindow(winPtr->window); + TkWmRestackToplevel(winPtr, Above, NULL); + if (force ) { + [NSApp activateIgnoringOtherApps:YES]; + } + if ( win && [win canBecomeKeyWindow] ) { + [win makeKeyAndOrderFront:NSApp]; + } + } + /* * Remember the current serial number for the X server and issue a dummy * server request. This marks the position at which we changed the focus, -- cgit v0.12 From 9df910230823bd6be37562f8f344258c54add11f Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sun, 15 Mar 2015 20:32:14 +0000 Subject: Wish now launches in front when caed from command line, and focus -force works correctly; thanks to Marc Culler for patch --- macosx/tkMacOSXMenu.c | 10 +++++++--- macosx/tkMacOSXSubwindows.c | 6 ++++-- macosx/tkMacOSXWindowEvent.c | 4 ++-- macosx/tkMacOSXWm.c | 38 +++++++++++++++++++++++++------------- 4 files changed, 38 insertions(+), 20 deletions(-) diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index e1cdc76..3dadb45 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -830,11 +830,16 @@ TkpSetWindowMenuBar( * Puts the menu associated with a window into the menubar. Should only * be called when the window is in front. * + * This is a no-op on all other platforms. On OS X it is a no-op when + * passed a NULL menuName or a nonexistent menuName, with an exception + * for the first call in a new interpreter. In that special case, passing a + * NULL menuName installs the default menu. + * * Results: * None. * * Side effects: - * The menubar is changed. + * The menubar may be changed. * *---------------------------------------------------------------------- */ @@ -843,8 +848,7 @@ void TkpSetMainMenubar( Tcl_Interp *interp, /* The interpreter of the application */ Tk_Window tkwin, /* The frame we are setting up */ - char *menuName) /* The name of the menu to put in front. If - * NULL, use the default menu bar. */ + char *menuName) /* The name of the menu to put in front.*/ { static Tcl_Interp *currentInterp = NULL; TKMenu *menu = nil; diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index d557db3..95cc338 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -149,8 +149,10 @@ XMapWindow( if (Tk_IsTopLevel(macWin->winPtr)) { if (!Tk_IsEmbedded(macWin->winPtr)) { NSWindow *win = TkMacOSXDrawableWindow(window); - - [win makeKeyAndOrderFront:NSApp]; + [NSApp activateIgnoringOtherApps:YES]; + if ( [win canBecomeKeyWindow] ) { + [win makeKeyAndOrderFront:NSApp]; + } [win windowRef]; TkMacOSXApplyWindowAttributes(macWin->winPtr, win); } diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 3233b37..86a1960 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -48,7 +48,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification; #endif #endif -extern NSString *opaqueTag; +extern BOOL opaqueTag; @implementation TKApplication(TKWindowEvent) @@ -940,7 +940,7 @@ ExposeRestrictProc( { NSWindow *w = [self window]; - if (opaqueTag != NULL) { + if (opaqueTag) { return YES; } else { diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index c824afc..91c6858 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -55,7 +55,7 @@ /*Objects for use in setting background color and opacity of window.*/ NSColor *colorName = NULL; -NSString *opaqueTag = NULL; +BOOL opaqueTag = FALSE; static const struct { const UInt64 validAttrs, defaultAttrs, forceOnAttrs, forceOffAttrs; @@ -790,11 +790,17 @@ TkWmDeadWindow( [[window parentWindow] removeChildWindow:window]; [window setExcludedFromWindowsMenu:YES]; [window close]; - TkMacOSXUnregisterMacWindow(window); - if (winPtr->window) { - ((MacDrawable *)winPtr->window)->view = nil; - } - TkMacOSXMakeCollectableAndRelease(wmPtr->window); + TkMacOSXUnregisterMacWindow(window); + if (winPtr->window) { + ((MacDrawable *) winPtr->window)->view = nil; + } + TkMacOSXMakeCollectableAndRelease(wmPtr->window); + /* Activate the highest window left on the screen. */ + NSArray *windows = [NSApp orderedWindows]; + NSWindow *front = [windows objectAtIndex:0]; + if ( front && [front canBecomeKeyWindow] ) { + [front makeKeyAndOrderFront:NSApp]; + } } ckfree((char *) wmPtr); @@ -5055,7 +5061,7 @@ TkUnsupported1ObjCmd( colorName = [NSColor clearColor]; //use systemTransparent in Tk scripts to match } if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*opacity*") == 1) { - opaqueTag=@"YES"; + opaqueTag=YES; } } @@ -5447,7 +5453,7 @@ TkMacOSXMakeRealWindowExist( [window setBackgroundColor: colorName]; } - if (opaqueTag != NULL) { + if (opaqueTag) { #ifdef TK_GOT_AT_LEAST_SNOW_LEOPARD [window setOpaque: opaqueTag]; #else @@ -5855,15 +5861,21 @@ TkpChangeFocus( * didn't originally belong to topLevelPtr's * application. */ { - /* - * We don't really need to do anything on the Mac. Tk will keep all this - * state for us. - */ - if (winPtr->atts.override_redirect) { return 0; } + if (Tk_IsTopLevel(winPtr) && !Tk_IsEmbedded(winPtr) ){ + NSWindow *win = TkMacOSXDrawableWindow(winPtr->window); + TkWmRestackToplevel(winPtr, Above, NULL); + if (force ) { + [NSApp activateIgnoringOtherApps:YES]; + } + if ( win && [win canBecomeKeyWindow] ) { + [win makeKeyAndOrderFront:NSApp]; + } + } + /* * Remember the current serial number for the X server and issue a dummy * server request. This marks the position at which we changed the focus, -- cgit v0.12 From c76fcabd431431b1acfc9d4113781872fcc9fe9b Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 00:44:51 +0000 Subject: Remove garbage collections calls as GC is no longer supported on OS X; thanks to Marc Culler for patch --- macosx/tkMacOSXCursor.c | 5 +++-- macosx/tkMacOSXFont.c | 5 +++-- macosx/tkMacOSXInit.c | 2 -- macosx/tkMacOSXMenu.c | 24 +++++++++++++++--------- macosx/tkMacOSXNotify.c | 10 +++------- macosx/tkMacOSXPrivate.h | 18 ------------------ macosx/tkMacOSXWm.c | 22 +++++++++++----------- macosx/tkMacOSXXStubs.c | 3 +-- 8 files changed, 36 insertions(+), 53 deletions(-) diff --git a/macosx/tkMacOSXCursor.c b/macosx/tkMacOSXCursor.c index 53c2cd2..b6394b7 100644 --- a/macosx/tkMacOSXCursor.c +++ b/macosx/tkMacOSXCursor.c @@ -344,7 +344,7 @@ FindCursorByName( macCursor = [[NSCursor alloc] initWithImage:image hotSpot:hotSpot]; [image release]; } - macCursorPtr->macCursor = TkMacOSXMakeUncollectable(macCursor); + macCursorPtr->macCursor = macCursor; } /* @@ -454,7 +454,8 @@ TkpFreeCursor( { TkMacOSXCursor *macCursorPtr = (TkMacOSXCursor *) cursorPtr; - TkMacOSXMakeCollectableAndRelease(macCursorPtr->macCursor); + [macCursorPtr->macCursor release]; + macCursorPtr->macCursor = NULL; if (macCursorPtr == gCurrentCursor) { gCurrentCursor = NULL; } diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 4c8ac30..45a68f7 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -293,7 +293,7 @@ InitFont( [NSNumber numberWithInt:fmPtr->fixed ? 0 : 1], NSLigatureAttributeName, [NSNumber numberWithDouble:kern], NSKernAttributeName, nil]; - fontPtr->nsAttributes = TkMacOSXMakeUncollectableAndRetain(nsAttributes); + fontPtr->nsAttributes = [nsAttributes retain]; #undef nCh } @@ -557,7 +557,8 @@ TkpDeleteFont( { MacFont *fontPtr = (MacFont *) tkFontPtr; - TkMacOSXMakeCollectableAndRelease(fontPtr->nsAttributes); + [fontPtr->nsAttributes release]; + fontPtr->nsAttributes = NULL; CFRelease(fontPtr->nsFont); /* Either a CTFontRef or a CFRetained NSFont */ } diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 6a881d3..e861089 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -28,7 +28,6 @@ static char tkLibPath[PATH_MAX + 1] = ""; static char scriptPath[PATH_MAX + 1] = ""; -int tkMacOSXGCEnabled = 0; long tkMacOSXMacOSXVersion = 0; #pragma mark TKApplication(TKInit) @@ -258,7 +257,6 @@ TkpInit( if (!pool) { pool = [NSAutoreleasePool new]; } - tkMacOSXGCEnabled = ([NSGarbageCollector defaultCollector] != nil); [[NSUserDefaults standardUserDefaults] registerDefaults: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index ecdf1ab..9f14f47 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -496,8 +496,7 @@ TkpNewMenu( * platform structure for. */ { TKMenu *menu = [[TKMenu alloc] initWithTkMenu:menuPtr]; - menuPtr->platformData = (TkMenuPlatformData) - TkMacOSXMakeUncollectable(menu); + menuPtr->platformData = (TkMenuPlatformData) menu; CheckForSpecialMenu(menuPtr); return TCL_OK; } @@ -522,7 +521,10 @@ void TkpDestroyMenu( TkMenu *menuPtr) /* The common menu structure */ { - TkMacOSXMakeCollectableAndRelease(menuPtr->platformData); + NSMenu* nsmenu = (NSMenu*)(menuPtr->platformData); + + [nsmenu release]; + menuPtr->platformData = NULL; } /* @@ -555,8 +557,7 @@ TkpMenuNewEntry( } else { menuItem = [menu newTkMenuItem:mePtr]; } - mePtr->platformEntryData = (TkMenuPlatformEntryData) - TkMacOSXMakeUncollectable(menuItem); + mePtr->platformEntryData = (TkMenuPlatformEntryData) menuItem; /* * Caller TkMenuEntry() already did this same insertion into the generic @@ -720,16 +721,21 @@ void TkpDestroyMenuEntry( TkMenuEntry *mePtr) { + NSMenuItem *menuItem; + TKMenu *menu; + NSInteger index; + if (mePtr->platformEntryData && mePtr->menuPtr->platformData) { - TKMenu *menu = (TKMenu *) mePtr->menuPtr->platformData; - NSMenuItem *menuItem = (NSMenuItem *) mePtr->platformEntryData; - NSInteger index = [menu indexOfItem:menuItem]; + menu = (TKMenu *) mePtr->menuPtr->platformData; + menuItem = (NSMenuItem *) mePtr->platformEntryData; + index = [menu indexOfItem:menuItem]; if (index > -1) { [menu removeItemAtIndex:index]; } + [menuItem release]; + mePtr->platformEntryData = NULL; } - TkMacOSXMakeCollectableAndRelease(mePtr->platformEntryData); } /* diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 3e0dfde..ab68931 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -234,8 +234,7 @@ TkMacOSXEventsSetupProc( dequeue:YES]; if (currentEvent) { - tsdPtr->currentEvent = - TkMacOSXMakeUncollectableAndRetain(currentEvent); + tsdPtr->currentEvent = [currentEvent retain]; } } if (tsdPtr->currentEvent) { @@ -273,8 +272,8 @@ TkMacOSXEventsCheckProc( TSD_INIT(); if (tsdPtr->currentEvent) { - currentEvent = TkMacOSXMakeCollectableAndAutorelease( - tsdPtr->currentEvent); + currentEvent = tsdPtr->currentEvent; + [currentEvent autorelease]; } do { modalSession = TkMacOSXGetModalSession(); @@ -288,9 +287,6 @@ TkMacOSXEventsCheckProc( } [currentEvent retain]; pool = [NSAutoreleasePool new]; - if (tkMacOSXGCEnabled) { - objc_clear_stack(0); - } if (![NSApp tkProcessEvent:currentEvent]) { [currentEvent release]; currentEvent = nil; diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 3664850..2de3673 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -144,23 +144,6 @@ } /* - * Macros for GC - */ - -#define TkMacOSXMakeUncollectable(x) ({ id o = (id)(x); \ - if (o) { if(tkMacOSXGCEnabled) CFRetain(o); } o; }) -#define TkMacOSXMakeUncollectableAndRetain(x) ({ id o = (id)(x); \ - if (o) { if(tkMacOSXGCEnabled) CFRetain(o); else [o retain]; } o; }) -#define TkMacOSXMakeCollectable(x) ({ id o = (id)(x); \ - if (o) { x = nil; if (tkMacOSXGCEnabled) CFRelease(o); } o; }) -#define TkMacOSXMakeCollectableAndRelease(x) ({ id o = (id)(x); \ - if (o) { x = nil; if (tkMacOSXGCEnabled) CFRelease(o); \ - else [o release]; } o; }) -#define TkMacOSXMakeCollectableAndAutorelease(x) ({ id o = (id)(x); \ - if (o) { x = nil; if (tkMacOSXGCEnabled) CFRelease(o); \ - else [o autorelease]; } o; }) - -/* * Structure encapsulating current drawing environment. */ @@ -178,7 +161,6 @@ typedef struct TkMacOSXDrawingContext { MODULE_SCOPE CGFloat tkMacOSXZeroScreenHeight; MODULE_SCOPE CGFloat tkMacOSXZeroScreenTop; -MODULE_SCOPE int tkMacOSXGCEnabled; MODULE_SCOPE long tkMacOSXMacOSXVersion; /* diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 429d7aa..fc61c7f 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -786,17 +786,18 @@ TkWmDeadWindow( [[window parentWindow] removeChildWindow:window]; [window setExcludedFromWindowsMenu:YES]; [window close]; - TkMacOSXUnregisterMacWindow(window); - if (winPtr->window) { - ((MacDrawable *) winPtr->window)->view = nil; + TkMacOSXUnregisterMacWindow(window); + if (winPtr->window) { + ((MacDrawable *) winPtr->window)->view = nil; } - TkMacOSXMakeCollectableAndRelease(wmPtr->window); - /* Activate the highest window left on the screen. */ - NSArray *windows = [NSApp orderedWindows]; - NSWindow *front = [windows objectAtIndex:0]; - if ( front && [front canBecomeKeyWindow] ) { - [front makeKeyAndOrderFront:NSApp]; - } + [window release]; + wmPtr->window = NULL; + /* Activate the highest window left on the screen. */ + NSArray *windows = [NSApp orderedWindows]; + NSWindow *front = [windows objectAtIndex:0]; + if ( front && [front canBecomeKeyWindow] ) { + [front makeKeyAndOrderFront:NSApp]; + } } ckfree(wmPtr); winPtr->wmInfoPtr = NULL; @@ -5486,7 +5487,6 @@ TkMacOSXMakeRealWindowExist( if (!window) { Tcl_Panic("couldn't allocate new Mac window"); } - TkMacOSXMakeUncollectable(window); TKContentView *contentView = [[TKContentView alloc] initWithFrame:NSZeroRect]; [window setContentView:contentView]; diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index b16b582..e03260f 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -177,8 +177,7 @@ TkpOpenDisplay( display->proto_minor_version = [[cgVers objectAtIndex:2] integerValue]; } if (!vendor[0]) { - snprintf(vendor, sizeof(vendor), "Apple AppKit %s %g", - ([NSGarbageCollector defaultCollector] ? "GC" : "RR"), + snprintf(vendor, sizeof(vendor), "Apple AppKit %g", NSAppKitVersionNumber); } display->vendor = vendor; -- cgit v0.12 From 9787a9f42d575fd80d370323e6fe37290f5609cd Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 00:50:16 +0000 Subject: Remove garbage collections calls as GC is no longer supported on OS X; thanks to Marc Culler for patch --- macosx/tkMacOSXCursor.c | 5 +++-- macosx/tkMacOSXFont.c | 5 +++-- macosx/tkMacOSXInit.c | 2 -- macosx/tkMacOSXMenu.c | 24 +++++++++++++++--------- macosx/tkMacOSXNotify.c | 10 +++------- macosx/tkMacOSXPrivate.h | 18 ------------------ macosx/tkMacOSXWm.c | 6 +++--- macosx/tkMacOSXXStubs.c | 3 +-- 8 files changed, 28 insertions(+), 45 deletions(-) diff --git a/macosx/tkMacOSXCursor.c b/macosx/tkMacOSXCursor.c index c9815c1..08dec9e 100644 --- a/macosx/tkMacOSXCursor.c +++ b/macosx/tkMacOSXCursor.c @@ -344,7 +344,7 @@ FindCursorByName( macCursor = [[NSCursor alloc] initWithImage:image hotSpot:hotSpot]; [image release]; } - macCursorPtr->macCursor = TkMacOSXMakeUncollectable(macCursor); + macCursorPtr->macCursor = macCursor; } /* @@ -452,7 +452,8 @@ TkpFreeCursor( { TkMacOSXCursor *macCursorPtr = (TkMacOSXCursor *) cursorPtr; - TkMacOSXMakeCollectableAndRelease(macCursorPtr->macCursor); + [macCursorPtr->macCursor release]; + macCursorPtr->macCursor = NULL; if (macCursorPtr == gCurrentCursor) { gCurrentCursor = NULL; } diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index ae3be92..d30da09 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -293,7 +293,7 @@ InitFont( [NSNumber numberWithInt:fmPtr->fixed ? 0 : 1], NSLigatureAttributeName, [NSNumber numberWithDouble:kern], NSKernAttributeName, nil]; - fontPtr->nsAttributes = TkMacOSXMakeUncollectableAndRetain(nsAttributes); + fontPtr->nsAttributes = [nsAttributes retain]; #undef nCh } @@ -557,7 +557,8 @@ TkpDeleteFont( { MacFont *fontPtr = (MacFont *) tkFontPtr; - TkMacOSXMakeCollectableAndRelease(fontPtr->nsAttributes); + [fontPtr->nsAttributes release]; + fontPtr->nsAttributes = NULL; CFRelease(fontPtr->nsFont); /* Either a CTFontRef or a CFRetained NSFont */ } diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 752ec48..6ba726d 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -30,7 +30,6 @@ static char tkLibPath[PATH_MAX + 1] = ""; static char scriptPath[PATH_MAX + 1] = ""; -int tkMacOSXGCEnabled = 0; long tkMacOSXMacOSXVersion = 0; #pragma mark TKApplication(TKInit) @@ -247,7 +246,6 @@ TkpInit( if (!pool) { pool = [NSAutoreleasePool new]; } - tkMacOSXGCEnabled = ([NSGarbageCollector defaultCollector] != nil); [[NSUserDefaults standardUserDefaults] registerDefaults: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 3dadb45..472520f 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -496,8 +496,7 @@ TkpNewMenu( * platform structure for. */ { TKMenu *menu = [[TKMenu alloc] initWithTkMenu:menuPtr]; - menuPtr->platformData = (TkMenuPlatformData) - TkMacOSXMakeUncollectable(menu); + menuPtr->platformData = (TkMenuPlatformData) menu; CheckForSpecialMenu(menuPtr); return TCL_OK; } @@ -522,7 +521,10 @@ void TkpDestroyMenu( TkMenu *menuPtr) /* The common menu structure */ { - TkMacOSXMakeCollectableAndRelease(menuPtr->platformData); + NSMenu* nsmenu = (NSMenu*)(menuPtr->platformData); + + [nsmenu release]; + menuPtr->platformData = NULL; } /* @@ -555,8 +557,7 @@ TkpMenuNewEntry( } else { menuItem = [menu newTkMenuItem:mePtr]; } - mePtr->platformEntryData = (TkMenuPlatformEntryData) - TkMacOSXMakeUncollectable(menuItem); + mePtr->platformEntryData = (TkMenuPlatformEntryData) menuItem; /* * Caller TkMenuEntry() already did this same insertion into the generic @@ -720,16 +721,21 @@ void TkpDestroyMenuEntry( TkMenuEntry *mePtr) { + NSMenuItem *menuItem; + TKMenu *menu; + NSInteger index; + if (mePtr->platformEntryData && mePtr->menuPtr->platformData) { - TKMenu *menu = (TKMenu *) mePtr->menuPtr->platformData; - NSMenuItem *menuItem = (NSMenuItem *) mePtr->platformEntryData; - NSInteger index = [menu indexOfItem:menuItem]; + menu = (TKMenu *) mePtr->menuPtr->platformData; + menuItem = (NSMenuItem *) mePtr->platformEntryData; + index = [menu indexOfItem:menuItem]; if (index > -1) { [menu removeItemAtIndex:index]; } + [menuItem release]; + mePtr->platformEntryData = NULL; } - TkMacOSXMakeCollectableAndRelease(mePtr->platformEntryData); } /* diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index b400423..d35427a 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -223,8 +223,7 @@ TkMacOSXEventsSetupProc( inMode:GetRunLoopMode(TkMacOSXGetModalSession()) dequeue:YES]; if (currentEvent) { - tsdPtr->currentEvent = - TkMacOSXMakeUncollectableAndRetain(currentEvent); + tsdPtr->currentEvent = [currentEvent retain]; } } if (tsdPtr->currentEvent) { @@ -262,8 +261,8 @@ TkMacOSXEventsCheckProc( TSD_INIT(); if (tsdPtr->currentEvent) { - currentEvent = TkMacOSXMakeCollectableAndAutorelease( - tsdPtr->currentEvent); + currentEvent = tsdPtr->currentEvent; + [currentEvent autorelease]; } do { modalSession = TkMacOSXGetModalSession(); @@ -277,9 +276,6 @@ TkMacOSXEventsCheckProc( } [currentEvent retain]; pool = [NSAutoreleasePool new]; - if (tkMacOSXGCEnabled) { - objc_clear_stack(0); - } if (![NSApp tkProcessEvent:currentEvent]) { [currentEvent release]; currentEvent = nil; diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 18af42f..b93fa18 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -142,23 +142,6 @@ } /* - * Macros for GC - */ - -#define TkMacOSXMakeUncollectable(x) ({ id o = (id)(x); \ - if (o) { if(tkMacOSXGCEnabled) CFRetain(o); } o; }) -#define TkMacOSXMakeUncollectableAndRetain(x) ({ id o = (id)(x); \ - if (o) { if(tkMacOSXGCEnabled) CFRetain(o); else [o retain]; } o; }) -#define TkMacOSXMakeCollectable(x) ({ id o = (id)(x); \ - if (o) { x = nil; if (tkMacOSXGCEnabled) CFRelease(o); } o; }) -#define TkMacOSXMakeCollectableAndRelease(x) ({ id o = (id)(x); \ - if (o) { x = nil; if (tkMacOSXGCEnabled) CFRelease(o); \ - else [o release]; } o; }) -#define TkMacOSXMakeCollectableAndAutorelease(x) ({ id o = (id)(x); \ - if (o) { x = nil; if (tkMacOSXGCEnabled) CFRelease(o); \ - else [o autorelease]; } o; }) - -/* * Structure encapsulating current drawing environment. */ @@ -176,7 +159,6 @@ typedef struct TkMacOSXDrawingContext { MODULE_SCOPE CGFloat tkMacOSXZeroScreenHeight; MODULE_SCOPE CGFloat tkMacOSXZeroScreenTop; -MODULE_SCOPE int tkMacOSXGCEnabled; MODULE_SCOPE long tkMacOSXMacOSXVersion; /* diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 91c6858..23b107f 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -794,8 +794,9 @@ TkWmDeadWindow( if (winPtr->window) { ((MacDrawable *) winPtr->window)->view = nil; } - TkMacOSXMakeCollectableAndRelease(wmPtr->window); - /* Activate the highest window left on the screen. */ + [window release]; + wmPtr->window = NULL; + /* Activate the highest window left on the screen. */ NSArray *windows = [NSApp orderedWindows]; NSWindow *front = [windows objectAtIndex:0]; if ( front && [front canBecomeKeyWindow] ) { @@ -5426,7 +5427,6 @@ TkMacOSXMakeRealWindowExist( if (!window) { Tcl_Panic("couldn't allocate new Mac window"); } - TkMacOSXMakeUncollectable(window); TKContentView *contentView = [[TKContentView alloc] initWithFrame:NSZeroRect]; [window setContentView:contentView]; diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index c227cd6..0be5416 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -177,8 +177,7 @@ TkpOpenDisplay( display->proto_minor_version = [[cgVers objectAtIndex:2] integerValue]; } if (!vendor[0]) { - snprintf(vendor, sizeof(vendor), "Apple AppKit %s %g", - ([NSGarbageCollector defaultCollector] ? "GC" : "RR"), + snprintf(vendor, sizeof(vendor), "Apple AppKit %g", NSAppKitVersionNumber); } display->vendor = vendor; -- cgit v0.12 From 4f6c1ad7943f8c595d9d539a6c6c33c96832554b Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 00:57:14 +0000 Subject: Cleanup and improvement of tracking of native windows in Cocoa; thanks to Marc Culler for patch --- macosx/tkMacOSXEvent.c | 33 ++++++++++--------- macosx/tkMacOSXKeyEvent.c | 8 +++-- macosx/tkMacOSXMouseEvent.c | 21 +++++------- macosx/tkMacOSXWm.c | 79 +++++++++++++++++++++------------------------ 4 files changed, 66 insertions(+), 75 deletions(-) diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c index ea262ff..365dc9b 100644 --- a/macosx/tkMacOSXEvent.c +++ b/macosx/tkMacOSXEvent.c @@ -31,18 +31,19 @@ enum { NSEvent *processedEvent = theEvent; NSEventType type = [theEvent type]; NSInteger subtype; - NSUInteger flags; switch ((NSInteger)type) { case NSAppKitDefined: subtype = [theEvent subtype]; switch (subtype) { + /* Ignored at the moment. */ case NSApplicationActivatedEventType: break; case NSApplicationDeactivatedEventType: break; case NSWindowExposedEventType: + break; case NSScreenChangedEventType: break; case NSWindowMovedEventType: @@ -53,13 +54,12 @@ enum { default: break; } - break; + break; /* AppkitEvent. Return theEvent */ case NSKeyUp: case NSKeyDown: case NSFlagsChanged: - flags = [theEvent modifierFlags]; processedEvent = [self tkProcessKeyEvent:theEvent]; - break; + break; /* Key event. Return the processed event. */ case NSLeftMouseDown: case NSLeftMouseUp: case NSRightMouseDown: @@ -76,7 +76,7 @@ enum { case NSTabletPoint: case NSTabletProximity: processedEvent = [self tkProcessMouseEvent:theEvent]; - break; + break; /* Mouse event. Return the processed event. */ #if 0 case NSSystemDefined: subtype = [theEvent subtype]; @@ -100,7 +100,7 @@ enum { #endif default: - break; + break; /* return theEvent */ } return processedEvent; } @@ -113,14 +113,14 @@ enum { * * TkMacOSXFlushWindows -- * - * This routine flushes all the windows of the application. It is + * This routine flushes all the visible windows of the application. It is * called by XSync(). * * Results: * None. * * Side effects: - * Flushes all Carbon windows + * Flushes all visible Cocoa windows * *---------------------------------------------------------------------- */ @@ -128,22 +128,23 @@ enum { MODULE_SCOPE void TkMacOSXFlushWindows(void) { - NSInteger windowCount; - NSInteger *windowNumbers; + /* This can be called from outside the Appkit event loop, + * so it needs its own AutoreleasePool. + */ + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + NSArray *macWindows = [NSApp orderedWindows]; + NSInteger windowCount = [macWindows count]; - NSCountWindows(&windowCount); if(windowCount) { - windowNumbers = ckalloc(windowCount * sizeof(NSInteger)); - NSWindowList(windowCount, windowNumbers); - for (NSInteger index = 0; index < windowCount; index++) { - NSWindow *w = [NSApp windowWithWindowNumber:windowNumbers[index]]; + for (NSWindow *w in macWindows) { if (TkMacOSXGetXWindow(w)) { [w flushWindow]; } } - ckfree(windowNumbers); } + [pool drain]; } + /* * Local Variables: diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index c9ad9f1..09cdf94 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -78,16 +78,18 @@ static unsigned isFunctionKey(unsigned int code); case NSFlagsChanged: modifiers = [theEvent modifierFlags]; keyCode = [theEvent keyCode]; - w = [self windowWithWindowNumber:[theEvent windowNumber]]; + // w = [self windowWithWindowNumber:[theEvent windowNumber]]; + w = [theEvent window]; #if defined(TK_MAC_DEBUG_EVENTS) || NS_KEYLOG == 1 NSLog(@"-[%@(%p) %s] r=%d mods=%u '%@' '%@' code=%u c=%d %@ %d", [self class], self, _cmd, repeat, modifiers, characters, charactersIgnoringModifiers, keyCode,([charactersIgnoringModifiers length] == 0) ? 0 : [charactersIgnoringModifiers characterAtIndex: 0], w, type); #endif break; default: - return theEvent; + return theEvent; /* Unrecognized key event. */ } + /* Create an Xevent to add to the Tk queue. */ if (!processingCompose) { unsigned int state = 0; @@ -128,7 +130,7 @@ static unsigned isFunctionKey(unsigned int code); tkwin = (Tk_Window) winPtr->dispPtr->focusPtr; if (!tkwin) { TkMacOSXDbgMsg("tkwin == NULL"); - return theEvent; + return theEvent; /* Give up. No window for this event. */ } /* diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 90d2d00..95f0021 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -53,19 +53,17 @@ enum { case NSCursorUpdate: #if 0 trackingArea = [theEvent trackingArea]; -#endif /* fall through */ +#endif case NSLeftMouseDown: case NSLeftMouseUp: case NSRightMouseDown: case NSRightMouseUp: case NSOtherMouseDown: case NSOtherMouseUp: - case NSLeftMouseDragged: case NSRightMouseDragged: case NSOtherMouseDragged: - case NSMouseMoved: #if 0 eventNumber = [theEvent eventNumber]; @@ -73,22 +71,20 @@ enum { clickCount = [theEvent clickCount]; buttonNumber = [theEvent buttonNumber]; } + /* fall through */ #endif - case NSTabletPoint: case NSTabletProximity: - case NSScrollWheel: - win = [self windowWithWindowNumber:[theEvent windowNumber]]; break; - default: + default: /* Unrecognized mouse event. */ return theEvent; - break; } + /* Create an Xevent to add to the Tk queue. */ + win = [theEvent window]; NSPoint global, local = [theEvent locationInWindow]; - if (win) { global = [win convertBaseToScreen:local]; local.y = [win frame].size.height - local.y; @@ -105,7 +101,7 @@ enum { tkwin = TkMacOSXGetCapture(); } if (!tkwin) { - return theEvent; + return theEvent; /* Give up. No window for this event. */ } /* @@ -127,10 +123,10 @@ enum { EventRef eventRef = (EventRef)[theEvent eventRef]; UInt32 buttons; OSStatus err = GetEventParameter(eventRef, kEventParamMouseChord, - typeUInt32, NULL, sizeof(UInt32), NULL, &buttons); + typeUInt32, NULL, sizeof(UInt32), NULL, &buttons); if (err == noErr) { - state |= (buttons & ((1<<5) - 1)) << 8; + state |= (buttons & ((1<<5) - 1)) << 8; } else if (button < 5) { switch (type) { case NSLeftMouseDown: @@ -205,7 +201,6 @@ enum { Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); } } - return theEvent; } @end diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index fc61c7f..ffb3c34 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -463,25 +463,18 @@ FrontWindowAtPoint( int x, int y) { NSPoint p = NSMakePoint(x, tkMacOSXZeroScreenHeight - y); - NSWindow *win = nil; - NSInteger windowCount; - NSInteger *windowNumbers; - - NSCountWindows(&windowCount); - if (windowCount) { - windowNumbers = ckalloc(windowCount * sizeof(NSInteger)); - NSWindowList(windowCount, windowNumbers); - for (NSInteger index = 0; index < windowCount; index++) { - NSWindow *w = [NSApp windowWithWindowNumber:windowNumbers[index]]; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + NSArray *windows = [NSApp orderedWindows]; + TkWindow *front = NULL; + for (NSWindow *w in windows) { if (w && NSMouseInRect(p, [w frame], NO)) { - win = w; + front = TkMacOSXGetTkWindow(w); break; } } - ckfree(windowNumbers); - } - return (win ? TkMacOSXGetTkWindow(win) : NULL); + [pool drain]; + return front; } /* @@ -677,6 +670,7 @@ TkWmMapWindow( */ XMapWindow(winPtr->display, winPtr->window); + } /* @@ -699,7 +693,7 @@ TkWmMapWindow( void TkWmUnmapWindow( TkWindow *winPtr) /* Top-level window that's about to be - * mapped. */ + * unmapped. */ { XUnmapWindow(winPtr->display, winPtr->window); } @@ -783,21 +777,26 @@ TkWmDeadWindow( NSWindow *window = wmPtr->window; if (window && !Tk_IsEmbedded(winPtr) ) { - [[window parentWindow] removeChildWindow:window]; + NSWindow *parent = [window parentWindow]; + if (parent) { + [parent removeChildWindow:window]; + } [window setExcludedFromWindowsMenu:YES]; [window close]; TkMacOSXUnregisterMacWindow(window); - if (winPtr->window) { - ((MacDrawable *) winPtr->window)->view = nil; + if (winPtr->window) { + ((MacDrawable *) winPtr->window)->view = nil; } - [window release]; + [window release]; wmPtr->window = NULL; - /* Activate the highest window left on the screen. */ - NSArray *windows = [NSApp orderedWindows]; - NSWindow *front = [windows objectAtIndex:0]; - if ( front && [front canBecomeKeyWindow] ) { - [front makeKeyAndOrderFront:NSApp]; - } + /* Activate the highest window left on the screen. */ + NSArray *windows = [NSApp orderedWindows]; + if ( [windows count] > 0 ) { + NSWindow *front = [windows objectAtIndex:0]; + if ( front && [front canBecomeKeyWindow] ) { + [front makeKeyAndOrderFront:NSApp]; + } + } } ckfree(wmPtr); winPtr->wmInfoPtr = NULL; @@ -5927,6 +5926,7 @@ TkpChangeFocus( if (Tk_IsTopLevel(winPtr) && !Tk_IsEmbedded(winPtr) ){ NSWindow *win = TkMacOSXDrawableWindow(winPtr->window); + NSAutoreleasePool *pool = [NSAutoreleasePool new]; TkWmRestackToplevel(winPtr, Above, NULL); if (force ) { [NSApp activateIgnoringOtherApps:YES]; @@ -5934,6 +5934,7 @@ TkpChangeFocus( if ( win && [win canBecomeKeyWindow] ) { [win makeKeyAndOrderFront:NSApp]; } + [pool drain]; } /* @@ -5952,7 +5953,7 @@ TkpChangeFocus( * WmStackorderToplevelWrapperMap -- * * This procedure will create a table that maps the reparent wrapper X id - * for a toplevel to the TkWindow structure that is wraps. Tk keeps track + * for a toplevel to the TkWindow structure that it wraps. Tk keeps track * of a mapping from the window X id to the TkWindow structure but that * does us no good here since we only get the X id of the wrapper window. * Only those toplevel windows that are mapped have a position in the @@ -6015,8 +6016,6 @@ TkWmStackorderToplevel( Tcl_HashTable table; Tcl_HashEntry *hPtr; Tcl_HashSearch search; - NSInteger windowCount; - NSInteger *windowNumbers; /* * Map mac windows to a TkWindow of the wrapped toplevel. @@ -6043,31 +6042,26 @@ TkWmStackorderToplevel( goto done; } - NSCountWindows(&windowCount); + NSArray *macWindows = [NSApp orderedWindows]; + NSInteger windowCount = [macWindows count]; + if (!windowCount) { ckfree(windows); windows = NULL; } else { windowPtr = windows + table.numEntries; *windowPtr-- = NULL; - windowNumbers = ckalloc(windowCount * sizeof(NSInteger)); - NSWindowList(windowCount, windowNumbers); - for (NSInteger index = 0; index < windowCount; index++) { - NSWindow *w = [NSApp windowWithWindowNumber:windowNumbers[index]]; - - if (w) { - hPtr = Tcl_FindHashEntry(&table, (char*) w); - if (hPtr != NULL) { - childWinPtr = Tcl_GetHashValue(hPtr); - *windowPtr-- = childWinPtr; - } + for (NSWindow *w in macWindows) { + hPtr = Tcl_FindHashEntry(&table, (char*) w); + if (hPtr != NULL) { + childWinPtr = Tcl_GetHashValue(hPtr); + *windowPtr-- = childWinPtr; } } if (windowPtr != windows-1) { Tcl_Panic("num matched toplevel windows does not equal num " - "children"); + "children"); } - ckfree(windowNumbers); } done: @@ -6626,7 +6620,6 @@ RemapWindows( MacDrawable *parentWin) { TkWindow *childPtr; - /* * Remove the OS specific window. It will get rebuilt when the window gets * Mapped. -- cgit v0.12 From f22c4207e5275f1e2c792672b41f6828372d6203 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 00:57:31 +0000 Subject: Cleanup and improvement of tracking of native windows in Cocoa; thanks to Marc Culler for patch --- macosx/tkMacOSXEvent.c | 38 ++++++++--------- macosx/tkMacOSXKeyEvent.c | 8 ++-- macosx/tkMacOSXMouseEvent.c | 15 +++---- macosx/tkMacOSXWm.c | 102 ++++++++++++++++++++------------------------ 4 files changed, 74 insertions(+), 89 deletions(-) diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c index 73a67ad..6685b80 100644 --- a/macosx/tkMacOSXEvent.c +++ b/macosx/tkMacOSXEvent.c @@ -30,18 +30,19 @@ enum { NSEvent *processedEvent = theEvent; NSEventType type = [theEvent type]; NSInteger subtype; - NSUInteger flags; switch ((NSInteger)type) { case NSAppKitDefined: subtype = [theEvent subtype]; switch (subtype) { + /* Ignored at the moment. */ case NSApplicationActivatedEventType: break; case NSApplicationDeactivatedEventType: break; case NSWindowExposedEventType: + break; case NSScreenChangedEventType: break; case NSWindowMovedEventType: @@ -52,13 +53,12 @@ enum { default: break; } - break; + break; /* AppkitEvent. Return theEvent */ case NSKeyUp: case NSKeyDown: case NSFlagsChanged: - flags = [theEvent modifierFlags]; processedEvent = [self tkProcessKeyEvent:theEvent]; - break; + break; /* Key event. Return the processed event. */ case NSLeftMouseDown: case NSLeftMouseUp: case NSRightMouseDown: @@ -75,7 +75,7 @@ enum { case NSTabletPoint: case NSTabletProximity: processedEvent = [self tkProcessMouseEvent:theEvent]; - break; + break; /* Mouse event. Return the processed event. */ #if 0 case NSSystemDefined: subtype = [theEvent subtype]; @@ -99,7 +99,7 @@ enum { #endif default: - break; + break; /* return theEvent */ } return processedEvent; } @@ -112,36 +112,32 @@ enum { * * TkMacOSXFlushWindows -- * - * This routine flushes all the windows of the application. It is + * This routine flushes all the visible windows of the application. It is * called by XSync(). * * Results: * None. * * Side effects: - * Flushes all Carbon windows + * Flushes all visible Cocoa windows * *---------------------------------------------------------------------- */ - MODULE_SCOPE void TkMacOSXFlushWindows(void) { - NSInteger windowCount; - NSInteger *windowNumbers; + /* This can be called from outside the Appkit event loop, + * so it needs its own AutoreleasePool. + */ + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + NSArray *macWindows = [NSApp orderedWindows]; - NSCountWindows(&windowCount); - if(windowCount) { - windowNumbers = (NSInteger *) ckalloc(windowCount * sizeof(NSInteger)); - NSWindowList(windowCount, windowNumbers); - for (NSInteger index = 0; index < windowCount; index++) { - NSWindow *w = [NSApp windowWithWindowNumber:windowNumbers[index]]; - if (TkMacOSXGetXWindow(w)) { - [w flushWindow]; - } + for (NSWindow *w in macWindows) { + if (TkMacOSXGetXWindow(w)) { + [w flushWindow]; } - ckfree((char*) windowNumbers); } + [pool drain]; } /* diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index c9ad9f1..09cdf94 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -78,16 +78,18 @@ static unsigned isFunctionKey(unsigned int code); case NSFlagsChanged: modifiers = [theEvent modifierFlags]; keyCode = [theEvent keyCode]; - w = [self windowWithWindowNumber:[theEvent windowNumber]]; + // w = [self windowWithWindowNumber:[theEvent windowNumber]]; + w = [theEvent window]; #if defined(TK_MAC_DEBUG_EVENTS) || NS_KEYLOG == 1 NSLog(@"-[%@(%p) %s] r=%d mods=%u '%@' '%@' code=%u c=%d %@ %d", [self class], self, _cmd, repeat, modifiers, characters, charactersIgnoringModifiers, keyCode,([charactersIgnoringModifiers length] == 0) ? 0 : [charactersIgnoringModifiers characterAtIndex: 0], w, type); #endif break; default: - return theEvent; + return theEvent; /* Unrecognized key event. */ } + /* Create an Xevent to add to the Tk queue. */ if (!processingCompose) { unsigned int state = 0; @@ -128,7 +130,7 @@ static unsigned isFunctionKey(unsigned int code); tkwin = (Tk_Window) winPtr->dispPtr->focusPtr; if (!tkwin) { TkMacOSXDbgMsg("tkwin == NULL"); - return theEvent; + return theEvent; /* Give up. No window for this event. */ } /* diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 89f0642..d1b4114 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -52,19 +52,17 @@ enum { case NSCursorUpdate: #if 0 trackingArea = [theEvent trackingArea]; -#endif /* fall through */ +#endif case NSLeftMouseDown: case NSLeftMouseUp: case NSRightMouseDown: case NSRightMouseUp: case NSOtherMouseDown: case NSOtherMouseUp: - case NSLeftMouseDragged: case NSRightMouseDragged: case NSOtherMouseDragged: - case NSMouseMoved: #if 0 eventNumber = [theEvent eventNumber]; @@ -73,19 +71,17 @@ enum { buttonNumber = [theEvent buttonNumber]; } #endif - case NSTabletPoint: case NSTabletProximity: - case NSScrollWheel: - win = [self windowWithWindowNumber:[theEvent windowNumber]]; break; - default: + default: /* Unrecognized mouse event. */ return theEvent; - break; } + /* Create an Xevent to add to the Tk queue. */ + win = [theEvent window]; NSPoint global, local = [theEvent locationInWindow]; if (win) { global = [win convertBaseToScreen:local]; @@ -103,7 +99,7 @@ enum { tkwin = TkMacOSXGetCapture(); } if (!tkwin) { - return theEvent; + return theEvent; /* Give up. No window for this event. */ } /* @@ -203,7 +199,6 @@ enum { Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); } } - return theEvent; } @end diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 23b107f..a852ac9 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -464,28 +464,20 @@ static TkWindow* FrontWindowAtPoint( int x, int y) { - NSPoint p = NSMakePoint(x, tkMacOSXZeroScreenHeight - y); - NSWindow *win = nil; - NSInteger windowCount; - NSInteger *windowNumbers; - - NSCountWindows(&windowCount); - if (windowCount) { - windowNumbers = (NSInteger *) ckalloc(windowCount * sizeof(NSInteger)); - NSWindowList(windowCount, windowNumbers); - for (NSInteger index = 0; index < windowCount; index++) { - NSWindow *w = [NSApp windowWithWindowNumber:windowNumbers[index]]; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + NSArray *windows = [NSApp orderedWindows]; + TkWindow *front = NULL; + + for (NSWindow *w in windows) { if (w && NSMouseInRect(p, [w frame], NO)) { - win = w; + front = TkMacOSXGetTkWindow(w); break; } } - ckfree((char *) windowNumbers); - } - return (win ? TkMacOSXGetTkWindow(win) : NULL); + [pool drain]; + return front; } - /* *---------------------------------------------------------------------- @@ -681,6 +673,7 @@ TkWmMapWindow( */ XMapWindow(winPtr->display, winPtr->window); + } /* @@ -703,7 +696,7 @@ TkWmMapWindow( void TkWmUnmapWindow( TkWindow *winPtr) /* Top-level window that's about to be - * mapped. */ + * unmapped. */ { XUnmapWindow(winPtr->display, winPtr->window); } @@ -786,25 +779,30 @@ TkWmDeadWindow( */ NSWindow *window = wmPtr->window; + if (window && !Tk_IsEmbedded(winPtr) ) { - [[window parentWindow] removeChildWindow:window]; + NSWindow *parent = [window parentWindow]; + if (parent) { + [parent removeChildWindow:window]; + } [window setExcludedFromWindowsMenu:YES]; [window close]; - TkMacOSXUnregisterMacWindow(window); - if (winPtr->window) { - ((MacDrawable *) winPtr->window)->view = nil; - } - [window release]; - wmPtr->window = NULL; - /* Activate the highest window left on the screen. */ - NSArray *windows = [NSApp orderedWindows]; - NSWindow *front = [windows objectAtIndex:0]; - if ( front && [front canBecomeKeyWindow] ) { - [front makeKeyAndOrderFront:NSApp]; + TkMacOSXUnregisterMacWindow(window); + if (winPtr->window) { + ((MacDrawable *) winPtr->window)->view = nil; } - } - - ckfree((char *) wmPtr); + [window release]; + wmPtr->window = NULL; + /* Activate the highest window left on the screen. */ + NSArray *windows = [NSApp orderedWindows]; + if ( [windows count] > 0 ) { + NSWindow *front = [windows objectAtIndex:0]; + if ( front && [front canBecomeKeyWindow] ) { + [front makeKeyAndOrderFront:NSApp]; + } + } + } + ckfree(wmPtr); winPtr->wmInfoPtr = NULL; } @@ -5867,6 +5865,7 @@ TkpChangeFocus( if (Tk_IsTopLevel(winPtr) && !Tk_IsEmbedded(winPtr) ){ NSWindow *win = TkMacOSXDrawableWindow(winPtr->window); + NSAutoreleasePool *pool = [NSAutoreleasePool new]; TkWmRestackToplevel(winPtr, Above, NULL); if (force ) { [NSApp activateIgnoringOtherApps:YES]; @@ -5874,6 +5873,7 @@ TkpChangeFocus( if ( win && [win canBecomeKeyWindow] ) { [win makeKeyAndOrderFront:NSApp]; } + [pool drain]; } /* @@ -5892,7 +5892,7 @@ TkpChangeFocus( * WmStackorderToplevelWrapperMap -- * * This procedure will create a table that maps the reparent wrapper X id - * for a toplevel to the TkWindow structure that is wraps. Tk keeps track + * for a toplevel to the TkWindow structure that it wraps. Tk keeps track * of a mapping from the window X id to the TkWindow structure but that * does us no good here since we only get the X id of the wrapper window. * Only those toplevel windows that are mapped have a position in the @@ -5951,12 +5951,10 @@ TkWindow ** TkWmStackorderToplevel( TkWindow *parentPtr) /* Parent toplevel window. */ { - TkWindow *childWinPtr, **windows, **window_ptr; + TkWindow *childWinPtr, **windows, **windowPtr; Tcl_HashTable table; Tcl_HashEntry *hPtr; Tcl_HashSearch search; - NSInteger windowCount; - NSInteger *windowNumbers; /* * Map mac windows to a TkWindow of the wrapped toplevel. @@ -5983,31 +5981,26 @@ TkWmStackorderToplevel( goto done; } - NSCountWindows(&windowCount); + NSArray *macWindows = [NSApp orderedWindows]; + NSInteger windowCount = [macWindows count]; + if (!windowCount) { - ckfree((char *) windows); + ckfree(windows); windows = NULL; } else { - window_ptr = windows + table.numEntries; - *window_ptr-- = NULL; - windowNumbers = (NSInteger*)ckalloc(windowCount * sizeof(NSInteger)); - NSWindowList(windowCount, windowNumbers); - for (NSInteger index = 0; index < windowCount; index++) { - NSWindow *w = [NSApp windowWithWindowNumber:windowNumbers[index]]; - - if (w) { - hPtr = Tcl_FindHashEntry(&table, (char*) w); - if (hPtr != NULL) { - childWinPtr = Tcl_GetHashValue(hPtr); - *window_ptr-- = childWinPtr; - } + windowPtr = windows + table.numEntries; + *windowPtr-- = NULL; + for (NSWindow *w in macWindows) { + hPtr = Tcl_FindHashEntry(&table, (char*) w); + if (hPtr != NULL) { + childWinPtr = Tcl_GetHashValue(hPtr); + *windowPtr-- = childWinPtr; } } - if (window_ptr != (windows-1)) { + if (windowPtr != windows-1) { Tcl_Panic("num matched toplevel windows does not equal num " - "children"); + "children"); } - ckfree((char *) windowNumbers); } done: @@ -6569,7 +6562,6 @@ RemapWindows( MacDrawable *parentWin) { TkWindow *childPtr; - /* * Remove the OS specific window. It will get rebuilt when the window gets * Mapped. -- cgit v0.12 From 6596343ef6a711a8b5a51e17c946f206a90efe16 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 01:22:30 +0000 Subject: Cleanup and simplification of memory management in event loop; now works more smoothly; thanks to Marc Culler for patches --- macosx/tkMacOSXMenu.c | 9 +++- macosx/tkMacOSXNotify.c | 117 ++++++++++++++++++------------------------- macosx/tkMacOSXSubwindows.c | 6 +++ macosx/tkMacOSXWindowEvent.c | 35 ++++++++++--- macosx/tkMacOSXWm.c | 14 +++++- 5 files changed, 104 insertions(+), 77 deletions(-) diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 9f14f47..0cc874c 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -375,6 +375,13 @@ static int ModifierCharWidth(Tk_Font tkfont); @implementation TKApplication(TKMenu) +- (void) safeSetMainMenu: (NSMenu *) menu +{ + NSAutoreleasePool* pool = [NSAutoreleasePool new]; + [self setMainMenu: menu]; + [pool drain]; +} + - (void) menuBeginTracking: (NSNotification *) notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS @@ -466,7 +473,7 @@ static int ModifierCharWidth(Tk_Font tkfont); [servicesMenuItem setSubmenu:_servicesMenu]; } [self setAppleMenu:applicationMenu]; - [self setMainMenu:menu]; + [self safeSetMainMenu:menu]; } @end diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index ab68931..905ada5 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -18,9 +18,9 @@ #include #import +/* This is not used for anything at the moment. */ typedef struct ThreadSpecificData { - int initialized, sendEventNestingLevel; - NSEvent *currentEvent; + int initialized; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; @@ -34,6 +34,7 @@ static void TkMacOSXEventsCheckProc(ClientData clientData, int flags); #pragma mark TKApplication(TKNotify) @interface NSApplication(TKNotify) +/* We need to declare this hidden method. */ - (void) _modalSession: (NSModalSession) session sendEvent: (NSEvent *) event; @end @@ -48,42 +49,30 @@ static void TkMacOSXEventsCheckProc(ClientData clientData, int flags); @end @implementation TKApplication(TKNotify) +/* Redisplay all of our windows, then call super. */ - (NSEvent *) nextEventMatchingMask: (NSUInteger) mask untilDate: (NSDate *) expiration inMode: (NSString *) mode dequeue: (BOOL) deqFlag { NSAutoreleasePool *pool = [NSAutoreleasePool new]; - [NSApp makeWindowsPerform:@selector(tkDisplayIfNeeded) inOrder:NO]; - - int oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); - NSEvent *event = [[super nextEventMatchingMask:mask untilDate:expiration - inMode:mode dequeue:deqFlag] retain]; - - Tcl_SetServiceMode(oldMode); - if (event) { - TSD_INIT(); - if (tsdPtr->sendEventNestingLevel) { - if (![NSApp tkProcessEvent:event]) { - [event release]; - event = nil; - } - } - } [pool drain]; - return [event autorelease]; + NSEvent *event = [super nextEventMatchingMask:mask + untilDate:expiration + inMode:mode + dequeue:deqFlag]; + return event; } +/* + * Call super then check the pasteboard. + */ - (void) sendEvent: (NSEvent *) theEvent { - TSD_INIT(); - int oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); - - tsdPtr->sendEventNestingLevel++; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; [super sendEvent:theEvent]; - tsdPtr->sendEventNestingLevel--; - Tcl_SetServiceMode(oldMode); [NSApp tkCheckPasteboard]; + [pool drain]; } @end @@ -161,7 +150,8 @@ Tk_MacOSXSetupTkNotifier(void) "first [load] of TkAqua has to occur in the main thread!"); } Tcl_CreateEventSource(TkMacOSXEventsSetupProc, - TkMacOSXEventsCheckProc, GetMainEventQueue()); + TkMacOSXEventsCheckProc, + GetMainEventQueue()); TkCreateExitHandler(TkMacOSXNotifyExitHandler, NULL); Tcl_SetServiceMode(TCL_SERVICE_ALL); TclMacOSXNotifierAddRunLoopMode(NSEventTrackingRunLoopMode); @@ -194,7 +184,8 @@ TkMacOSXNotifyExitHandler( TSD_INIT(); Tcl_DeleteEventSource(TkMacOSXEventsSetupProc, - TkMacOSXEventsCheckProc, GetMainEventQueue()); + TkMacOSXEventsCheckProc, + GetMainEventQueue()); tsdPtr->initialized = 0; } @@ -203,16 +194,19 @@ TkMacOSXNotifyExitHandler( * * TkMacOSXEventsSetupProc -- * - * This procedure implements the setup part of the TkAqua Events event - * source. It is invoked by Tcl_DoOneEvent before entering the notifier - * to check for events. + * This procedure implements the setup part of the MacOSX event + * source. It is invoked by Tcl_DoOneEvent before calling + * TkMacOSXEventsProc to process all queued NSEvents. In our + * case, all we need to do is to set the Tcl MaxBlockTime to + * 0 before starting the loop to process all queued NSEvents. * * Results: * None. * * Side effects: - * If TkAqua events are queued, then the maximum block time will be set - * to 0 to ensure that the notifier returns control to Tcl. + * + * If NSEvents are queued, then the maximum block time will be set + * to 0 to ensure that control returns immediately to Tcl. * *---------------------------------------------------------------------- */ @@ -225,19 +219,13 @@ TkMacOSXEventsSetupProc( if (flags & TCL_WINDOW_EVENTS && ![[NSRunLoop currentRunLoop] currentMode]) { static const Tcl_Time zeroBlockTime = { 0, 0 }; - TSD_INIT(); - - if (!tsdPtr->currentEvent) { - NSEvent *currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask - untilDate:[NSDate distantPast] - inMode:GetRunLoopMode(TkMacOSXGetModalSession()) - dequeue:YES]; - if (currentEvent) { - tsdPtr->currentEvent = [currentEvent retain]; - } - } - if (tsdPtr->currentEvent) { + /* Call this with dequeue=NO -- just checking if the queue is empty. */ + NSEvent *currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:[NSDate distantPast] + inMode:GetRunLoopMode(TkMacOSXGetModalSession()) + dequeue:NO]; + if (currentEvent) { Tcl_SetMaxBlockTime(&zeroBlockTime); } } @@ -248,17 +236,18 @@ TkMacOSXEventsSetupProc( * * TkMacOSXEventsCheckProc -- * - * This procedure processes events sitting in the TkAqua event queue. + * This procedure loops through all NSEvents waiting in the + * TKApplication event queue, generating X events from them. * * Results: * None. * * Side effects: - * Moves applicable queued TkAqua events onto the Tcl event queue. + * NSevents are used to generate X events, which are added to the + * Tcl event queue. * *---------------------------------------------------------------------- */ - static void TkMacOSXEventsCheckProc( ClientData clientData, @@ -267,31 +256,23 @@ TkMacOSXEventsCheckProc( if (flags & TCL_WINDOW_EVENTS && ![[NSRunLoop currentRunLoop] currentMode]) { NSEvent *currentEvent = nil; - NSAutoreleasePool *pool = nil; NSModalSession modalSession; - TSD_INIT(); - if (tsdPtr->currentEvent) { - currentEvent = tsdPtr->currentEvent; - [currentEvent autorelease]; - } do { modalSession = TkMacOSXGetModalSession(); + currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:[NSDate distantPast] + inMode:GetRunLoopMode(modalSession) + dequeue:YES]; if (!currentEvent) { - currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask - untilDate:[NSDate distantPast] - inMode:GetRunLoopMode(modalSession) dequeue:YES]; - } - if (!currentEvent) { - break; + break; /* No more events. */ } - [currentEvent retain]; - pool = [NSAutoreleasePool new]; - if (![NSApp tkProcessEvent:currentEvent]) { - [currentEvent release]; - currentEvent = nil; - } - if (currentEvent) { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + /* Generate Xevents. */ + int oldServiceMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); + NSEvent *processedEvent = [NSApp tkProcessEvent:currentEvent]; + Tcl_SetServiceMode(oldServiceMode); + if (processedEvent) { /* Should always be non-NULL. */ #ifdef TK_MAC_DEBUG_EVENTS TKLog(@" event: %@", currentEvent); #endif @@ -300,14 +281,12 @@ TkMacOSXEventsCheckProc( } else { [NSApp sendEvent:currentEvent]; } - [currentEvent release]; - currentEvent = nil; } [pool drain]; - pool = nil; } while (1); } } + /* * Local Variables: diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index ee9167b..869f717 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -131,6 +131,11 @@ XMapWindow( { MacDrawable *macWin = (MacDrawable *) window; XEvent event; + /* + * This function can be called from outside the AppKit event + * loop, so it needs its own AutoreleasePool. + */ + NSAutoreleasePool* pool = [NSAutoreleasePool new]; /* * Under certain situations it's possible for this function to be called @@ -189,6 +194,7 @@ XMapWindow( event.xvisibility.type = VisibilityNotify; event.xvisibility.state = VisibilityUnobscured; NotifyVisibility(macWin->winPtr, &event); + [pool drain]; } /* diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 241da83..2e7c041 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -794,7 +794,6 @@ Tk_MacOSXIsAppInFront(void) @implementation TKContentView @end - /*Restrict event processing to Expose events.*/ static Tk_RestrictAction ExposeRestrictProc( @@ -842,9 +841,37 @@ ExposeRestrictProc( CFRelease(drawShape); } +-(void) setFrameSize: (NSSize)newsize +{ + if ( [self inLiveResize] ) { + NSWindow *window = [self window]; + TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); + Tk_Window tkwin = (Tk_Window) winPtr; + unsigned int width = (unsigned int)newsize.width; + unsigned int height=(unsigned int)newsize.height; + + /* Resize the Tk Window to the requested size.*/ + TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height, + TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY); + + /* Then resize the NSView to the actual window size*/ + newsize.width = (CGFloat)Tk_Width(tkwin); + newsize.height = (CGFloat)Tk_Height(tkwin); + [super setFrameSize: newsize]; + + /* Process all pending events to update the window. */ + while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {} + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} + + } else { + [super setFrameSize: newsize]; + } +} + /* * As insurance against bugs that might cause layout glitches during a live - * resize, we redraw the window at the end of the resize operation. + * resize, we redraw the window one more time at the end of the resize + * operation. */ - (void)viewDidEndLiveResize @@ -852,13 +879,11 @@ ExposeRestrictProc( HIRect bounds = NSRectToCGRect([self bounds]); HIShapeRef shape = HIShapeCreateWithRect(&bounds); [self generateExposeEvents: shape]; - } /*Core function of this class, generates expose events for redrawing.*/ - (void) generateExposeEvents: (HIMutableShapeRef) shape { - TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); unsigned long serial; CGRect updateBounds; @@ -867,7 +892,6 @@ ExposeRestrictProc( return; } - HIShapeGetBounds(shape, &updateBounds); serial = LastKnownRequestProcessed(Tk_Display(winPtr)); if (GenerateUpdates(shape, &updateBounds, winPtr) && @@ -895,7 +919,6 @@ ExposeRestrictProc( Tk_RestrictEvents(oldProc, oldArg, &oldArg); while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} - } } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index ffb3c34..8866118 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -21,6 +21,8 @@ #include "tkMacOSXEvent.h" #include "tkMacOSXDebug.h" +#define DEBUG_ZOMBIES 0 + /* #ifdef TK_MAC_DEBUG #define TK_MAC_DEBUG_WINDOWS @@ -350,6 +352,17 @@ static void RemapWindows(TkWindow *winPtr, kHelpWindowClass || winPtr->wmInfoPtr->attributes & kWindowNoActivatesAttribute)) ? NO : YES; } + +- (id) retain +{ +#if DEBUG_ZOMBIES + const char *title = [[self title] UTF8String]; + if (title != NULL) { + printf("Retaining %s with count %lu\n", title, [self retainCount]); + } +#endif + return [super retain]; +} @end #pragma mark - @@ -781,7 +794,6 @@ TkWmDeadWindow( if (parent) { [parent removeChildWindow:window]; } - [window setExcludedFromWindowsMenu:YES]; [window close]; TkMacOSXUnregisterMacWindow(window); if (winPtr->window) { -- cgit v0.12 From 50ec1ecb24801b023618048a6704fa12670671d9 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 01:22:36 +0000 Subject: Cleanup and simplification of memory management in event loop; now works more smoothly; thanks to Marc Culler for patches --- macosx/tkMacOSXMenu.c | 9 +++- macosx/tkMacOSXNotify.c | 116 +++++++++++++++++++------------------------ macosx/tkMacOSXSubwindows.c | 6 +++ macosx/tkMacOSXWindowEvent.c | 33 ++++++++++-- macosx/tkMacOSXWm.c | 14 +++++- 5 files changed, 106 insertions(+), 72 deletions(-) diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 472520f..5ae38f8 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -375,6 +375,13 @@ static int ModifierCharWidth(Tk_Font tkfont); @implementation TKApplication(TKMenu) +- (void) safeSetMainMenu: (NSMenu *) menu +{ + NSAutoreleasePool* pool = [NSAutoreleasePool new]; + [self setMainMenu: menu]; + [pool drain]; +} + - (void) menuBeginTracking: (NSNotification *) notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS @@ -466,7 +473,7 @@ static int ModifierCharWidth(Tk_Font tkfont); [servicesMenuItem setSubmenu:_servicesMenu]; } [self setAppleMenu:applicationMenu]; - [self setMainMenu:menu]; + [self safeSetMainMenu:menu]; } @end diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index d35427a..6a4e6c1 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -18,9 +18,9 @@ #include #import +/* This is not used for anything at the moment. */ typedef struct ThreadSpecificData { - int initialized, sendEventNestingLevel; - NSEvent *currentEvent; + int initialized; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; @@ -34,6 +34,7 @@ static void TkMacOSXEventsCheckProc(ClientData clientData, int flags); #pragma mark TKApplication(TKNotify) @interface NSApplication(TKNotify) +/* We need to declare this hidden method. */ - (void)_modalSession:(NSModalSession)session sendEvent:(NSEvent *)event; @end @@ -47,35 +48,28 @@ static void TkMacOSXEventsCheckProc(ClientData clientData, int flags); @end @implementation TKApplication(TKNotify) +/* Redisplay all of our windows, then call super. */ - (NSEvent *)nextEventMatchingMask:(NSUInteger)mask untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag { NSAutoreleasePool *pool = [NSAutoreleasePool new]; [NSApp makeWindowsPerform:@selector(tkDisplayIfNeeded) inOrder:NO]; - int oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); - NSEvent *event = [[super nextEventMatchingMask:mask untilDate:expiration - inMode:mode dequeue:deqFlag] retain]; - Tcl_SetServiceMode(oldMode); - if (event) { - TSD_INIT(); - if (tsdPtr->sendEventNestingLevel) { - if (![NSApp tkProcessEvent:event]) { - [event release]; - event = nil; - } - } - } [pool drain]; - return [event autorelease]; + NSEvent *event = [super nextEventMatchingMask:mask + untilDate:expiration + inMode:mode + dequeue:deqFlag]; + return event; } + + /* + * Call super then check the pasteboard. + */ - (void)sendEvent:(NSEvent *)theEvent { - TSD_INIT(); - int oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); - tsdPtr->sendEventNestingLevel++; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; [super sendEvent:theEvent]; - tsdPtr->sendEventNestingLevel--; - Tcl_SetServiceMode(oldMode); [NSApp tkCheckPasteboard]; + [pool drain]; } @end @@ -152,7 +146,8 @@ Tk_MacOSXSetupTkNotifier(void) "first [load] of TkAqua has to occur in the main thread!"); } Tcl_CreateEventSource(TkMacOSXEventsSetupProc, - TkMacOSXEventsCheckProc, GetMainEventQueue()); + TkMacOSXEventsCheckProc, + GetMainEventQueue()); TkCreateExitHandler(TkMacOSXNotifyExitHandler, NULL); Tcl_SetServiceMode(TCL_SERVICE_ALL); TclMacOSXNotifierAddRunLoopMode(NSEventTrackingRunLoopMode); @@ -184,7 +179,8 @@ TkMacOSXNotifyExitHandler( { TSD_INIT(); Tcl_DeleteEventSource(TkMacOSXEventsSetupProc, - TkMacOSXEventsCheckProc, GetMainEventQueue()); + TkMacOSXEventsCheckProc, + GetMainEventQueue()); tsdPtr->initialized = 0; } @@ -193,16 +189,19 @@ TkMacOSXNotifyExitHandler( * * TkMacOSXEventsSetupProc -- * - * This procedure implements the setup part of the TkAqua Events event - * source. It is invoked by Tcl_DoOneEvent before entering the notifier - * to check for events. + * This procedure implements the setup part of the MacOSX event + * source. It is invoked by Tcl_DoOneEvent before calling + * TkMacOSXEventsProc to process all queued NSEvents. In our + * case, all we need to do is to set the Tcl MaxBlockTime to + * 0 before starting the loop to process all queued NSEvents. * * Results: * None. * * Side effects: - * If TkAqua events are queued, then the maximum block time will be set - * to 0 to ensure that the notifier returns control to Tcl. + * + * If NSEvents are queued, then the maximum block time will be set + * to 0 to ensure that control returns immediately to Tcl. * *---------------------------------------------------------------------- */ @@ -213,20 +212,14 @@ TkMacOSXEventsSetupProc( int flags) { if (flags & TCL_WINDOW_EVENTS && - ![[NSRunLoop currentRunLoop] currentMode]) { + ![[NSRunLoop currentRunLoop] currentMode]) { static Tcl_Time zeroBlockTime = { 0, 0 }; - - TSD_INIT(); - if (!tsdPtr->currentEvent) { - NSEvent *currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask - untilDate:[NSDate distantPast] - inMode:GetRunLoopMode(TkMacOSXGetModalSession()) - dequeue:YES]; - if (currentEvent) { - tsdPtr->currentEvent = [currentEvent retain]; - } - } - if (tsdPtr->currentEvent) { + /* Call this with dequeue=NO -- just checking if the queue is empty. */ + NSEvent *currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:[NSDate distantPast] + inMode:GetRunLoopMode(TkMacOSXGetModalSession()) + dequeue:NO]; + if (currentEvent) { Tcl_SetMaxBlockTime(&zeroBlockTime); } } @@ -237,17 +230,18 @@ TkMacOSXEventsSetupProc( * * TkMacOSXEventsCheckProc -- * - * This procedure processes events sitting in the TkAqua event queue. + * This procedure loops through all NSEvents waiting in the + * TKApplication event queue, generating X events from them. * * Results: * None. * * Side effects: - * Moves applicable queued TkAqua events onto the Tcl event queue. + * NSevents are used to generate X events, which are added to the + * Tcl event queue. * *---------------------------------------------------------------------- */ - static void TkMacOSXEventsCheckProc( ClientData clientData, @@ -256,31 +250,23 @@ TkMacOSXEventsCheckProc( if (flags & TCL_WINDOW_EVENTS && ![[NSRunLoop currentRunLoop] currentMode]) { NSEvent *currentEvent = nil; - NSAutoreleasePool *pool = nil; NSModalSession modalSession; - TSD_INIT(); - if (tsdPtr->currentEvent) { - currentEvent = tsdPtr->currentEvent; - [currentEvent autorelease]; - } do { modalSession = TkMacOSXGetModalSession(); + currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:[NSDate distantPast] + inMode:GetRunLoopMode(modalSession) + dequeue:YES]; if (!currentEvent) { - currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask - untilDate:[NSDate distantPast] - inMode:GetRunLoopMode(modalSession) dequeue:YES]; + break; /* No more events. */ } - if (!currentEvent) { - break; - } - [currentEvent retain]; - pool = [NSAutoreleasePool new]; - if (![NSApp tkProcessEvent:currentEvent]) { - [currentEvent release]; - currentEvent = nil; - } - if (currentEvent) { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + /* Generate Xevents. */ + int oldServiceMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); + NSEvent *processedEvent = [NSApp tkProcessEvent:currentEvent]; + Tcl_SetServiceMode(oldServiceMode); + if (processedEvent) { /* Should always be non-NULL. */ #ifdef TK_MAC_DEBUG_EVENTS TKLog(@" event: %@", currentEvent); #endif @@ -289,14 +275,12 @@ TkMacOSXEventsCheckProc( } else { [NSApp sendEvent:currentEvent]; } - [currentEvent release]; - currentEvent = nil; } [pool drain]; - pool = nil; } while (1); } } + /* * Local Variables: diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 95cc338..a9703c1 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -131,6 +131,11 @@ XMapWindow( { MacDrawable *macWin = (MacDrawable *) window; XEvent event; + /* + * This function can be called from outside the AppKit event + * loop, so it needs its own AutoreleasePool. + */ + NSAutoreleasePool* pool = [NSAutoreleasePool new]; /* * Under certain situations it's possible for this function to be called @@ -189,6 +194,7 @@ XMapWindow( event.xvisibility.type = VisibilityNotify; event.xvisibility.state = VisibilityUnobscured; NotifyVisibility(macWin->winPtr, &event); + [pool drain]; } /* diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 86a1960..d68a933 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -796,7 +796,6 @@ Tk_MacOSXIsAppInFront(void) @implementation TKContentView @end - /*Restrict event processing to Expose events.*/ static Tk_RestrictAction ExposeRestrictProc( @@ -846,9 +845,37 @@ ExposeRestrictProc( } +-(void) setFrameSize: (NSSize)newsize +{ + if ( [self inLiveResize] ) { + NSWindow *window = [self window]; + TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); + Tk_Window tkwin = (Tk_Window) winPtr; + unsigned int width = (unsigned int)newsize.width; + unsigned int height=(unsigned int)newsize.height; + + /* Resize the Tk Window to the requested size.*/ + TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height, + TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY); + + /* Then resize the NSView to the actual window size*/ + newsize.width = (CGFloat)Tk_Width(tkwin); + newsize.height = (CGFloat)Tk_Height(tkwin); + [super setFrameSize: newsize]; + + /* Process all pending events to update the window. */ + while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {} + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} + + } else { + [super setFrameSize: newsize]; + } +} + /* * As insurance against bugs that might cause layout glitches during a live - * resize, we redraw the window at the end of the resize operation. + * resize, we redraw the window one more time at the end of the resize + * operation. */ - (void)viewDidEndLiveResize @@ -872,7 +899,6 @@ ExposeRestrictProc( return; } - HIShapeGetBounds(shape, &updateBounds); serial = LastKnownRequestProcessed(Tk_Display(winPtr)); if (GenerateUpdates(shape, &updateBounds, winPtr) && @@ -900,7 +926,6 @@ ExposeRestrictProc( Tk_RestrictEvents(oldProc, oldArg, &oldArg); while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} - } } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index a852ac9..8459bdd 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -22,6 +22,8 @@ #include "tkMacOSXDebug.h" #include +#define DEBUG_ZOMBIES 0 + /* #ifdef TK_MAC_DEBUG #define TK_MAC_DEBUG_WINDOWS @@ -338,6 +340,17 @@ static void RemapWindows(TkWindow *winPtr, { id _i1, _i2; } + +- (id) retain +{ +#if DEBUG_ZOMBIES + const char *title = [[self title] UTF8String]; + if (title != NULL) { + printf("Retaining %s with count %lu\n", title, [self retainCount]); + } +#endif + return [super retain]; +} @end @implementation TKWindow @@ -785,7 +798,6 @@ TkWmDeadWindow( if (parent) { [parent removeChildWindow:window]; } - [window setExcludedFromWindowsMenu:YES]; [window close]; TkMacOSXUnregisterMacWindow(window); if (winPtr->window) { -- cgit v0.12 From 2dada458ac1b4e93abc46dc642b17c0278dab630 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 01:30:55 +0000 Subject: Improvement of memory management, removal of zombie windows from Tk-Cocoa; thanks to Marc Culler for patch --- macosx/tkMacOSXKeyEvent.c | 17 +++++++++++------ macosx/tkMacOSXMenu.c | 2 ++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 09cdf94..7e7e8e4 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -27,7 +27,9 @@ static Tk_Window grabWinPtr = NULL; /* Current grab window, NULL if no grab. */ static Tk_Window keyboardGrabWinPtr = NULL; /* Current keyboard grab window. */ -static NSModalSession modalSession = NULL; +static NSWindow *keyboardGrabNSWindow = nil; + /* NSWindow for the current keyboard grab window. */ +static NSModalSession modalSession = nil; static BOOL processingCompose = NO; static BOOL finishedCompose = NO; @@ -476,7 +478,9 @@ XGrabKeyboard( if (modalSession) { Tcl_Panic("XGrabKeyboard: already grabbed"); } - modalSession = [NSApp beginModalSessionForWindow:[w retain]]; + keyboardGrabNSWindow = w; + [w retain]; + modalSession = [NSApp beginModalSessionForWindow:w]; } } return GrabSuccess; @@ -504,11 +508,12 @@ XUngrabKeyboard( Time time) { if (modalSession) { - NSWindow *w = keyboardGrabWinPtr ? TkMacOSXDrawableWindow( - ((TkWindow *) keyboardGrabWinPtr)->window) : nil; [NSApp endModalSession:modalSession]; - [w release]; - modalSession = NULL; + modalSession = nil; + } + if (keyboardGrabNSWindow) { + [keyboardGrabNSWindow release]; + keyboardGrabNSWindow = nil; } keyboardGrabWinPtr = NULL; } diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 0cc874c..ed22640 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -261,6 +261,7 @@ static int ModifierCharWidth(Tk_Font tkfont); /*Add time for errors to fire if necessary. This is sub-optimal but avoids issues with Tcl/Cocoa event loop integration.*/ Tcl_Sleep(100); + NSAutoreleasePool *pool = [NSAutoreleasePool new]; Tcl_Preserve(interp); Tcl_Preserve(menuPtr); @@ -273,6 +274,7 @@ static int ModifierCharWidth(Tk_Font tkfont); } Tcl_Release(menuPtr); Tcl_Release(interp); + [pool drain]; } } } -- cgit v0.12 From 6f271af3157483e82be0a839323490597eac5e04 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 01:31:02 +0000 Subject: Improvement of memory management, removal of zombie windows from Tk-Cocoa; thanks to Marc Culler for patch --- macosx/tkMacOSXKeyEvent.c | 17 +++++++++++------ macosx/tkMacOSXMenu.c | 9 +++++++++ macosx/tkMacOSXWm.c | 13 +++++++++++++ 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 09cdf94..7e7e8e4 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -27,7 +27,9 @@ static Tk_Window grabWinPtr = NULL; /* Current grab window, NULL if no grab. */ static Tk_Window keyboardGrabWinPtr = NULL; /* Current keyboard grab window. */ -static NSModalSession modalSession = NULL; +static NSWindow *keyboardGrabNSWindow = nil; + /* NSWindow for the current keyboard grab window. */ +static NSModalSession modalSession = nil; static BOOL processingCompose = NO; static BOOL finishedCompose = NO; @@ -476,7 +478,9 @@ XGrabKeyboard( if (modalSession) { Tcl_Panic("XGrabKeyboard: already grabbed"); } - modalSession = [NSApp beginModalSessionForWindow:[w retain]]; + keyboardGrabNSWindow = w; + [w retain]; + modalSession = [NSApp beginModalSessionForWindow:w]; } } return GrabSuccess; @@ -504,11 +508,12 @@ XUngrabKeyboard( Time time) { if (modalSession) { - NSWindow *w = keyboardGrabWinPtr ? TkMacOSXDrawableWindow( - ((TkWindow *) keyboardGrabWinPtr)->window) : nil; [NSApp endModalSession:modalSession]; - [w release]; - modalSession = NULL; + modalSession = nil; + } + if (keyboardGrabNSWindow) { + [keyboardGrabNSWindow release]; + keyboardGrabNSWindow = nil; } keyboardGrabWinPtr = NULL; } diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 5ae38f8..49d1872 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -261,6 +261,7 @@ static int ModifierCharWidth(Tk_Font tkfont); /*Add time for errors to fire if necessary. This is sub-optimal but avoids issues with Tcl/Cocoa event loop integration.*/ Tcl_Sleep(100); + NSAutoreleasePool *pool = [NSAutoreleasePool new]; Tcl_Preserve(interp); Tcl_Preserve(menuPtr); @@ -273,6 +274,7 @@ static int ModifierCharWidth(Tk_Font tkfont); } Tcl_Release(menuPtr); Tcl_Release(interp); + [pool drain]; } } } @@ -382,6 +384,13 @@ static int ModifierCharWidth(Tk_Font tkfont); [pool drain]; } +- (void) safeSetMainMenu: (NSMenu *) menu +{ + NSAutoreleasePool* pool = [NSAutoreleasePool new]; + [self setMainMenu: menu]; + [pool drain]; +} + - (void) menuBeginTracking: (NSNotification *) notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 8459bdd..5cec236 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -24,6 +24,8 @@ #define DEBUG_ZOMBIES 0 +#define DEBUG_ZOMBIES 0 + /* #ifdef TK_MAC_DEBUG #define TK_MAC_DEBUG_WINDOWS @@ -351,6 +353,17 @@ static void RemapWindows(TkWindow *winPtr, #endif return [super retain]; } + +- (id) retain +{ +#if DEBUG_ZOMBIES + const char *title = [[self title] UTF8String]; + if (title != NULL) { + printf("Retaining %s with count %lu\n", title, [self retainCount]); + } +#endif + return [super retain]; +} @end @implementation TKWindow -- cgit v0.12 From 94df74b09e190a9ec583d0e90eaac44f8afc5fd5 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 01:39:31 +0000 Subject: Add copyright notice for Marc Culler --- macosx/tkMacOSXKeyEvent.c | 1 + macosx/tkMacOSXNotify.c | 1 + 2 files changed, 2 insertions(+) diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 7e7e8e4..8e278f7 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -7,6 +7,7 @@ * Copyright 2001-2009, Apple Inc. * Copyright (c) 2006-2009 Daniel A. Steffen * Copyright (c) 2012 Adrian Robert. + * Copyright 2015 Marc Culler. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 905ada5..b5f330f 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -7,6 +7,7 @@ * Copyright (c) 1995-1997 Sun Microsystems, Inc. * Copyright 2001-2009, Apple Inc. * Copyright (c) 2005-2009 Daniel A. Steffen + * Copyright 2015 Marc Culler. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. -- cgit v0.12 From 089db0f16e46cf86e81c5357122632031b942b09 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 01:39:39 +0000 Subject: Add copyright notice for Marc Culler --- macosx/tkMacOSXKeyEvent.c | 1 + macosx/tkMacOSXNotify.c | 1 + 2 files changed, 2 insertions(+) diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 7e7e8e4..8e278f7 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -7,6 +7,7 @@ * Copyright 2001-2009, Apple Inc. * Copyright (c) 2006-2009 Daniel A. Steffen * Copyright (c) 2012 Adrian Robert. + * Copyright 2015 Marc Culler. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 6a4e6c1..cc1ba06 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -7,6 +7,7 @@ * Copyright (c) 1995-1997 Sun Microsystems, Inc. * Copyright 2001-2009, Apple Inc. * Copyright (c) 2005-2009 Daniel A. Steffen + * Copyright 2015 Marc Culler. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. -- cgit v0.12 From dd308b3850e1bff0ee3fecbb87bdf6f386337e41 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 02:34:54 +0000 Subject: Remove duplicate call to safeSetMainMenu --- macosx/tkMacOSXMenu.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 49d1872..c3121cb 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -384,13 +384,6 @@ static int ModifierCharWidth(Tk_Font tkfont); [pool drain]; } -- (void) safeSetMainMenu: (NSMenu *) menu -{ - NSAutoreleasePool* pool = [NSAutoreleasePool new]; - [self setMainMenu: menu]; - [pool drain]; -} - - (void) menuBeginTracking: (NSNotification *) notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS -- cgit v0.12 From 78fdb8a758d9a6a2fd31d8bb222186e26dc338cc Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 03:21:25 +0000 Subject: Final cleanup of zombie windows in Cocoa --- macosx/tkMacOSXEvent.c | 9 +++------ macosx/tkMacOSXWm.c | 2 ++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c index 365dc9b..db13249 100644 --- a/macosx/tkMacOSXEvent.c +++ b/macosx/tkMacOSXEvent.c @@ -133,13 +133,10 @@ TkMacOSXFlushWindows(void) */ NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSArray *macWindows = [NSApp orderedWindows]; - NSInteger windowCount = [macWindows count]; - if(windowCount) { - for (NSWindow *w in macWindows) { - if (TkMacOSXGetXWindow(w)) { - [w flushWindow]; - } + for (NSWindow *w in macWindows) { + if (TkMacOSXGetXWindow(w)) { + [w flushWindow]; } } [pool drain]; diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 8866118..417f130 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -790,6 +790,7 @@ TkWmDeadWindow( NSWindow *window = wmPtr->window; if (window && !Tk_IsEmbedded(winPtr) ) { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSWindow *parent = [window parentWindow]; if (parent) { [parent removeChildWindow:window]; @@ -809,6 +810,7 @@ TkWmDeadWindow( [front makeKeyAndOrderFront:NSApp]; } } + [pool drain]; } ckfree(wmPtr); winPtr->wmInfoPtr = NULL; -- cgit v0.12 From 560374fe1a29641deeddc868587a06358a2ec249 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 03:22:06 +0000 Subject: Final cleanup of zombie windows in Cocoa --- macosx/tkMacOSXWm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 5cec236..82de883 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -807,6 +807,7 @@ TkWmDeadWindow( NSWindow *window = wmPtr->window; if (window && !Tk_IsEmbedded(winPtr) ) { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSWindow *parent = [window parentWindow]; if (parent) { [parent removeChildWindow:window]; @@ -826,6 +827,7 @@ TkWmDeadWindow( [front makeKeyAndOrderFront:NSApp]; } } + [pool drain]; } ckfree(wmPtr); winPtr->wmInfoPtr = NULL; -- cgit v0.12 From 0695305f6b338ad297fb2d027860a860495f8392 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 04:12:05 +0000 Subject: Additional copyright notices --- macosx/Tk-Info.plist.in | 4 ++++ macosx/Wish-Info.plist.in | 12 ++++++++---- macosx/tkMacOSXDialog.c | 3 +++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/macosx/Tk-Info.plist.in b/macosx/Tk-Info.plist.in index 50b9d24..7b0c305 100644 --- a/macosx/Tk-Info.plist.in +++ b/macosx/Tk-Info.plist.in @@ -17,6 +17,10 @@ Tk @TK_WINDOWINGSYSTEM@ @TK_VERSION@@TK_PATCH_LEVEL@, Copyright © 1989-@TK_YEAR@ Tcl Core Team, Copyright © 2002-@TK_YEAR@ Daniel A. Steffen, + Copyright © 1989-@TK_YEAR@ Contributors, + Copyright © 2011-@TK_YEAR@ Kevin Walzer/WordTech + Communications LLC, + Copyright © 2014-@TK_YEAR@ Marc Culler, Copyright © 2001-2009 Apple Inc., Copyright © 2001-2002 Jim Ingham & Ian Reid CFBundleIdentifier diff --git a/macosx/Wish-Info.plist.in b/macosx/Wish-Info.plist.in index 78170f1..db75cf2 100644 --- a/macosx/Wish-Info.plist.in +++ b/macosx/Wish-Info.plist.in @@ -40,10 +40,14 @@ Wish CFBundleGetInfoString Wish Shell @TK_VERSION@@TK_PATCH_LEVEL@, -Copyright © 1989-@TK_YEAR@ Tcl Core Team, -Copyright © 2002-@TK_YEAR@ Daniel A. Steffen, -Copyright © 2001-2009 Apple Inc., -Copyright © 2001-2002 Jim Ingham & Ian Reid + Copyright © 1989-@TK_YEAR@ Tcl Core Team, + Copyright © 1989-@TK_YEAR@ Contributors, + Copyright © 2011-@TK_YEAR@ Kevin Walzer/WordTech + Communications LLC, + Copyright © 2014-@TK_YEAR@ Marc Culler, + Copyright © 2002-@TK_YEAR@ Daniel A. Steffen, + Copyright © 2001-2009 Apple Inc., + Copyright © 2001-2002 Jim Ingham & Ian Reid CFBundleIconFile Wish.icns CFBundleIdentifier diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index a66939a..4b19260 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -857,6 +857,9 @@ TkAboutDlg(void) [[[NSAttributedString alloc] initWithString: [NSString stringWithFormat: @"%1$C 1987-%2$@ Tcl Core Team." "\n\n" + "%1$C 1989-%2$@ Contributors." "\n\n" + "%1$C 2011-%2$@ Kevin Walzer/WordTech Communications LLC." "\n\n" + "%1$C 2014-%2$@ Marc Culler." "\n\n" "%1$C 2002-%2$@ Daniel A. Steffen." "\n\n" "%1$C 2001-2009 Apple Inc." "\n\n" "%1$C 2001-2002 Jim Ingham & Ian Reid" "\n\n" -- cgit v0.12 From 331bd99b1e9cb2e4af8e528b829a94080aae89e8 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 04:12:25 +0000 Subject: Additional copyright notices --- macosx/Tk-Info.plist.in | 3 +++ macosx/Wish-Info.plist.in | 3 +++ macosx/tkMacOSXDialog.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/macosx/Tk-Info.plist.in b/macosx/Tk-Info.plist.in index 50b9d24..93dec7d 100644 --- a/macosx/Tk-Info.plist.in +++ b/macosx/Tk-Info.plist.in @@ -17,6 +17,9 @@ Tk @TK_WINDOWINGSYSTEM@ @TK_VERSION@@TK_PATCH_LEVEL@, Copyright © 1989-@TK_YEAR@ Tcl Core Team, Copyright © 2002-@TK_YEAR@ Daniel A. Steffen, + Copyright © 1989-@TK_YEAR@ Contributors, + Copyright © 2011-@TK_YEAR@ Kevin Walzer/WordTech + Communications LLC, Copyright © 2001-2009 Apple Inc., Copyright © 2001-2002 Jim Ingham & Ian Reid CFBundleIdentifier diff --git a/macosx/Wish-Info.plist.in b/macosx/Wish-Info.plist.in index 78170f1..dd79d75 100644 --- a/macosx/Wish-Info.plist.in +++ b/macosx/Wish-Info.plist.in @@ -42,6 +42,9 @@ Wish Shell @TK_VERSION@@TK_PATCH_LEVEL@, Copyright © 1989-@TK_YEAR@ Tcl Core Team, Copyright © 2002-@TK_YEAR@ Daniel A. Steffen, + Copyright © 1989-@TK_YEAR@ Contributors, + Copyright © 2011-@TK_YEAR@ Kevin Walzer/WordTech + Communications LLC, Copyright © 2001-2009 Apple Inc., Copyright © 2001-2002 Jim Ingham & Ian Reid CFBundleIconFile diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 1a1d467..b5ff48b 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -842,6 +842,9 @@ TkAboutDlg(void) [[[NSAttributedString alloc] initWithString: [NSString stringWithFormat: @"%1$C 1987-%2$@ Tcl Core Team." "\n\n" + "%1$C 1989-%2$@ Contributors." "\n\n" + "%1$C 2011-%2$@ Kevin Walzer/WordTech Communications LLC." "\n\n" + "%1$C 2014-%2$@ Marc Culler." "\n\n" "%1$C 2002-%2$@ Daniel A. Steffen." "\n\n" "%1$C 2001-2009 Apple Inc." "\n\n" "%1$C 2001-2002 Jim Ingham & Ian Reid" "\n\n" -- cgit v0.12 From 97be0552093b567949f1e78bfc9024dc24fba4e7 Mon Sep 17 00:00:00 2001 From: dgp Date: Sat, 21 Mar 2015 17:17:46 +0000 Subject: Fixed failed compile. --- macosx/tkMacOSXWm.c | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 82de883..37a1d25 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -342,28 +342,6 @@ static void RemapWindows(TkWindow *winPtr, { id _i1, _i2; } - -- (id) retain -{ -#if DEBUG_ZOMBIES - const char *title = [[self title] UTF8String]; - if (title != NULL) { - printf("Retaining %s with count %lu\n", title, [self retainCount]); - } -#endif - return [super retain]; -} - -- (id) retain -{ -#if DEBUG_ZOMBIES - const char *title = [[self title] UTF8String]; - if (title != NULL) { - printf("Retaining %s with count %lu\n", title, [self retainCount]); - } -#endif - return [super retain]; -} @end @implementation TKWindow @@ -379,6 +357,16 @@ static void RemapWindows(TkWindow *winPtr, kWindowNoActivatesAttribute)) ? NO : YES; } +- (id) retain +{ +#if DEBUG_ZOMBIES + const char *title = [[self title] UTF8String]; + if (title != NULL) { + printf("Retaining %s with count %lu\n", title, [self retainCount]); + } +#endif + return [super retain]; +} @end #pragma mark - @@ -6012,7 +6000,7 @@ TkWmStackorderToplevel( NSInteger windowCount = [macWindows count]; if (!windowCount) { - ckfree(windows); + ckfree((char *)windows); windows = NULL; } else { windowPtr = windows + table.numEntries; -- cgit v0.12 From 9cbdc93d269480ad1aefb7becb392797ce3b76a3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 22 Mar 2015 15:10:27 +0000 Subject: Suggested fix for [2a70627a03]: shobjidl.h include in tkWinDialog.c breaks mingw cross compile --- win/tkWinDialog.c | 1 - 1 file changed, 1 deletion(-) diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index c137111..dc385e3 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -18,7 +18,6 @@ #include /* includes the common dialog error codes */ #include /* includes SHBrowseForFolder */ -#include #ifdef _MSC_VER # pragma comment (lib, "shell32.lib") -- cgit v0.12 From e376bb72e8ff45dbe2d1754b98b28b4dfa1015c1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 23 Mar 2015 10:44:09 +0000 Subject: Remove some unnecessary end-of-line spacing --- macosx/tkMacOSXKeyEvent.c | 2 +- macosx/tkMacOSXNotify.c | 8 ++++---- win/makefile.bc | 10 +++++----- win/rc/tk_base.rc | 12 ++++++------ win/rc/wish.rc | 2 +- win/tkConfig.sh.in | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 8e278f7..df9dd8a 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -7,7 +7,7 @@ * Copyright 2001-2009, Apple Inc. * Copyright (c) 2006-2009 Daniel A. Steffen * Copyright (c) 2012 Adrian Robert. - * Copyright 2015 Marc Culler. + * Copyright 2015 Marc Culler. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index b5f330f..8b9745d 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -7,7 +7,7 @@ * Copyright (c) 1995-1997 Sun Microsystems, Inc. * Copyright 2001-2009, Apple Inc. * Copyright (c) 2005-2009 Daniel A. Steffen - * Copyright 2015 Marc Culler. + * Copyright 2015 Marc Culler. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -196,7 +196,7 @@ TkMacOSXNotifyExitHandler( * TkMacOSXEventsSetupProc -- * * This procedure implements the setup part of the MacOSX event - * source. It is invoked by Tcl_DoOneEvent before calling + * source. It is invoked by Tcl_DoOneEvent before calling * TkMacOSXEventsProc to process all queued NSEvents. In our * case, all we need to do is to set the Tcl MaxBlockTime to * 0 before starting the loop to process all queued NSEvents. @@ -205,7 +205,7 @@ TkMacOSXNotifyExitHandler( * None. * * Side effects: - * + * * If NSEvents are queued, then the maximum block time will be set * to 0 to ensure that control returns immediately to Tcl. * @@ -221,7 +221,7 @@ TkMacOSXEventsSetupProc( ![[NSRunLoop currentRunLoop] currentMode]) { static const Tcl_Time zeroBlockTime = { 0, 0 }; - /* Call this with dequeue=NO -- just checking if the queue is empty. */ + /* Call this with dequeue=NO -- just checking if the queue is empty. */ NSEvent *currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:GetRunLoopMode(TkMacOSXGetModalSession()) diff --git a/win/makefile.bc b/win/makefile.bc index 934599c..a1b1032 100644 --- a/win/makefile.bc +++ b/win/makefile.bc @@ -3,7 +3,7 @@ # for Visual C++ that came with tk 8.3.3 # # Some "not so obvious" details in this makefile are preceded by a comment -# "maintenance hint", which tries to explain what's going on. Better to +# "maintenance hint", which tries to explain what's going on. Better to # leave those in place. # Helmut Giese, July 2002 # @@ -303,10 +303,10 @@ plugin: setup $(TKPLUGINDLL) $(WISHP) tktest: setup $(TKTEST) $(CAT32) # Maintenance hint: We want to set environment variables before calling tktest. -# If we do this in the form of normal commands, they will not persist up to +# If we do this in the form of normal commands, they will not persist up to # the call of tktest. Therfore we put all commands wanted into a batch file. # The normal way of using 'echo >x.bat' and 'echo >>x.bat' does not work here -# because we cannot write '... > tktest.txt' this way. Hence this advanced +# because we cannot write '... > tktest.txt' this way. Hence this advanced # form of loop hopping: # - Have MAKE produce a temporary file with the content we want. # - Use it as input to the COPY command to produce a batch file. @@ -314,7 +314,7 @@ tktest: setup $(TKTEST) $(CAT32) # test: setup $(TKTEST) $(TKLIB) $(CAT32) copy &&! - set TCL_LIBRARY=$(TCLDIR)/library + set TCL_LIBRARY=$(TCLDIR)/library set PATH=$(TCLDIR)\win\$(TMPDIRNAME);$(PATH) $(TKTEST) $(ROOT)/tests/all.tcl > tktest.txt ! _test.bat @@ -367,7 +367,7 @@ install-libraries: $(TKLIB): $(TKDLL) $(TKSTUBLIB) -# Maintenance hint: The macro puts a '+-' before the first member of +# Maintenance hint: The macro puts a '+-' before the first member of # TKSTUBOBJS, than replaces any ' ' with ' +-' - together putting '+-' in # front of any member of TKSTUBOBJS (provided, they are separated in their # defintion by just one space). diff --git a/win/rc/tk_base.rc b/win/rc/tk_base.rc index 3e065c9..e6ab016 100644 --- a/win/rc/tk_base.rc +++ b/win/rc/tk_base.rc @@ -26,12 +26,12 @@ FONT 8, "Helv" BEGIN LTEXT "Directory &name:",-1,8,6,118,9 EDITTEXT edt10,8,26,144,12, WS_TABSTOP | ES_AUTOHSCROLL - LISTBOX lst2,8,40,144,64,LBS_SORT | LBS_OWNERDRAWFIXED | - LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | + LISTBOX lst2,8,40,144,64,LBS_SORT | LBS_OWNERDRAWFIXED | + LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP LTEXT "Dri&ves:",stc4,8,106,92,9 - COMBOBOX cmb2,8,115,144,68,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | + COMBOBOX cmb2,8,115,144,68,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP DEFPUSHBUTTON "OK",1,160,6,50,14,WS_GROUP PUSHBUTTON "Cancel",2,160,24,50,14,WS_GROUP @@ -42,8 +42,8 @@ BEGIN LTEXT "a",stc3,9,143,114,15 EDITTEXT edt1,7,158,135,20,NOT WS_TABSTOP LISTBOX lst1,8,205,134,42,LBS_NOINTEGRALHEIGHT - COMBOBOX cmb1,8,253,135,21,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | + COMBOBOX cmb1,8,253,135,21,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL END diff --git a/win/rc/wish.rc b/win/rc/wish.rc index 5cc2fa4..53e02fa 100644 --- a/win/rc/wish.rc +++ b/win/rc/wish.rc @@ -63,7 +63,7 @@ END // // Icon -// +// // The icon whose name or resource ID is lexigraphically first, is used // as the application's icon. // diff --git a/win/tkConfig.sh.in b/win/tkConfig.sh.in index 7816b15..c511312 100644 --- a/win/tkConfig.sh.in +++ b/win/tkConfig.sh.in @@ -1,5 +1,5 @@ # tkConfig.sh -- -# +# # This shell script (for sh) is generated automatically by Tk's # configure script. It will create shell variables for most of # the configuration options discovered by the configure script. -- cgit v0.12 From e450f5762837d46e9c72791b8af7361838364291 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 24 Mar 2015 19:13:10 +0000 Subject: Purge configuration efforts at supporting platforms lacking . --- compat/limits.h | 22 ------- unix/Makefile.in | 2 +- unix/configure | 165 ++--------------------------------------------------- unix/configure.in | 6 -- unix/tcl.m4 | 4 -- unix/tkConfig.h.in | 6 -- unix/tkUnixPort.h | 6 +- 7 files changed, 7 insertions(+), 204 deletions(-) delete mode 100644 compat/limits.h diff --git a/compat/limits.h b/compat/limits.h deleted file mode 100644 index 2cb082b..0000000 --- a/compat/limits.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * limits.h -- - * - * This is a dummy header file to #include in Tcl when there - * is no limits.h in /usr/include. There are only a few - * definitions here; also see tclPort.h, which already - * #defines some of the things here if they're not arleady - * defined. - * - * Copyright (c) 1991 The Regents of the University of California. - * Copyright (c) 1994 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - */ - -#define LONG_MIN 0x80000000 -#define LONG_MAX 0x7fffffff -#define INT_MIN 0x80000000 -#define INT_MAX 0x7fffffff -#define SHRT_MIN 0x8000 -#define SHRT_MAX 0x7fff diff --git a/unix/Makefile.in b/unix/Makefile.in index f21fdbb..0736055 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1608,7 +1608,7 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(M $(DISTDIR)/macosx/Tk.xcodeproj mkdir $(DISTDIR)/compat cp -p $(TOP_DIR)/license.terms $(TCLDIR)/compat/unistd.h \ - $(TCLDIR)/compat/stdlib.h $(TCLDIR)/compat/limits.h \ + $(TCLDIR)/compat/stdlib.h \ $(DISTDIR)/compat mkdir $(DISTDIR)/xlib cp -p $(XLIB_DIR)/*.[ch] $(DISTDIR)/xlib diff --git a/unix/configure b/unix/configure index 21a053e..c10a247 100755 --- a/unix/configure +++ b/unix/configure @@ -2692,8 +2692,11 @@ _ACEOF esac -# limits header checks must come early to prevent -# an autoconf bug that throws errors on configure +#-------------------------------------------------------------------- +# Supply a substitute for stdlib.h if it doesn't define strtol, +# strtoul, or strtod (which it doesn't in some versions of SunOS). +#-------------------------------------------------------------------- + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3182,164 +3185,6 @@ fi done -if test "${ac_cv_header_limits_h+set}" = set; then - echo "$as_me:$LINENO: checking for limits.h" >&5 -echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 -if test "${ac_cv_header_limits_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 -echo "${ECHO_T}$ac_cv_header_limits_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking limits.h usability" >&5 -echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#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_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking limits.h presence" >&5 -echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ----------------------------- ## -## Report this to the tk lists. ## -## ----------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for limits.h" >&5 -echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 -if test "${ac_cv_header_limits_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_limits_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 -echo "${ECHO_T}$ac_cv_header_limits_h" >&6 - -fi -if test $ac_cv_header_limits_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIMITS_H 1 -_ACEOF - -else - -cat >>confdefs.h <<\_ACEOF -#define NO_LIMITS_H 1 -_ACEOF - -fi - - - -#-------------------------------------------------------------------- -# Supply a substitute for stdlib.h if it doesn't define strtol, -# strtoul, or strtod (which it doesn't in some versions of SunOS). -#-------------------------------------------------------------------- - if test "${ac_cv_header_stdlib_h+set}" = set; then echo "$as_me:$LINENO: checking for stdlib.h" >&5 echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 diff --git a/unix/configure.in b/unix/configure.in index 26aadfd..5a18d46 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -81,12 +81,6 @@ fi AC_PROG_CC AC_C_INLINE -# limits header checks must come early to prevent -# an autoconf bug that throws errors on configure -AC_CHECK_HEADER(limits.h, - [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])], - [AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])]) - #-------------------------------------------------------------------- # Supply a substitute for stdlib.h if it doesn't define strtol, # strtoul, or strtod (which it doesn't in some versions of SunOS). diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 30b3bc1..1a56932 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -2158,7 +2158,6 @@ dnl # preprocessing tests use only CPPFLAGS. # Defines some of the following vars: # NO_DIRENT_H # NO_VALUES_H -# HAVE_LIMITS_H or NO_LIMITS_H # NO_STDLIB_H # NO_STRING_H # NO_SYS_WAIT_H @@ -2198,9 +2197,6 @@ closedir(d); AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have ?])]) AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(limits.h, - [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])], - [AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])]) AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) diff --git a/unix/tkConfig.h.in b/unix/tkConfig.h.in index 1e5593c..4fd7726 100644 --- a/unix/tkConfig.h.in +++ b/unix/tkConfig.h.in @@ -25,9 +25,6 @@ /* Define to 1 if you have the `Xft' library (-lXft). */ #undef HAVE_LIBXFT -/* Do we have ? */ -#undef HAVE_LIMITS_H - /* Define to 1 if you have the `lseek64' function. */ #undef HAVE_LSEEK64 @@ -115,9 +112,6 @@ /* Do we have fd_set? */ #undef NO_FD_SET -/* Do we have ? */ -#undef NO_LIMITS_H - /* Do we have ? */ #undef NO_STDLIB_H diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h index 9051c63..dbd5e09 100644 --- a/unix/tkUnixPort.h +++ b/unix/tkUnixPort.h @@ -20,11 +20,7 @@ #include #include #include -#ifndef NO_LIMITS_H -# include -#else -# include "../compat/limits.h" -#endif +#include #include #include #ifdef NO_STDLIB_H -- cgit v0.12 From ccdac05dbacc3b62fc27a65c11c8bd1188daddf4 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Tue, 7 Apr 2015 01:12:45 +0000 Subject: Further cleanup of scrolling, drawing, resize in Cocoa; thanks to Marc Culler for patches --- generic/tkCanvas.c | 13 +++++++ generic/tkInt.decls | 3 ++ generic/tkIntPlatDecls.h | 5 ++- generic/tkTextDisp.c | 30 +++++++-------- macosx/tkMacOSXButton.c | 21 ++++++----- macosx/tkMacOSXDraw.c | 86 ++++++++++++++++++++++++++++++++---------- macosx/tkMacOSXInt.h | 2 +- macosx/tkMacOSXScrlbr.c | 59 ++++++++++++++++------------- macosx/tkMacOSXSubwindows.c | 59 +++++++++++++++++++++++++++++ macosx/tkMacOSXWindowEvent.c | 90 ++++++++++++++++++++++++-------------------- 10 files changed, 253 insertions(+), 115 deletions(-) diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 8e14852..9c4d60a 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -2447,6 +2447,19 @@ DisplayCanvas( goto done; } +#ifdef MAC_OSX_TK + /* + * If drawing is disabled, all we need to do is + * clear the REDRAW_PENDING flag. + */ + TkWindow *winPtr = (TkWindow *)(canvasPtr->tkwin); + MacDrawable *macWin = winPtr->privatePtr; + if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){ + canvasPtr->flags &= ~REDRAW_PENDING; + return; + } +#endif + /* * Choose a new current item if that is needed (this could cause event * handlers to be invoked). diff --git a/generic/tkInt.decls b/generic/tkInt.decls index ebbadba..8924d68 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -1017,6 +1017,9 @@ declare 50 aqua { declare 51 aqua { void TkGenWMDestroyEvent(Tk_Window tkwin) } +declare 52 aqua { + TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); +} # removed duplicate from tkPlat table (tk.decls) #declare 52 aqua { diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 3a2a8aa..3a4bdac 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -250,7 +250,8 @@ EXTERN int TkGenerateButtonEvent(int x, int y, Window window, unsigned int state); /* 51 */ EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); -/* Slot 52 is reserved */ +/* 52 */ +EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); /* 53 */ EXTERN unsigned long TkpGetMS(void); /* 54 */ @@ -395,7 +396,7 @@ typedef struct TkIntPlatStubs { Window (*tkGetTransientMaster) (TkWindow *winPtr); /* 49 */ int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */ void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */ - void (*reserved52)(void); + void (*tkMacOSXSetDrawingEnabled) (TkWindow *winPtr, int flag); /* 52 */ unsigned long (*tkpGetMS) (void); /* 53 */ void * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 55 */ diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 95ea935..c3bcd5e 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -3948,7 +3948,6 @@ DisplayText( * warnings. */ Tcl_Interp *interp; - if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { /* * The widget has been deleted. Don't do anything. @@ -3957,6 +3956,19 @@ DisplayText( return; } +#ifdef MAC_OSX_TK + /* + * If drawing is disabled, all we need to do is + * clear the REDRAW_PENDING flag. + */ + TkWindow *winPtr = (TkWindow *)(textPtr->tkwin); + MacDrawable *macWin = winPtr->privatePtr; + if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){ + dInfoPtr->flags &= ~REDRAW_PENDING; + return; + } +#endif + interp = textPtr->interp; Tcl_Preserve(interp); @@ -3964,14 +3976,6 @@ DisplayText( Tcl_SetVar2(interp, "tk_textRelayout", NULL, "", TCL_GLOBAL_ONLY); } - if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { - /* - * The widget has been deleted. Don't do anything. - */ - - goto end; - } - if (!Tk_IsMapped(textPtr->tkwin) || (dInfoPtr->maxX <= dInfoPtr->x) || (dInfoPtr->maxY <= dInfoPtr->y)) { UpdateDisplayInfo(textPtr); @@ -3983,14 +3987,6 @@ DisplayText( Tcl_SetVar2(interp, "tk_textRedraw", NULL, "", TCL_GLOBAL_ONLY); } - if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { - /* - * The widget has been deleted. Don't do anything. - */ - - goto end; - } - /* * Choose a new current item if that is needed (this could cause event * handlers to be invoked, hence the preserve/release calls and the loop, diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index 725c211..59d394e 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -30,10 +30,10 @@ * Default insets for controls */ -#define DEF_INSET_LEFT 2 -#define DEF_INSET_RIGHT 2 -#define DEF_INSET_TOP 2 -#define DEF_INSET_BOTTOM 4 +#define DEF_INSET_LEFT 12 +#define DEF_INSET_RIGHT 12 +#define DEF_INSET_TOP 1 +#define DEF_INSET_BOTTOM 1 /* * Some defines used to control what type of control is drawn. @@ -318,8 +318,8 @@ TkpComputeButtonGeometry( Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength, butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight); - txtWidth = butPtr->textWidth; - txtHeight = butPtr->textHeight; + txtWidth = butPtr->textWidth + DEF_INSET_LEFT + DEF_INSET_RIGHT; + txtHeight = butPtr->textHeight + DEF_INSET_BOTTOM + DEF_INSET_TOP; charWidth = Tk_TextWidth(butPtr->tkfont, "0", 1); Tk_GetFontMetrics(butPtr->tkfont, &fm); haveText = (txtWidth != 0 && txtHeight != 0); @@ -647,7 +647,7 @@ DrawButtonImageAndText( butPtr->textHeight, &x, &y); x += butPtr->indicatorSpace; Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout, - x, y, 0, -1); + x, y - DEF_INSET_BOTTOM, 0, -1); } /* @@ -807,9 +807,12 @@ TkMacOSXDrawButton( hiinfo.animation.time.start = hiinfo.animation.time.current; } - HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal, &contHIRec); + HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal, + &contHIRec); + TkMacOSXRestoreDrawingContext(&dc); - ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, (MacButton *)mbPtr, 32, true); + ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, + (MacButton *)mbPtr, 32, true); } else { if (!TkMacOSXSetupDrawingContext(pixmap, dpPtr->gc, 1, &dc)) { diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 328f905..0f6d2f0 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -222,7 +222,8 @@ XCopyArea( } if (!TkMacOSXSetupDrawingContext(dst, gc, 1, &dc)) { - TkMacOSXDbgMsg("Failed to setup drawing context."); + return; + /*TkMacOSXDbgMsg("Failed to setup drawing context.");*/ } if ( dc.context ) { @@ -243,6 +244,8 @@ XCopyArea( CGRectMake(src_x, src_y, width, height), CGRectMake(dest_x, dest_y, width, height)); CFRelease(img); + + } else { TkMacOSXDbgMsg("Failed to construct CGImage."); } @@ -652,9 +655,9 @@ GetCGContextForDrawable( CGColorSpaceRef colorspace = NULL; CGBitmapInfo bitmapInfo = #ifdef __LITTLE_ENDIAN__ - kCGBitmapByteOrder32Host; + kCGBitmapByteOrder32Host; #else - kCGBitmapByteOrderDefault; + kCGBitmapByteOrderDefault; #endif char *data; CGRect bounds = CGRectMake(0, 0, macDraw->size.width, @@ -731,6 +734,7 @@ DrawCGImage( } } dstBounds = CGRectOffset(dstBounds, macDraw->xOff, macDraw->yOff); + if (CGImageIsMask(image)) { /*CGContextSaveGState(context);*/ if (macDraw->flags & TK_IS_BW_PIXMAP) { @@ -765,8 +769,8 @@ DrawCGImage( dstBounds.size.width, dstBounds.size.height); #else /* TK_MAC_DEBUG_IMAGE_DRAWING */ CGContextSaveGState(context); - CGContextTranslateCTM(context, - 0, dstBounds.origin.y + CGRectGetMaxY(dstBounds)); + CGContextTranslateCTM(context, 0, + dstBounds.origin.y + CGRectGetMaxY(dstBounds)); CGContextScaleCTM(context, 1, -1); CGContextDrawImage(context, dstBounds, image); CGContextRestoreGState(context); @@ -1478,10 +1482,9 @@ TkScrollWindow( MacDrawable *macDraw = (MacDrawable *) drawable; NSView *view = TkMacOSXDrawableView(macDraw); CGRect srcRect, dstRect; - HIShapeRef dmgRgn = NULL, extraRgn; + HIShapeRef dmgRgn = NULL, extraRgn = NULL; NSRect bounds, visRect, scrollSrc, scrollDst; - int result; - + int result = 0; if ( view ) { /* Get the scroll area in NSView coordinates (origin at bottom left). */ @@ -1491,36 +1494,79 @@ TkScrollWindow( bounds.size.height - height - (macDraw->yOff + y), width, height); scrollDst = NSOffsetRect(scrollSrc, dx, -dy); + /* Limit scrolling to the window content area. */ visRect = [view visibleRect]; scrollSrc = NSIntersectionRect(scrollSrc, visRect); scrollDst = NSIntersectionRect(scrollDst, visRect); - if ( !NSIsEmptyRect(scrollSrc) && !NSIsEmptyRect(scrollDst) ) { /* * Mark the difference between source and destination as damaged. - * This region is described in the Tk coordinate system. + * This region is described in NSView coordinates (y=0 at the bottom) + * and converted to Tk coordinates later. */ - srcRect = CGRectMake(x, y, width, height); - dstRect = CGRectOffset(srcRect, dx, dy); + srcRect = CGRectMake(x, y, width, height); + dstRect = CGRectOffset(srcRect, dx, dy); + + /* Expand the rectangles slightly to avoid degeneracies. */ + srcRect.origin.y -= 1; + srcRect.size.height += 2; + dstRect.origin.y += 1; + dstRect.size.height -= 2; + + /* Compute the damage. */ dmgRgn = HIShapeCreateMutableWithRect(&srcRect); extraRgn = HIShapeCreateWithRect(&dstRect); ChkErr(HIShapeDifference, dmgRgn, extraRgn, (HIMutableShapeRef) dmgRgn); - CFRelease(extraRgn); + result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; + + /* Convert to Tk coordinates. */ + TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); + if (extraRgn) { + CFRelease(extraRgn); + } /* Scroll the rectangle. */ [view scrollRect:scrollSrc by:NSMakeSize(dx, -dy)]; + + /* Shift the Tk children which meet the source rectangle. */ + TkWindow *winPtr = (TkWindow *)tkwin; + TkWindow *childPtr; + CGRect childBounds; + for (childPtr = winPtr->childList; childPtr != NULL; childPtr = childPtr->nextPtr) { + if (Tk_IsMapped(childPtr) && !Tk_IsTopLevel(childPtr)) { + TkMacOSXWinCGBounds(childPtr, &childBounds); + if (CGRectIntersectsRect(srcRect, childBounds)) { + MacDrawable *macChild = childPtr->privatePtr; + if (macChild) { + macChild->yOff += dy; + macChild->xOff += dx; + childPtr->changes.y = macChild->yOff; + childPtr->changes.x = macChild->xOff; + } + } + } + } + + /* Queue up Expose events for the damage region. */ + int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE); + [view generateExposeEvents:dmgRgn childrenOnly:1]; + Tcl_SetServiceMode(oldMode); + + /* Belt and suspenders: make the AppKit request a redraw + when it gets control again. */ + [view setNeedsDisplay:YES]; } + } else { + dmgRgn = HIShapeCreateEmpty(); + TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); } - if ( dmgRgn == NULL ) { - dmgRgn = HIShapeCreateEmpty(); + if (dmgRgn) { + CFRelease(dmgRgn); } - TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); - result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; - CFRelease(dmgRgn); return result; } @@ -1855,6 +1901,7 @@ TkpClipDrawableToRect( CFRelease(macDraw->drawRgn); macDraw->drawRgn = NULL; } + if (width >= 0 && height >= 0) { CGRect clipRect = CGRectMake(x + macDraw->xOff, y + macDraw->yOff, width, height); @@ -2002,7 +2049,7 @@ TkpDrawHighlightBorder ( * TkpDrawFrame -- * * This procedure draws the rectangular frame area. If the user - * has request themeing, it draws with a the background theme. + * has requested themeing, it draws with the background theme. * * Results: * None. @@ -2032,6 +2079,7 @@ TkpDrawFrame( border = themedBorder; } } + Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, highlightWidth, highlightWidth, Tk_Width(tkwin) - 2 * highlightWidth, diff --git a/macosx/tkMacOSXInt.h b/macosx/tkMacOSXInt.h index 249d5cf..6971e26 100644 --- a/macosx/tkMacOSXInt.h +++ b/macosx/tkMacOSXInt.h @@ -86,7 +86,7 @@ typedef struct TkWindowPrivate MacDrawable; #define TK_FOCUSED_VIEW 0x10 #define TK_IS_PIXMAP 0x20 #define TK_IS_BW_PIXMAP 0x40 - +#define TK_DO_NOT_DRAW 0x80 /* * I am reserving TK_EMBEDDED = 0x100 in the MacDrawable flags * This is defined in tk.h. We need to duplicate the TK_EMBEDDED flag in the diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index bdb76af..4d4949f 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -26,6 +26,7 @@ #define RangeToFactor(maximum) (((double) (LONG_MAX >> 1)) / (maximum)) #endif /* __LP64__ */ +#define MOUNTAIN_LION_STYLE (NSAppKitVersionNumber < 1138) /* * Declaration of Mac specific scrollbar structure. @@ -80,7 +81,6 @@ static void ScrollbarEventProc(ClientData clientData, XEvent *eventPtr); static int ScrollbarPress(TkScrollbar *scrollPtr, XEvent *eventPtr); static void UpdateControlValues(TkScrollbar *scrollPtr); - /* *---------------------------------------------------------------------- * @@ -137,7 +137,6 @@ TkpDisplayScrollbar( register TkScrollbar *scrollPtr = (TkScrollbar *) clientData; register Tk_Window tkwin = scrollPtr->tkwin; - if ((scrollPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } @@ -150,7 +149,6 @@ TkpDisplayScrollbar( CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1, .tx = 0, .ty = viewHeight}; - scrollPtr->flags &= ~REDRAW_PENDING; if (!scrollPtr->tkwin || !Tk_IsMapped(tkwin) || !view || !TkMacOSXSetupDrawingContext((Drawable) macWin, NULL, 1, &dc)) { @@ -173,7 +171,6 @@ TkpDisplayScrollbar( (Pixmap) macWin); } - Tk_Draw3DRectangle(tkwin, (Pixmap) macWin, scrollPtr->bgBorder, scrollPtr->highlightWidth, scrollPtr->highlightWidth, Tk_Width(tkwin) - 2*scrollPtr->highlightWidth, @@ -186,15 +183,11 @@ TkpDisplayScrollbar( /*Update values and draw in native rect.*/ UpdateControlValues(scrollPtr); -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 - if (scrollPtr->vertical) { - HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); - } else { + if (MOUNTAIN_LION_STYLE) { HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationInverted); + } else { + HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); } -#else - HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); -#endif TkMacOSXRestoreDrawingContext(&dc); scrollPtr->flags &= ~REDRAW_PENDING; @@ -265,11 +258,12 @@ TkpComputeScrollbarGeometry( if (scrollPtr->sliderLast > fieldLength) { scrollPtr->sliderLast = fieldLength; } - scrollPtr->sliderFirst += scrollPtr->inset + + if (!(MOUNTAIN_LION_STYLE)) { + scrollPtr->sliderFirst += scrollPtr->inset + metrics[variant].topArrowHeight; - scrollPtr->sliderLast += scrollPtr->inset + + scrollPtr->sliderLast += scrollPtr->inset + metrics[variant].bottomArrowHeight; - + } /* * Register the desired geometry for the window (leave enough space * for the two arrows plus a minimum-size slider, plus border around @@ -370,21 +364,29 @@ TkpScrollbarPosition( int x, int y) /* Coordinates within scrollPtr's window. */ { - /*Using code from tkUnixScrlbr.c because Unix scroll bindings are driving the display at the script level. All the Mac scrollbar has to do is re-draw itself.*/ + /* + * Using code from tkUnixScrlbr.c because Unix scroll bindings are + * driving the display at the script level. All the Mac scrollbar + * has to do is re-draw itself. + */ - int length, width, tmp; + int length, fieldlength, width, tmp; register const int inset = scrollPtr->inset; + register const int arrowSize = scrollPtr->arrowLength + inset; if (scrollPtr->vertical) { length = Tk_Height(scrollPtr->tkwin); + fieldlength = length - 2 * arrowSize; width = Tk_Width(scrollPtr->tkwin); } else { tmp = x; x = y; y = tmp; length = Tk_Width(scrollPtr->tkwin); + fieldlength = length - 2 * arrowSize; width = Tk_Height(scrollPtr->tkwin); } + fieldlength = fieldlength < 0 ? 0 : fieldlength; if (x=width-inset || y=length-inset) { return OUTSIDE; @@ -395,19 +397,19 @@ TkpScrollbarPosition( * TkpDisplayScrollbar. Be sure to keep the two consistent. */ - if (y < inset + scrollPtr->arrowLength) { - return TOP_ARROW; - } if (y < scrollPtr->sliderFirst) { return TOP_GAP; } if (y < scrollPtr->sliderLast) { return SLIDER; } - if (y >= length - (scrollPtr->arrowLength + inset)) { - return BOTTOM_ARROW; + if (y < fieldlength){ + return BOTTOM_GAP; + } + if (y < fieldlength + arrowSize) { + return TOP_ARROW; } - return BOTTOM_GAP; + return BOTTOM_ARROW; } /* @@ -415,9 +417,11 @@ TkpScrollbarPosition( * * UpdateControlValues -- * - * This procedure updates the Macintosh scrollbar control to display the - * values defined by the Tk scrollbar. This is the key interface to the Mac-native * scrollbar; the Unix bindings drive scrolling in the Tk window and all the Mac - * scrollbar has to do is redraw itself. + * This procedure updates the Macintosh scrollbar control to + * display the values defined by the Tk scrollbar. This is the + * key interface to the Mac-native * scrollbar; the Unix bindings + * drive scrolling in the Tk window and all the Mac scrollbar has + * to do is redraw itself. * * Results: * None. @@ -432,7 +436,6 @@ static void UpdateControlValues( TkScrollbar *scrollPtr) /* Scrollbar data struct. */ { - Tk_Window tkwin = scrollPtr->tkwin; MacDrawable *macWin = (MacDrawable *) Tk_WindowId(scrollPtr->tkwin); double dViewSize; @@ -484,7 +487,11 @@ UpdateControlValues( factor - dViewSize; info.trackInfo.scrollbar.viewsize = dViewSize; if (scrollPtr->vertical) { + if (MOUNTAIN_LION_STYLE) { + info.value = factor * scrollPtr->firstFraction; + } else { info.value = info.max - factor * scrollPtr->firstFraction; + } } else { info.value = MIN_SCROLLBAR_VALUE + factor * scrollPtr->firstFraction; } diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 869f717..2a88422 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -657,6 +657,65 @@ XConfigureWindow( /* *---------------------------------------------------------------------- * + * TkMacOSXSetDrawingEnabled -- + * + * This function sets the TK_DO_NOT_DRAW flag for a given window and + * all of its children. + * + * Results: + * None. + * + * Side effects: + * The clipping regions for the window and its children are cleared. + * + *---------------------------------------------------------------------- + */ + +void +TkMacOSXSetDrawingEnabled( + TkWindow *winPtr, + int flag) +{ + TkWindow *childPtr; + MacDrawable *macWin = winPtr->privatePtr; + + if (macWin) { + if (flag ) { + macWin->flags &= ~TK_DO_NOT_DRAW; + } else { + macWin->flags |= TK_DO_NOT_DRAW; + } + } + + /* + * Set the flag for all children & their descendants, excluding + * Toplevels. (??? Do we need to exclude Toplevels?) + */ + + childPtr = winPtr->childList; + while (childPtr) { + if (!Tk_IsTopLevel(childPtr)) { + TkMacOSXSetDrawingEnabled(childPtr, flag); + } + childPtr = childPtr->nextPtr; + } + + /* + * If the window is a container, set the flag for its embedded window. + */ + + if (Tk_IsContainer(winPtr)) { + childPtr = TkpGetOtherWindow(winPtr); + + if (childPtr) { + TkMacOSXSetDrawingEnabled(childPtr, flag); + } + } +} + +/* + *---------------------------------------------------------------------- + * * TkMacOSXUpdateClipRgn -- * * This function updates the clipping regions for a given window and all of diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 2e7c041..35f9f1c 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -29,7 +29,7 @@ * Declaration of functions used only in this file */ -static int GenerateUpdates(HIMutableShapeRef updateRgn, +static int GenerateUpdates(HIShapeRef updateRgn, CGRect *updateBounds, TkWindow *winPtr); static int GenerateActivateEvents(TkWindow *winPtr, int activeFlag); @@ -315,7 +315,7 @@ extern BOOL opaqueTag; static int GenerateUpdates( - HIMutableShapeRef updateRgn, + HIShapeRef updateRgn, CGRect *updateBounds, TkWindow *winPtr) { @@ -782,7 +782,8 @@ Tk_MacOSXIsAppInFront(void) @interface TKContentView(TKWindowEvent) - (void) drawRect: (NSRect) rect; -- (void) generateExposeEvents: (HIMutableShapeRef) shape; +- (void) generateExposeEvents: (HIShapeRef) shape; +- (void) generateExposeEvents: (HIShapeRef) shape childrenOnly: (int) childrenOnly; - (void) viewDidEndLiveResize; - (void) tkToolbarButton: (id) sender; - (BOOL) isOpaque; @@ -792,6 +793,8 @@ Tk_MacOSXIsAppInFront(void) @end @implementation TKContentView +NSDate *_resizeStart; +NSTimeInterval _resizeDuration; @end /*Restrict event processing to Expose events.*/ @@ -829,7 +832,7 @@ ExposeRestrictProc( HIShapeUnionWithRect(drawShape, &r); } if (CFRunLoopGetMain() == CFRunLoopGetCurrent()) { - [self generateExposeEvents:drawShape]; + [self generateExposeEvents:(HIShapeRef)drawShape]; } else { [self performSelectorOnMainThread:@selector(generateExposeEvents:) withObject:(id)drawShape waitUntilDone:NO @@ -844,25 +847,33 @@ ExposeRestrictProc( -(void) setFrameSize: (NSSize)newsize { if ( [self inLiveResize] ) { - NSWindow *window = [self window]; - TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); + NSWindow *w = [self window]; + TkWindow *winPtr = TkMacOSXGetTkWindow(w); Tk_Window tkwin = (Tk_Window) winPtr; unsigned int width = (unsigned int)newsize.width; unsigned int height=(unsigned int)newsize.height; - /* Resize the Tk Window to the requested size.*/ - TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height, - TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY); - - /* Then resize the NSView to the actual window size*/ - newsize.width = (CGFloat)Tk_Width(tkwin); - newsize.height = (CGFloat)Tk_Height(tkwin); + /* Resize the NSView */ [super setFrameSize: newsize]; - /* Process all pending events to update the window. */ - while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {} - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} + /* Disable drawing until the window has been completely configured.*/ + TkMacOSXSetDrawingEnabled(winPtr, 0); + /* Generate and handle a ConfigureNotify event for the new size.*/ + TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height, + TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY); + while ( Tk_DoOneEvent(TK_X_EVENTS|TK_DONT_WAIT) ) {} + + /* Now that Tk has configured all subwindows we can create the clip regions. */ + TkMacOSXSetDrawingEnabled(winPtr, 1); + TkMacOSXInvalClipRgns(tkwin); + TkMacOSXUpdateClipRgn(winPtr); + + /* Finally, generate and process expose events to redraw the window. */ + HIRect bounds = NSRectToCGRect([self bounds]); + HIShapeRef shape = HIShapeCreateWithRect(&bounds); + [self generateExposeEvents: shape]; + while ( Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT) ) {} } else { [super setFrameSize: newsize]; } @@ -881,46 +892,44 @@ ExposeRestrictProc( [self generateExposeEvents: shape]; } -/*Core function of this class, generates expose events for redrawing.*/ -- (void) generateExposeEvents: (HIMutableShapeRef) shape +/* Core method of this class: generates expose events for redrawing. + * Whereas drawRect is intended to be called only from the Appkit event + * loop, this can be called from Tk. If the Tcl_ServiceMode is set to + * TCL_SERVICE_ALL then the expose events will be immediately removed + * from the Tcl event loop and processed. Typically, they should be queued, + * however. + */ +- (void) generateExposeEvents: (HIShapeRef) shape +{ + [self generateExposeEvents:shape childrenOnly:0]; +} + +- (void) generateExposeEvents: (HIShapeRef) shape + childrenOnly: (int) childrenOnly { TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); unsigned long serial; CGRect updateBounds; + int updatesNeeded; if (!winPtr) { return; } + /* Generate Tk Expose events. */ HIShapeGetBounds(shape, &updateBounds); + /* All of these events will share the same serial number. */ serial = LastKnownRequestProcessed(Tk_Display(winPtr)); - if (GenerateUpdates(shape, &updateBounds, winPtr) && - ![[NSRunLoop currentRunLoop] currentMode] && - Tcl_GetServiceMode() != TCL_SERVICE_NONE) { - /* - * Ensure there are no pending idle-time redraws that could - * prevent the just posted Expose events from generating - * new redraws. - */ - - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} - - /* - * For smoother drawing, process Expose events and resulting - * redraws immediately instead of at idle time. - */ - - ClientData oldArg; + updatesNeeded = GenerateUpdates(shape, &updateBounds, winPtr); + + /* Process the Expose events if the service mode is TCL_SERVICE_ALL */ + if (updatesNeeded && Tcl_GetServiceMode() == TCL_SERVICE_ALL) { + ClientData oldArg; Tk_RestrictProc *oldProc = Tk_RestrictEvents(ExposeRestrictProc, UINT2PTR(serial), &oldArg); - while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {} - Tk_RestrictEvents(oldProc, oldArg, &oldArg); - - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} } - } /* @@ -936,7 +945,6 @@ ExposeRestrictProc( int x, y; TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); Tk_Window tkwin = (Tk_Window) winPtr; - bzero(&event, sizeof(XVirtualEvent)); event.type = VirtualEvent; event.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); -- cgit v0.12 From 991544634825a18479f15f47dbc0f00a5b368505 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Tue, 7 Apr 2015 01:12:53 +0000 Subject: Further cleanup of scrolling, drawing, resize in Cocoa; thanks to Marc Culler for patches --- generic/tkCanvas.c | 13 ++++++ generic/tkInt.decls | 3 ++ generic/tkIntPlatDecls.h | 6 ++- generic/tkTextDisp.c | 29 ++++++-------- macosx/tkMacOSXButton.c | 21 +++++----- macosx/tkMacOSXDraw.c | 95 +++++++++++++++++++++++++++++++++----------- macosx/tkMacOSXInt.h | 2 +- macosx/tkMacOSXScrlbr.c | 59 +++++++++++++++------------ macosx/tkMacOSXSubwindows.c | 59 +++++++++++++++++++++++++++ macosx/tkMacOSXWindowEvent.c | 90 +++++++++++++++++++++-------------------- 10 files changed, 260 insertions(+), 117 deletions(-) diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 14fe1ab..8ebe9ba 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -2101,6 +2101,19 @@ DisplayCanvas( goto done; } +#ifdef MAC_OSX_TK + /* + * If drawing is disabled, all we need to do is + * clear the REDRAW_PENDING flag. + */ + TkWindow *winPtr = (TkWindow *)(canvasPtr->tkwin); + MacDrawable *macWin = winPtr->privatePtr; + if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){ + canvasPtr->flags &= ~REDRAW_PENDING; + return; + } +#endif + /* * Choose a new current item if that is needed (this could cause event * handlers to be invoked). diff --git a/generic/tkInt.decls b/generic/tkInt.decls index ab56bed..7921852 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -956,6 +956,9 @@ declare 50 aqua { declare 51 aqua { void TkGenWMDestroyEvent(Tk_Window tkwin) } +declare 52 aqua { + TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); +} # removed duplicate from tkPlat table (tk.decls) #declare 52 aqua { diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index b377173..7654b5d 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -520,7 +520,11 @@ EXTERN int TkGenerateButtonEvent(int x, int y, Window window, /* 51 */ EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); #endif -/* Slot 52 is reserved */ +#ifndef TkMacOSXSetDrawingEnabled_TCL_DECLARED +#define TkMacOSXSetDrawingEnabled_TCL_DECLARED +/* 52 */ +EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); +#endif #ifndef TkpGetMS_TCL_DECLARED #define TkpGetMS_TCL_DECLARED /* 53 */ diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index bcbb03a..5f69690 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -3954,6 +3954,19 @@ DisplayText( return; } +#ifdef MAC_OSX_TK + /* + * If drawing is disabled, all we need to do is + * clear the REDRAW_PENDING flag. + */ + TkWindow *winPtr = (TkWindow *)(textPtr->tkwin); + MacDrawable *macWin = winPtr->privatePtr; + if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){ + dInfoPtr->flags &= ~REDRAW_PENDING; + return; + } +#endif + interp = textPtr->interp; Tcl_Preserve((ClientData) interp); @@ -3961,14 +3974,6 @@ DisplayText( Tcl_SetVar2(interp, "tk_textRelayout", NULL, "", TCL_GLOBAL_ONLY); } - if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { - /* - * The widget has been deleted. Don't do anything. - */ - - goto end; - } - if (!Tk_IsMapped(textPtr->tkwin) || (dInfoPtr->maxX <= dInfoPtr->x) || (dInfoPtr->maxY <= dInfoPtr->y)) { UpdateDisplayInfo(textPtr); @@ -3980,14 +3985,6 @@ DisplayText( Tcl_SetVar2(interp, "tk_textRedraw", NULL, "", TCL_GLOBAL_ONLY); } - if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { - /* - * The widget has been deleted. Don't do anything. - */ - - goto end; - } - /* * Choose a new current item if that is needed (this could cause event * handlers to be invoked, hence the preserve/release calls and the loop, diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index 0821933..0323081 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -30,10 +30,10 @@ * Default insets for controls */ -#define DEF_INSET_LEFT 2 -#define DEF_INSET_RIGHT 2 -#define DEF_INSET_TOP 2 -#define DEF_INSET_BOTTOM 4 +#define DEF_INSET_LEFT 12 +#define DEF_INSET_RIGHT 12 +#define DEF_INSET_TOP 1 +#define DEF_INSET_BOTTOM 1 /* * Some defines used to control what type of control is drawn. @@ -318,8 +318,8 @@ TkpComputeButtonGeometry( Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength, butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight); - txtWidth = butPtr->textWidth; - txtHeight = butPtr->textHeight; + txtWidth = butPtr->textWidth + DEF_INSET_LEFT + DEF_INSET_RIGHT; + txtHeight = butPtr->textHeight + DEF_INSET_BOTTOM + DEF_INSET_TOP; charWidth = Tk_TextWidth(butPtr->tkfont, "0", 1); Tk_GetFontMetrics(butPtr->tkfont, &fm); haveText = (txtWidth != 0 && txtHeight != 0); @@ -647,7 +647,7 @@ DrawButtonImageAndText( butPtr->textHeight, &x, &y); x += butPtr->indicatorSpace; Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout, - x, y, 0, -1); + x, y - DEF_INSET_BOTTOM, 0, -1); } /* @@ -807,9 +807,12 @@ TkMacOSXDrawButton( hiinfo.animation.time.start = hiinfo.animation.time.current; } - HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal, &contHIRec); + HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal, + &contHIRec); + TkMacOSXRestoreDrawingContext(&dc); - ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, (MacButton *)mbPtr, 32, true); + ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, + (MacButton *)mbPtr, 32, true); } else { if (!TkMacOSXSetupDrawingContext(pixmap, dpPtr->gc, 1, &dc)) { diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index c1ffdf8..3f51d00 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -222,7 +222,8 @@ XCopyArea( } if (!TkMacOSXSetupDrawingContext(dst, gc, 1, &dc)) { - TkMacOSXDbgMsg("Failed to setup drawing context."); + return; + /*TkMacOSXDbgMsg("Failed to setup drawing context.");*/ } if ( dc.context ) { @@ -243,6 +244,8 @@ XCopyArea( CGRectMake(src_x, src_y, width, height), CGRectMake(dest_x, dest_y, width, height)); CFRelease(img); + + } else { TkMacOSXDbgMsg("Failed to construct CGImage."); } @@ -652,9 +655,9 @@ GetCGContextForDrawable( CGColorSpaceRef colorspace = NULL; CGBitmapInfo bitmapInfo = #ifdef __LITTLE_ENDIAN__ - kCGBitmapByteOrder32Host; + kCGBitmapByteOrder32Host; #else - kCGBitmapByteOrderDefault; + kCGBitmapByteOrderDefault; #endif char *data; CGRect bounds = CGRectMake(0, 0, macDraw->size.width, @@ -731,6 +734,7 @@ DrawCGImage( } } dstBounds = CGRectOffset(dstBounds, macDraw->xOff, macDraw->yOff); + if (CGImageIsMask(image)) { /*CGContextSaveGState(context);*/ if (macDraw->flags & TK_IS_BW_PIXMAP) { @@ -1474,51 +1478,94 @@ TkScrollWindow( TkRegion damageRgn) /* Region to accumulate damage in. */ { Drawable drawable = Tk_WindowId(tkwin); - MacDrawable *macDraw = (MacDrawable *) drawable; + MacDrawable *macDraw = (MacDrawable *) drawable; NSView *view = TkMacOSXDrawableView(macDraw); CGRect srcRect, dstRect; - HIShapeRef dmgRgn = NULL, extraRgn; + HIShapeRef dmgRgn = NULL, extraRgn = NULL; NSRect bounds, visRect, scrollSrc, scrollDst; - int result; - + int result = 0; + if ( view ) { /* Get the scroll area in NSView coordinates (origin at bottom left). */ bounds = [view bounds]; scrollSrc = NSMakeRect( - macDraw->xOff + x, + macDraw->xOff + x, bounds.size.height - height - (macDraw->yOff + y), width, height); scrollDst = NSOffsetRect(scrollSrc, dx, -dy); + /* Limit scrolling to the window content area. */ visRect = [view visibleRect]; scrollSrc = NSIntersectionRect(scrollSrc, visRect); scrollDst = NSIntersectionRect(scrollDst, visRect); - if ( !NSIsEmptyRect(scrollSrc) && !NSIsEmptyRect(scrollDst) ) { - + /* * Mark the difference between source and destination as damaged. - * This region is described in the Tk coordinate system. + * This region is described in NSView coordinates (y=0 at the bottom) + * and converted to Tk coordinates later. */ - - srcRect = CGRectMake(x, y, width, height); - dstRect = CGRectOffset(srcRect, dx, dy); + + srcRect = CGRectMake(x, y, width, height); + dstRect = CGRectOffset(srcRect, dx, dy); + + /* Expand the rectangles slightly to avoid degeneracies. */ + srcRect.origin.y -= 1; + srcRect.size.height += 2; + dstRect.origin.y += 1; + dstRect.size.height -= 2; + + /* Compute the damage. */ dmgRgn = HIShapeCreateMutableWithRect(&srcRect); extraRgn = HIShapeCreateWithRect(&dstRect); ChkErr(HIShapeDifference, dmgRgn, extraRgn, (HIMutableShapeRef) dmgRgn); - CFRelease(extraRgn); - + result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; + + /* Convert to Tk coordinates. */ + TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); + if (extraRgn) { + CFRelease(extraRgn); + } + /* Scroll the rectangle. */ [view scrollRect:scrollSrc by:NSMakeSize(dx, -dy)]; + + /* Shift the Tk children which meet the source rectangle. */ + TkWindow *winPtr = (TkWindow *)tkwin; + TkWindow *childPtr; + CGRect childBounds; + for (childPtr = winPtr->childList; childPtr != NULL; childPtr = childPtr->nextPtr) { + if (Tk_IsMapped(childPtr) && !Tk_IsTopLevel(childPtr)) { + TkMacOSXWinCGBounds(childPtr, &childBounds); + if (CGRectIntersectsRect(srcRect, childBounds)) { + MacDrawable *macChild = childPtr->privatePtr; + if (macChild) { + macChild->yOff += dy; + macChild->xOff += dx; + childPtr->changes.y = macChild->yOff; + childPtr->changes.x = macChild->xOff; + } + } + } + } + + /* Queue up Expose events for the damage region. */ + int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE); + [view generateExposeEvents:dmgRgn childrenOnly:1]; + Tcl_SetServiceMode(oldMode); + + /* Belt and suspenders: make the AppKit request a redraw + when it gets control again. */ + [view setNeedsDisplay:YES]; } + } else { + dmgRgn = HIShapeCreateEmpty(); + TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); } - - if ( dmgRgn == NULL ) { - dmgRgn = HIShapeCreateEmpty(); + + if (dmgRgn) { + CFRelease(dmgRgn); } - TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); - result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; - CFRelease(dmgRgn); return result; } @@ -1853,6 +1900,7 @@ TkpClipDrawableToRect( CFRelease(macDraw->drawRgn); macDraw->drawRgn = NULL; } + if (width >= 0 && height >= 0) { CGRect clipRect = CGRectMake(x + macDraw->xOff, y + macDraw->yOff, width, height); @@ -2000,7 +2048,7 @@ TkpDrawHighlightBorder ( * TkpDrawFrame -- * * This procedure draws the rectangular frame area. If the user - * has request themeing, it draws with a the background theme. + * has requested themeing, it draws with the background theme. * * Results: * None. @@ -2030,6 +2078,7 @@ TkpDrawFrame( border = themedBorder; } } + Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, highlightWidth, highlightWidth, Tk_Width(tkwin) - 2 * highlightWidth, diff --git a/macosx/tkMacOSXInt.h b/macosx/tkMacOSXInt.h index 249d5cf..6971e26 100644 --- a/macosx/tkMacOSXInt.h +++ b/macosx/tkMacOSXInt.h @@ -86,7 +86,7 @@ typedef struct TkWindowPrivate MacDrawable; #define TK_FOCUSED_VIEW 0x10 #define TK_IS_PIXMAP 0x20 #define TK_IS_BW_PIXMAP 0x40 - +#define TK_DO_NOT_DRAW 0x80 /* * I am reserving TK_EMBEDDED = 0x100 in the MacDrawable flags * This is defined in tk.h. We need to duplicate the TK_EMBEDDED flag in the diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index bc93b79..afa0df8 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -26,6 +26,7 @@ #define RangeToFactor(maximum) (((double) (LONG_MAX >> 1)) / (maximum)) #endif /* __LP64__ */ +#define MOUNTAIN_LION_STYLE (NSAppKitVersionNumber < 1138) /* * Declaration of Mac specific scrollbar structure. @@ -80,7 +81,6 @@ static void ScrollbarEventProc(ClientData clientData, XEvent *eventPtr); static int ScrollbarPress(TkScrollbar *scrollPtr, XEvent *eventPtr); static void UpdateControlValues(TkScrollbar *scrollPtr); - /* *---------------------------------------------------------------------- * @@ -137,7 +137,6 @@ TkpDisplayScrollbar( register TkScrollbar *scrollPtr = (TkScrollbar *) clientData; register Tk_Window tkwin = scrollPtr->tkwin; - if ((scrollPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } @@ -173,7 +172,6 @@ TkpDisplayScrollbar( (Pixmap) macWin); } - Tk_Draw3DRectangle(tkwin, (Pixmap) macWin, scrollPtr->bgBorder, scrollPtr->highlightWidth, scrollPtr->highlightWidth, Tk_Width(tkwin) - 2*scrollPtr->highlightWidth, @@ -186,15 +184,11 @@ TkpDisplayScrollbar( /*Update values and draw in native rect.*/ UpdateControlValues(scrollPtr); -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 - if (scrollPtr->vertical) { - HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); - } else { + if (MOUNTAIN_LION_STYLE) { HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationInverted); + } else { + HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); } -#else - HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); -#endif TkMacOSXRestoreDrawingContext(&dc); scrollPtr->flags &= ~REDRAW_PENDING; @@ -265,11 +259,12 @@ TkpComputeScrollbarGeometry( if (scrollPtr->sliderLast > fieldLength) { scrollPtr->sliderLast = fieldLength; } - scrollPtr->sliderFirst += scrollPtr->inset + + if (!(MOUNTAIN_LION_STYLE)) { + scrollPtr->sliderFirst += scrollPtr->inset + metrics[variant].topArrowHeight; - scrollPtr->sliderLast += scrollPtr->inset + + scrollPtr->sliderLast += scrollPtr->inset + metrics[variant].bottomArrowHeight; - + } /* * Register the desired geometry for the window (leave enough space * for the two arrows plus a minimum-size slider, plus border around @@ -370,21 +365,29 @@ TkpScrollbarPosition( int x, int y) /* Coordinates within scrollPtr's window. */ { - /*Using code from tkUnixScrlbr.c because Unix scroll bindings are driving the display at the script level. All the Mac scrollbar has to do is re-draw itself.*/ - - int length, width, tmp; + /* + * Using code from tkUnixScrlbr.c because Unix scroll bindings are + * driving the display at the script level. All the Mac scrollbar + * has to do is re-draw itself. + */ + + int length, fieldlength, width, tmp; register const int inset = scrollPtr->inset; + register const int arrowSize = scrollPtr->arrowLength + inset; if (scrollPtr->vertical) { length = Tk_Height(scrollPtr->tkwin); + fieldlength = length - 2 * arrowSize; width = Tk_Width(scrollPtr->tkwin); } else { tmp = x; x = y; y = tmp; length = Tk_Width(scrollPtr->tkwin); + fieldlength = length - 2 * arrowSize; width = Tk_Height(scrollPtr->tkwin); } + fieldlength = fieldlength < 0 ? 0 : fieldlength; if (x=width-inset || y=length-inset) { return OUTSIDE; @@ -395,19 +398,19 @@ TkpScrollbarPosition( * TkpDisplayScrollbar. Be sure to keep the two consistent. */ - if (y < inset + scrollPtr->arrowLength) { - return TOP_ARROW; - } if (y < scrollPtr->sliderFirst) { return TOP_GAP; } if (y < scrollPtr->sliderLast) { return SLIDER; } - if (y >= length - (scrollPtr->arrowLength + inset)) { - return BOTTOM_ARROW; + if (y < fieldlength){ + return BOTTOM_GAP; + } + if (y < fieldlength + arrowSize) { + return TOP_ARROW; } - return BOTTOM_GAP; + return BOTTOM_ARROW; } /* @@ -415,9 +418,11 @@ TkpScrollbarPosition( * * UpdateControlValues -- * - * This procedure updates the Macintosh scrollbar control to display the - * values defined by the Tk scrollbar. This is the key interface to the Mac-native * scrollbar; the Unix bindings drive scrolling in the Tk window and all the Mac - * scrollbar has to do is redraw itself. + * This procedure updates the Macintosh scrollbar control to + * display the values defined by the Tk scrollbar. This is the + * key interface to the Mac-native * scrollbar; the Unix bindings + * drive scrolling in the Tk window and all the Mac scrollbar has + * to do is redraw itself. * * Results: * None. @@ -484,7 +489,11 @@ UpdateControlValues( factor - dViewSize; info.trackInfo.scrollbar.viewsize = dViewSize; if (scrollPtr->vertical) { + if (MOUNTAIN_LION_STYLE) { + info.value = factor * scrollPtr->firstFraction; + } else { info.value = info.max - factor * scrollPtr->firstFraction; + } } else { info.value = MIN_SCROLLBAR_VALUE + factor * scrollPtr->firstFraction; } diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index a9703c1..2f500fa 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -657,6 +657,65 @@ XConfigureWindow( /* *---------------------------------------------------------------------- * + * TkMacOSXSetDrawingEnabled -- + * + * This function sets the TK_DO_NOT_DRAW flag for a given window and + * all of its children. + * + * Results: + * None. + * + * Side effects: + * The clipping regions for the window and its children are cleared. + * + *---------------------------------------------------------------------- + */ + +void +TkMacOSXSetDrawingEnabled( + TkWindow *winPtr, + int flag) +{ + TkWindow *childPtr; + MacDrawable *macWin = winPtr->privatePtr; + + if (macWin) { + if (flag ) { + macWin->flags &= ~TK_DO_NOT_DRAW; + } else { + macWin->flags |= TK_DO_NOT_DRAW; + } + } + + /* + * Set the flag for all children & their descendants, excluding + * Toplevels. (??? Do we need to exclude Toplevels?) + */ + + childPtr = winPtr->childList; + while (childPtr) { + if (!Tk_IsTopLevel(childPtr)) { + TkMacOSXSetDrawingEnabled(childPtr, flag); + } + childPtr = childPtr->nextPtr; + } + + /* + * If the window is a container, set the flag for its embedded window. + */ + + if (Tk_IsContainer(winPtr)) { + childPtr = TkpGetOtherWindow(winPtr); + + if (childPtr) { + TkMacOSXSetDrawingEnabled(childPtr, flag); + } + } +} + +/* + *---------------------------------------------------------------------- + * * TkMacOSXUpdateClipRgn -- * * This function updates the clipping regions for a given window and all of diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index d68a933..d0999d1 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -29,7 +29,7 @@ * Declaration of functions used only in this file */ -static int GenerateUpdates(HIMutableShapeRef updateRgn, +static int GenerateUpdates(HIShapeRef updateRgn, CGRect *updateBounds, TkWindow *winPtr); static int GenerateActivateEvents(TkWindow *winPtr, int activeFlag); @@ -316,7 +316,7 @@ extern BOOL opaqueTag; static int GenerateUpdates( - HIMutableShapeRef updateRgn, + HIShapeRef updateRgn, CGRect *updateBounds, TkWindow *winPtr) { @@ -784,7 +784,8 @@ Tk_MacOSXIsAppInFront(void) @interface TKContentView(TKWindowEvent) - (void) drawRect: (NSRect) rect; -- (void) generateExposeEvents: (HIMutableShapeRef) shape; +- (void) generateExposeEvents: (HIShapeRef) shape; +- (void) generateExposeEvents: (HIShapeRef) shape childrenOnly: (int) childrenOnly; - (void) viewDidEndLiveResize; - (void) tkToolbarButton: (id) sender; - (BOOL) isOpaque; @@ -794,6 +795,8 @@ Tk_MacOSXIsAppInFront(void) @end @implementation TKContentView +NSDate *_resizeStart; +NSTimeInterval _resizeDuration; @end /*Restrict event processing to Expose events.*/ @@ -832,7 +835,7 @@ ExposeRestrictProc( HIShapeUnionWithRect(drawShape, &r); } if (CFRunLoopGetMain() == CFRunLoopGetCurrent()) { - [self generateExposeEvents:drawShape]; + [self generateExposeEvents:(HIShapeRef)drawShape]; } else { [self performSelectorOnMainThread:@selector(generateExposeEvents:) withObject:(id)drawShape waitUntilDone:NO @@ -848,25 +851,33 @@ ExposeRestrictProc( -(void) setFrameSize: (NSSize)newsize { if ( [self inLiveResize] ) { - NSWindow *window = [self window]; - TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); + NSWindow *w = [self window]; + TkWindow *winPtr = TkMacOSXGetTkWindow(w); Tk_Window tkwin = (Tk_Window) winPtr; unsigned int width = (unsigned int)newsize.width; unsigned int height=(unsigned int)newsize.height; - /* Resize the Tk Window to the requested size.*/ - TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height, - TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY); - - /* Then resize the NSView to the actual window size*/ - newsize.width = (CGFloat)Tk_Width(tkwin); - newsize.height = (CGFloat)Tk_Height(tkwin); + /* Resize the NSView */ [super setFrameSize: newsize]; - /* Process all pending events to update the window. */ - while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {} - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} + /* Disable drawing until the window has been completely configured.*/ + TkMacOSXSetDrawingEnabled(winPtr, 0); + /* Generate and handle a ConfigureNotify event for the new size.*/ + TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height, + TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY); + while ( Tk_DoOneEvent(TK_X_EVENTS|TK_DONT_WAIT) ) {} + + /* Now that Tk has configured all subwindows we can create the clip regions. */ + TkMacOSXSetDrawingEnabled(winPtr, 1); + TkMacOSXInvalClipRgns(tkwin); + TkMacOSXUpdateClipRgn(winPtr); + + /* Finally, generate and process expose events to redraw the window. */ + HIRect bounds = NSRectToCGRect([self bounds]); + HIShapeRef shape = HIShapeCreateWithRect(&bounds); + [self generateExposeEvents: shape]; + while ( Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT) ) {} } else { [super setFrameSize: newsize]; } @@ -886,48 +897,44 @@ ExposeRestrictProc( } - -/*Core function of this class, generates expose events for redrawing.*/ -- (void) generateExposeEvents: (HIMutableShapeRef) shape +/* Core method of this class: generates expose events for redrawing. + * Whereas drawRect is intended to be called only from the Appkit event + * loop, this can be called from Tk. If the Tcl_ServiceMode is set to + * TCL_SERVICE_ALL then the expose events will be immediately removed + * from the Tcl event loop and processed. Typically, they should be queued, + * however. + */ +- (void) generateExposeEvents: (HIShapeRef) shape { + [self generateExposeEvents:shape childrenOnly:0]; +} +- (void) generateExposeEvents: (HIShapeRef) shape + childrenOnly: (int) childrenOnly +{ TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); unsigned long serial; CGRect updateBounds; + int updatesNeeded; if (!winPtr) { return; } + /* Generate Tk Expose events. */ HIShapeGetBounds(shape, &updateBounds); + /* All of these events will share the same serial number. */ serial = LastKnownRequestProcessed(Tk_Display(winPtr)); - if (GenerateUpdates(shape, &updateBounds, winPtr) && - ![[NSRunLoop currentRunLoop] currentMode] && - Tcl_GetServiceMode() != TCL_SERVICE_NONE) { - /* - * Ensure there are no pending idle-time redraws that could - * prevent the just posted Expose events from generating - * new redraws. - */ - - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} - - /* - * For smoother drawing, process Expose events and resulting - * redraws immediately instead of at idle time. - */ - - ClientData oldArg; + updatesNeeded = GenerateUpdates(shape, &updateBounds, winPtr); + + /* Process the Expose events if the service mode is TCL_SERVICE_ALL */ + if (updatesNeeded && Tcl_GetServiceMode() == TCL_SERVICE_ALL) { + ClientData oldArg; Tk_RestrictProc *oldProc = Tk_RestrictEvents(ExposeRestrictProc, UINT2PTR(serial), &oldArg); - while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {} - Tk_RestrictEvents(oldProc, oldArg, &oldArg); - - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} } - } /* @@ -943,7 +950,6 @@ ExposeRestrictProc( int x, y; TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); Tk_Window tkwin = (Tk_Window) winPtr; - bzero(&event, sizeof(XVirtualEvent)); event.type = VirtualEvent; event.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); -- cgit v0.12 From 6540e0be10afe7208f8e370632256cfd262f5706 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Tue, 7 Apr 2015 01:42:59 +0000 Subject: Backing out changes; unexpected issues with window resizing that require further investigation --- generic/tkCanvas.c | 13 ------- generic/tkInt.decls | 3 -- generic/tkIntPlatDecls.h | 5 +-- generic/tkTextDisp.c | 30 ++++++++------- macosx/tkMacOSXButton.c | 21 +++++------ macosx/tkMacOSXDraw.c | 86 ++++++++++-------------------------------- macosx/tkMacOSXInt.h | 2 +- macosx/tkMacOSXScrlbr.c | 59 +++++++++++++---------------- macosx/tkMacOSXSubwindows.c | 59 ----------------------------- macosx/tkMacOSXWindowEvent.c | 90 ++++++++++++++++++++------------------------ 10 files changed, 115 insertions(+), 253 deletions(-) diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 9c4d60a..8e14852 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -2447,19 +2447,6 @@ DisplayCanvas( goto done; } -#ifdef MAC_OSX_TK - /* - * If drawing is disabled, all we need to do is - * clear the REDRAW_PENDING flag. - */ - TkWindow *winPtr = (TkWindow *)(canvasPtr->tkwin); - MacDrawable *macWin = winPtr->privatePtr; - if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){ - canvasPtr->flags &= ~REDRAW_PENDING; - return; - } -#endif - /* * Choose a new current item if that is needed (this could cause event * handlers to be invoked). diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 8924d68..ebbadba 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -1017,9 +1017,6 @@ declare 50 aqua { declare 51 aqua { void TkGenWMDestroyEvent(Tk_Window tkwin) } -declare 52 aqua { - TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); -} # removed duplicate from tkPlat table (tk.decls) #declare 52 aqua { diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 3a4bdac..3a2a8aa 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -250,8 +250,7 @@ EXTERN int TkGenerateButtonEvent(int x, int y, Window window, unsigned int state); /* 51 */ EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); -/* 52 */ -EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); +/* Slot 52 is reserved */ /* 53 */ EXTERN unsigned long TkpGetMS(void); /* 54 */ @@ -396,7 +395,7 @@ typedef struct TkIntPlatStubs { Window (*tkGetTransientMaster) (TkWindow *winPtr); /* 49 */ int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */ void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */ - void (*tkMacOSXSetDrawingEnabled) (TkWindow *winPtr, int flag); /* 52 */ + void (*reserved52)(void); unsigned long (*tkpGetMS) (void); /* 53 */ void * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 55 */ diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index c3bcd5e..95ea935 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -3948,6 +3948,7 @@ DisplayText( * warnings. */ Tcl_Interp *interp; + if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { /* * The widget has been deleted. Don't do anything. @@ -3956,19 +3957,6 @@ DisplayText( return; } -#ifdef MAC_OSX_TK - /* - * If drawing is disabled, all we need to do is - * clear the REDRAW_PENDING flag. - */ - TkWindow *winPtr = (TkWindow *)(textPtr->tkwin); - MacDrawable *macWin = winPtr->privatePtr; - if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){ - dInfoPtr->flags &= ~REDRAW_PENDING; - return; - } -#endif - interp = textPtr->interp; Tcl_Preserve(interp); @@ -3976,6 +3964,14 @@ DisplayText( Tcl_SetVar2(interp, "tk_textRelayout", NULL, "", TCL_GLOBAL_ONLY); } + if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { + /* + * The widget has been deleted. Don't do anything. + */ + + goto end; + } + if (!Tk_IsMapped(textPtr->tkwin) || (dInfoPtr->maxX <= dInfoPtr->x) || (dInfoPtr->maxY <= dInfoPtr->y)) { UpdateDisplayInfo(textPtr); @@ -3987,6 +3983,14 @@ DisplayText( Tcl_SetVar2(interp, "tk_textRedraw", NULL, "", TCL_GLOBAL_ONLY); } + if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { + /* + * The widget has been deleted. Don't do anything. + */ + + goto end; + } + /* * Choose a new current item if that is needed (this could cause event * handlers to be invoked, hence the preserve/release calls and the loop, diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index 59d394e..725c211 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -30,10 +30,10 @@ * Default insets for controls */ -#define DEF_INSET_LEFT 12 -#define DEF_INSET_RIGHT 12 -#define DEF_INSET_TOP 1 -#define DEF_INSET_BOTTOM 1 +#define DEF_INSET_LEFT 2 +#define DEF_INSET_RIGHT 2 +#define DEF_INSET_TOP 2 +#define DEF_INSET_BOTTOM 4 /* * Some defines used to control what type of control is drawn. @@ -318,8 +318,8 @@ TkpComputeButtonGeometry( Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength, butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight); - txtWidth = butPtr->textWidth + DEF_INSET_LEFT + DEF_INSET_RIGHT; - txtHeight = butPtr->textHeight + DEF_INSET_BOTTOM + DEF_INSET_TOP; + txtWidth = butPtr->textWidth; + txtHeight = butPtr->textHeight; charWidth = Tk_TextWidth(butPtr->tkfont, "0", 1); Tk_GetFontMetrics(butPtr->tkfont, &fm); haveText = (txtWidth != 0 && txtHeight != 0); @@ -647,7 +647,7 @@ DrawButtonImageAndText( butPtr->textHeight, &x, &y); x += butPtr->indicatorSpace; Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout, - x, y - DEF_INSET_BOTTOM, 0, -1); + x, y, 0, -1); } /* @@ -807,12 +807,9 @@ TkMacOSXDrawButton( hiinfo.animation.time.start = hiinfo.animation.time.current; } - HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal, - &contHIRec); - + HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal, &contHIRec); TkMacOSXRestoreDrawingContext(&dc); - ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, - (MacButton *)mbPtr, 32, true); + ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, (MacButton *)mbPtr, 32, true); } else { if (!TkMacOSXSetupDrawingContext(pixmap, dpPtr->gc, 1, &dc)) { diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 0f6d2f0..328f905 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -222,8 +222,7 @@ XCopyArea( } if (!TkMacOSXSetupDrawingContext(dst, gc, 1, &dc)) { - return; - /*TkMacOSXDbgMsg("Failed to setup drawing context.");*/ + TkMacOSXDbgMsg("Failed to setup drawing context."); } if ( dc.context ) { @@ -244,8 +243,6 @@ XCopyArea( CGRectMake(src_x, src_y, width, height), CGRectMake(dest_x, dest_y, width, height)); CFRelease(img); - - } else { TkMacOSXDbgMsg("Failed to construct CGImage."); } @@ -655,9 +652,9 @@ GetCGContextForDrawable( CGColorSpaceRef colorspace = NULL; CGBitmapInfo bitmapInfo = #ifdef __LITTLE_ENDIAN__ - kCGBitmapByteOrder32Host; + kCGBitmapByteOrder32Host; #else - kCGBitmapByteOrderDefault; + kCGBitmapByteOrderDefault; #endif char *data; CGRect bounds = CGRectMake(0, 0, macDraw->size.width, @@ -734,7 +731,6 @@ DrawCGImage( } } dstBounds = CGRectOffset(dstBounds, macDraw->xOff, macDraw->yOff); - if (CGImageIsMask(image)) { /*CGContextSaveGState(context);*/ if (macDraw->flags & TK_IS_BW_PIXMAP) { @@ -769,8 +765,8 @@ DrawCGImage( dstBounds.size.width, dstBounds.size.height); #else /* TK_MAC_DEBUG_IMAGE_DRAWING */ CGContextSaveGState(context); - CGContextTranslateCTM(context, 0, - dstBounds.origin.y + CGRectGetMaxY(dstBounds)); + CGContextTranslateCTM(context, + 0, dstBounds.origin.y + CGRectGetMaxY(dstBounds)); CGContextScaleCTM(context, 1, -1); CGContextDrawImage(context, dstBounds, image); CGContextRestoreGState(context); @@ -1482,9 +1478,10 @@ TkScrollWindow( MacDrawable *macDraw = (MacDrawable *) drawable; NSView *view = TkMacOSXDrawableView(macDraw); CGRect srcRect, dstRect; - HIShapeRef dmgRgn = NULL, extraRgn = NULL; + HIShapeRef dmgRgn = NULL, extraRgn; NSRect bounds, visRect, scrollSrc, scrollDst; - int result = 0; + int result; + if ( view ) { /* Get the scroll area in NSView coordinates (origin at bottom left). */ @@ -1494,79 +1491,36 @@ TkScrollWindow( bounds.size.height - height - (macDraw->yOff + y), width, height); scrollDst = NSOffsetRect(scrollSrc, dx, -dy); - /* Limit scrolling to the window content area. */ visRect = [view visibleRect]; scrollSrc = NSIntersectionRect(scrollSrc, visRect); scrollDst = NSIntersectionRect(scrollDst, visRect); + if ( !NSIsEmptyRect(scrollSrc) && !NSIsEmptyRect(scrollDst) ) { /* * Mark the difference between source and destination as damaged. - * This region is described in NSView coordinates (y=0 at the bottom) - * and converted to Tk coordinates later. + * This region is described in the Tk coordinate system. */ - srcRect = CGRectMake(x, y, width, height); - dstRect = CGRectOffset(srcRect, dx, dy); - - /* Expand the rectangles slightly to avoid degeneracies. */ - srcRect.origin.y -= 1; - srcRect.size.height += 2; - dstRect.origin.y += 1; - dstRect.size.height -= 2; - - /* Compute the damage. */ + srcRect = CGRectMake(x, y, width, height); + dstRect = CGRectOffset(srcRect, dx, dy); dmgRgn = HIShapeCreateMutableWithRect(&srcRect); extraRgn = HIShapeCreateWithRect(&dstRect); ChkErr(HIShapeDifference, dmgRgn, extraRgn, (HIMutableShapeRef) dmgRgn); - result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; - - /* Convert to Tk coordinates. */ - TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); - if (extraRgn) { - CFRelease(extraRgn); - } + CFRelease(extraRgn); /* Scroll the rectangle. */ [view scrollRect:scrollSrc by:NSMakeSize(dx, -dy)]; - - /* Shift the Tk children which meet the source rectangle. */ - TkWindow *winPtr = (TkWindow *)tkwin; - TkWindow *childPtr; - CGRect childBounds; - for (childPtr = winPtr->childList; childPtr != NULL; childPtr = childPtr->nextPtr) { - if (Tk_IsMapped(childPtr) && !Tk_IsTopLevel(childPtr)) { - TkMacOSXWinCGBounds(childPtr, &childBounds); - if (CGRectIntersectsRect(srcRect, childBounds)) { - MacDrawable *macChild = childPtr->privatePtr; - if (macChild) { - macChild->yOff += dy; - macChild->xOff += dx; - childPtr->changes.y = macChild->yOff; - childPtr->changes.x = macChild->xOff; - } - } - } - } - - /* Queue up Expose events for the damage region. */ - int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE); - [view generateExposeEvents:dmgRgn childrenOnly:1]; - Tcl_SetServiceMode(oldMode); - - /* Belt and suspenders: make the AppKit request a redraw - when it gets control again. */ - [view setNeedsDisplay:YES]; } - } else { - dmgRgn = HIShapeCreateEmpty(); - TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); } - if (dmgRgn) { - CFRelease(dmgRgn); + if ( dmgRgn == NULL ) { + dmgRgn = HIShapeCreateEmpty(); } + TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); + result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; + CFRelease(dmgRgn); return result; } @@ -1901,7 +1855,6 @@ TkpClipDrawableToRect( CFRelease(macDraw->drawRgn); macDraw->drawRgn = NULL; } - if (width >= 0 && height >= 0) { CGRect clipRect = CGRectMake(x + macDraw->xOff, y + macDraw->yOff, width, height); @@ -2049,7 +2002,7 @@ TkpDrawHighlightBorder ( * TkpDrawFrame -- * * This procedure draws the rectangular frame area. If the user - * has requested themeing, it draws with the background theme. + * has request themeing, it draws with a the background theme. * * Results: * None. @@ -2079,7 +2032,6 @@ TkpDrawFrame( border = themedBorder; } } - Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, highlightWidth, highlightWidth, Tk_Width(tkwin) - 2 * highlightWidth, diff --git a/macosx/tkMacOSXInt.h b/macosx/tkMacOSXInt.h index 6971e26..249d5cf 100644 --- a/macosx/tkMacOSXInt.h +++ b/macosx/tkMacOSXInt.h @@ -86,7 +86,7 @@ typedef struct TkWindowPrivate MacDrawable; #define TK_FOCUSED_VIEW 0x10 #define TK_IS_PIXMAP 0x20 #define TK_IS_BW_PIXMAP 0x40 -#define TK_DO_NOT_DRAW 0x80 + /* * I am reserving TK_EMBEDDED = 0x100 in the MacDrawable flags * This is defined in tk.h. We need to duplicate the TK_EMBEDDED flag in the diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index 4d4949f..bdb76af 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -26,7 +26,6 @@ #define RangeToFactor(maximum) (((double) (LONG_MAX >> 1)) / (maximum)) #endif /* __LP64__ */ -#define MOUNTAIN_LION_STYLE (NSAppKitVersionNumber < 1138) /* * Declaration of Mac specific scrollbar structure. @@ -81,6 +80,7 @@ static void ScrollbarEventProc(ClientData clientData, XEvent *eventPtr); static int ScrollbarPress(TkScrollbar *scrollPtr, XEvent *eventPtr); static void UpdateControlValues(TkScrollbar *scrollPtr); + /* *---------------------------------------------------------------------- * @@ -137,6 +137,7 @@ TkpDisplayScrollbar( register TkScrollbar *scrollPtr = (TkScrollbar *) clientData; register Tk_Window tkwin = scrollPtr->tkwin; + if ((scrollPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } @@ -149,6 +150,7 @@ TkpDisplayScrollbar( CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1, .tx = 0, .ty = viewHeight}; + scrollPtr->flags &= ~REDRAW_PENDING; if (!scrollPtr->tkwin || !Tk_IsMapped(tkwin) || !view || !TkMacOSXSetupDrawingContext((Drawable) macWin, NULL, 1, &dc)) { @@ -171,6 +173,7 @@ TkpDisplayScrollbar( (Pixmap) macWin); } + Tk_Draw3DRectangle(tkwin, (Pixmap) macWin, scrollPtr->bgBorder, scrollPtr->highlightWidth, scrollPtr->highlightWidth, Tk_Width(tkwin) - 2*scrollPtr->highlightWidth, @@ -183,11 +186,15 @@ TkpDisplayScrollbar( /*Update values and draw in native rect.*/ UpdateControlValues(scrollPtr); - if (MOUNTAIN_LION_STYLE) { - HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationInverted); - } else { +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + if (scrollPtr->vertical) { HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); + } else { + HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationInverted); } +#else + HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); +#endif TkMacOSXRestoreDrawingContext(&dc); scrollPtr->flags &= ~REDRAW_PENDING; @@ -258,12 +265,11 @@ TkpComputeScrollbarGeometry( if (scrollPtr->sliderLast > fieldLength) { scrollPtr->sliderLast = fieldLength; } - if (!(MOUNTAIN_LION_STYLE)) { - scrollPtr->sliderFirst += scrollPtr->inset + + scrollPtr->sliderFirst += scrollPtr->inset + metrics[variant].topArrowHeight; - scrollPtr->sliderLast += scrollPtr->inset + + scrollPtr->sliderLast += scrollPtr->inset + metrics[variant].bottomArrowHeight; - } + /* * Register the desired geometry for the window (leave enough space * for the two arrows plus a minimum-size slider, plus border around @@ -364,29 +370,21 @@ TkpScrollbarPosition( int x, int y) /* Coordinates within scrollPtr's window. */ { - /* - * Using code from tkUnixScrlbr.c because Unix scroll bindings are - * driving the display at the script level. All the Mac scrollbar - * has to do is re-draw itself. - */ + /*Using code from tkUnixScrlbr.c because Unix scroll bindings are driving the display at the script level. All the Mac scrollbar has to do is re-draw itself.*/ - int length, fieldlength, width, tmp; + int length, width, tmp; register const int inset = scrollPtr->inset; - register const int arrowSize = scrollPtr->arrowLength + inset; if (scrollPtr->vertical) { length = Tk_Height(scrollPtr->tkwin); - fieldlength = length - 2 * arrowSize; width = Tk_Width(scrollPtr->tkwin); } else { tmp = x; x = y; y = tmp; length = Tk_Width(scrollPtr->tkwin); - fieldlength = length - 2 * arrowSize; width = Tk_Height(scrollPtr->tkwin); } - fieldlength = fieldlength < 0 ? 0 : fieldlength; if (x=width-inset || y=length-inset) { return OUTSIDE; @@ -397,19 +395,19 @@ TkpScrollbarPosition( * TkpDisplayScrollbar. Be sure to keep the two consistent. */ + if (y < inset + scrollPtr->arrowLength) { + return TOP_ARROW; + } if (y < scrollPtr->sliderFirst) { return TOP_GAP; } if (y < scrollPtr->sliderLast) { return SLIDER; } - if (y < fieldlength){ - return BOTTOM_GAP; - } - if (y < fieldlength + arrowSize) { - return TOP_ARROW; + if (y >= length - (scrollPtr->arrowLength + inset)) { + return BOTTOM_ARROW; } - return BOTTOM_ARROW; + return BOTTOM_GAP; } /* @@ -417,11 +415,9 @@ TkpScrollbarPosition( * * UpdateControlValues -- * - * This procedure updates the Macintosh scrollbar control to - * display the values defined by the Tk scrollbar. This is the - * key interface to the Mac-native * scrollbar; the Unix bindings - * drive scrolling in the Tk window and all the Mac scrollbar has - * to do is redraw itself. + * This procedure updates the Macintosh scrollbar control to display the + * values defined by the Tk scrollbar. This is the key interface to the Mac-native * scrollbar; the Unix bindings drive scrolling in the Tk window and all the Mac + * scrollbar has to do is redraw itself. * * Results: * None. @@ -436,6 +432,7 @@ static void UpdateControlValues( TkScrollbar *scrollPtr) /* Scrollbar data struct. */ { + Tk_Window tkwin = scrollPtr->tkwin; MacDrawable *macWin = (MacDrawable *) Tk_WindowId(scrollPtr->tkwin); double dViewSize; @@ -487,11 +484,7 @@ UpdateControlValues( factor - dViewSize; info.trackInfo.scrollbar.viewsize = dViewSize; if (scrollPtr->vertical) { - if (MOUNTAIN_LION_STYLE) { - info.value = factor * scrollPtr->firstFraction; - } else { info.value = info.max - factor * scrollPtr->firstFraction; - } } else { info.value = MIN_SCROLLBAR_VALUE + factor * scrollPtr->firstFraction; } diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 2a88422..869f717 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -657,65 +657,6 @@ XConfigureWindow( /* *---------------------------------------------------------------------- * - * TkMacOSXSetDrawingEnabled -- - * - * This function sets the TK_DO_NOT_DRAW flag for a given window and - * all of its children. - * - * Results: - * None. - * - * Side effects: - * The clipping regions for the window and its children are cleared. - * - *---------------------------------------------------------------------- - */ - -void -TkMacOSXSetDrawingEnabled( - TkWindow *winPtr, - int flag) -{ - TkWindow *childPtr; - MacDrawable *macWin = winPtr->privatePtr; - - if (macWin) { - if (flag ) { - macWin->flags &= ~TK_DO_NOT_DRAW; - } else { - macWin->flags |= TK_DO_NOT_DRAW; - } - } - - /* - * Set the flag for all children & their descendants, excluding - * Toplevels. (??? Do we need to exclude Toplevels?) - */ - - childPtr = winPtr->childList; - while (childPtr) { - if (!Tk_IsTopLevel(childPtr)) { - TkMacOSXSetDrawingEnabled(childPtr, flag); - } - childPtr = childPtr->nextPtr; - } - - /* - * If the window is a container, set the flag for its embedded window. - */ - - if (Tk_IsContainer(winPtr)) { - childPtr = TkpGetOtherWindow(winPtr); - - if (childPtr) { - TkMacOSXSetDrawingEnabled(childPtr, flag); - } - } -} - -/* - *---------------------------------------------------------------------- - * * TkMacOSXUpdateClipRgn -- * * This function updates the clipping regions for a given window and all of diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 35f9f1c..2e7c041 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -29,7 +29,7 @@ * Declaration of functions used only in this file */ -static int GenerateUpdates(HIShapeRef updateRgn, +static int GenerateUpdates(HIMutableShapeRef updateRgn, CGRect *updateBounds, TkWindow *winPtr); static int GenerateActivateEvents(TkWindow *winPtr, int activeFlag); @@ -315,7 +315,7 @@ extern BOOL opaqueTag; static int GenerateUpdates( - HIShapeRef updateRgn, + HIMutableShapeRef updateRgn, CGRect *updateBounds, TkWindow *winPtr) { @@ -782,8 +782,7 @@ Tk_MacOSXIsAppInFront(void) @interface TKContentView(TKWindowEvent) - (void) drawRect: (NSRect) rect; -- (void) generateExposeEvents: (HIShapeRef) shape; -- (void) generateExposeEvents: (HIShapeRef) shape childrenOnly: (int) childrenOnly; +- (void) generateExposeEvents: (HIMutableShapeRef) shape; - (void) viewDidEndLiveResize; - (void) tkToolbarButton: (id) sender; - (BOOL) isOpaque; @@ -793,8 +792,6 @@ Tk_MacOSXIsAppInFront(void) @end @implementation TKContentView -NSDate *_resizeStart; -NSTimeInterval _resizeDuration; @end /*Restrict event processing to Expose events.*/ @@ -832,7 +829,7 @@ ExposeRestrictProc( HIShapeUnionWithRect(drawShape, &r); } if (CFRunLoopGetMain() == CFRunLoopGetCurrent()) { - [self generateExposeEvents:(HIShapeRef)drawShape]; + [self generateExposeEvents:drawShape]; } else { [self performSelectorOnMainThread:@selector(generateExposeEvents:) withObject:(id)drawShape waitUntilDone:NO @@ -847,33 +844,25 @@ ExposeRestrictProc( -(void) setFrameSize: (NSSize)newsize { if ( [self inLiveResize] ) { - NSWindow *w = [self window]; - TkWindow *winPtr = TkMacOSXGetTkWindow(w); + NSWindow *window = [self window]; + TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); Tk_Window tkwin = (Tk_Window) winPtr; unsigned int width = (unsigned int)newsize.width; unsigned int height=(unsigned int)newsize.height; - /* Resize the NSView */ + /* Resize the Tk Window to the requested size.*/ + TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height, + TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY); + + /* Then resize the NSView to the actual window size*/ + newsize.width = (CGFloat)Tk_Width(tkwin); + newsize.height = (CGFloat)Tk_Height(tkwin); [super setFrameSize: newsize]; - /* Disable drawing until the window has been completely configured.*/ - TkMacOSXSetDrawingEnabled(winPtr, 0); + /* Process all pending events to update the window. */ + while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {} + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} - /* Generate and handle a ConfigureNotify event for the new size.*/ - TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height, - TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY); - while ( Tk_DoOneEvent(TK_X_EVENTS|TK_DONT_WAIT) ) {} - - /* Now that Tk has configured all subwindows we can create the clip regions. */ - TkMacOSXSetDrawingEnabled(winPtr, 1); - TkMacOSXInvalClipRgns(tkwin); - TkMacOSXUpdateClipRgn(winPtr); - - /* Finally, generate and process expose events to redraw the window. */ - HIRect bounds = NSRectToCGRect([self bounds]); - HIShapeRef shape = HIShapeCreateWithRect(&bounds); - [self generateExposeEvents: shape]; - while ( Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT) ) {} } else { [super setFrameSize: newsize]; } @@ -892,44 +881,46 @@ ExposeRestrictProc( [self generateExposeEvents: shape]; } -/* Core method of this class: generates expose events for redrawing. - * Whereas drawRect is intended to be called only from the Appkit event - * loop, this can be called from Tk. If the Tcl_ServiceMode is set to - * TCL_SERVICE_ALL then the expose events will be immediately removed - * from the Tcl event loop and processed. Typically, they should be queued, - * however. - */ -- (void) generateExposeEvents: (HIShapeRef) shape -{ - [self generateExposeEvents:shape childrenOnly:0]; -} - -- (void) generateExposeEvents: (HIShapeRef) shape - childrenOnly: (int) childrenOnly +/*Core function of this class, generates expose events for redrawing.*/ +- (void) generateExposeEvents: (HIMutableShapeRef) shape { TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); unsigned long serial; CGRect updateBounds; - int updatesNeeded; if (!winPtr) { return; } - /* Generate Tk Expose events. */ HIShapeGetBounds(shape, &updateBounds); - /* All of these events will share the same serial number. */ serial = LastKnownRequestProcessed(Tk_Display(winPtr)); - updatesNeeded = GenerateUpdates(shape, &updateBounds, winPtr); - - /* Process the Expose events if the service mode is TCL_SERVICE_ALL */ - if (updatesNeeded && Tcl_GetServiceMode() == TCL_SERVICE_ALL) { - ClientData oldArg; + if (GenerateUpdates(shape, &updateBounds, winPtr) && + ![[NSRunLoop currentRunLoop] currentMode] && + Tcl_GetServiceMode() != TCL_SERVICE_NONE) { + /* + * Ensure there are no pending idle-time redraws that could + * prevent the just posted Expose events from generating + * new redraws. + */ + + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} + + /* + * For smoother drawing, process Expose events and resulting + * redraws immediately instead of at idle time. + */ + + ClientData oldArg; Tk_RestrictProc *oldProc = Tk_RestrictEvents(ExposeRestrictProc, UINT2PTR(serial), &oldArg); + while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {} + Tk_RestrictEvents(oldProc, oldArg, &oldArg); + + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} } + } /* @@ -945,6 +936,7 @@ ExposeRestrictProc( int x, y; TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); Tk_Window tkwin = (Tk_Window) winPtr; + bzero(&event, sizeof(XVirtualEvent)); event.type = VirtualEvent; event.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); -- cgit v0.12 From 809ebd7b888f6a543597c4a087f50f2719093108 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Tue, 7 Apr 2015 01:48:05 +0000 Subject: Backing out changes; unexpected issues with window resizing that require further investigation --- generic/tkCanvas.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 8ebe9ba..14fe1ab 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -2101,19 +2101,6 @@ DisplayCanvas( goto done; } -#ifdef MAC_OSX_TK - /* - * If drawing is disabled, all we need to do is - * clear the REDRAW_PENDING flag. - */ - TkWindow *winPtr = (TkWindow *)(canvasPtr->tkwin); - MacDrawable *macWin = winPtr->privatePtr; - if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){ - canvasPtr->flags &= ~REDRAW_PENDING; - return; - } -#endif - /* * Choose a new current item if that is needed (this could cause event * handlers to be invoked). -- cgit v0.12 From e775b13da67a5d546caac2cf1a2c76d63d80d254 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Tue, 7 Apr 2015 02:18:22 +0000 Subject: Backing out changes; unexpected issues with window resizing that require further investigation --- generic/tkInt.decls | 3 - generic/tkIntPlatDecls.h | 1224 +++++++++++++++++++++++++++++++++++++++++- generic/tkTextDisp.c | 29 +- macosx/tkMacOSXButton.c | 22 +- macosx/tkMacOSXDraw.c | 95 +--- macosx/tkMacOSXInt.h | 2 +- macosx/tkMacOSXScrlbr.c | 59 +- macosx/tkMacOSXSubwindows.c | 59 -- macosx/tkMacOSXWindowEvent.c | 90 ++-- 9 files changed, 1336 insertions(+), 247 deletions(-) diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 7921852..ab56bed 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -956,9 +956,6 @@ declare 50 aqua { declare 51 aqua { void TkGenWMDestroyEvent(Tk_Window tkwin) } -declare 52 aqua { - TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); -} # removed duplicate from tkPlat table (tk.decls) #declare 52 aqua { diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 7654b5d..8bc1815 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -520,11 +520,1227 @@ EXTERN int TkGenerateButtonEvent(int x, int y, Window window, /* 51 */ EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); #endif -#ifndef TkMacOSXSetDrawingEnabled_TCL_DECLARED -#define TkMacOSXSetDrawingEnabled_TCL_DECLARED -/* 52 */ -EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); +/* Slot 52 is reserved */ +#ifndef TkpGetMS_TCL_DECLARED +#define TkpGetMS_TCL_DECLARED +/* 53 */ +EXTERN unsigned long TkpGetMS(void); +#endif +#ifndef TkMacOSXDrawable_TCL_DECLARED +#define TkMacOSXDrawable_TCL_DECLARED +/* 54 */ +EXTERN VOID * TkMacOSXDrawable(Drawable drawable); +#endif +#ifndef TkpScanWindowId_TCL_DECLARED +#define TkpScanWindowId_TCL_DECLARED +/* 55 */ +EXTERN int TkpScanWindowId(Tcl_Interp *interp, + CONST char *string, Window *idPtr); +#endif +#endif /* AQUA */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ +#ifndef TkCreateXEventSource_TCL_DECLARED +#define TkCreateXEventSource_TCL_DECLARED +/* 0 */ +EXTERN void TkCreateXEventSource(void); +#endif +#ifndef TkFreeWindowId_TCL_DECLARED +#define TkFreeWindowId_TCL_DECLARED +/* 1 */ +EXTERN void TkFreeWindowId(TkDisplay *dispPtr, Window w); +#endif +#ifndef TkInitXId_TCL_DECLARED +#define TkInitXId_TCL_DECLARED +/* 2 */ +EXTERN void TkInitXId(TkDisplay *dispPtr); +#endif +#ifndef TkpCmapStressed_TCL_DECLARED +#define TkpCmapStressed_TCL_DECLARED +/* 3 */ +EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); +#endif +#ifndef TkpSync_TCL_DECLARED +#define TkpSync_TCL_DECLARED +/* 4 */ +EXTERN void TkpSync(Display *display); +#endif +#ifndef TkUnixContainerId_TCL_DECLARED +#define TkUnixContainerId_TCL_DECLARED +/* 5 */ +EXTERN Window TkUnixContainerId(TkWindow *winPtr); +#endif +#ifndef TkUnixDoOneXEvent_TCL_DECLARED +#define TkUnixDoOneXEvent_TCL_DECLARED +/* 6 */ +EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); +#endif +#ifndef TkUnixSetMenubar_TCL_DECLARED +#define TkUnixSetMenubar_TCL_DECLARED +/* 7 */ +EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); +#endif +#ifndef TkpScanWindowId_TCL_DECLARED +#define TkpScanWindowId_TCL_DECLARED +/* 8 */ +EXTERN int TkpScanWindowId(Tcl_Interp *interp, + CONST char *string, Window *idPtr); +#endif +#ifndef TkWmCleanup_TCL_DECLARED +#define TkWmCleanup_TCL_DECLARED +/* 9 */ +EXTERN void TkWmCleanup(TkDisplay *dispPtr); +#endif +#ifndef TkSendCleanup_TCL_DECLARED +#define TkSendCleanup_TCL_DECLARED +/* 10 */ +EXTERN void TkSendCleanup(TkDisplay *dispPtr); +#endif +#ifndef TkFreeXId_TCL_DECLARED +#define TkFreeXId_TCL_DECLARED +/* 11 */ +EXTERN void TkFreeXId(TkDisplay *dispPtr); +#endif +#ifndef TkpWmSetState_TCL_DECLARED +#define TkpWmSetState_TCL_DECLARED +/* 12 */ +EXTERN int TkpWmSetState(TkWindow *winPtr, int state); +#endif +#ifndef TkpTestsendCmd_TCL_DECLARED +#define TkpTestsendCmd_TCL_DECLARED +/* 13 */ +EXTERN int TkpTestsendCmd(ClientData clientData, + Tcl_Interp *interp, int argc, + CONST char **argv); +#endif +#endif /* X11 */ + +typedef struct TkIntPlatStubs { + int magic; + struct TkIntPlatStubHooks *hooks; + +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ + char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 0 */ + VOID *reserved1; + void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ + unsigned long (*tkpGetMS) (void); /* 3 */ + void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 4 */ + void (*tkpPrintWindowId) (char *buf, Window window); /* 5 */ + int (*tkpScanWindowId) (Tcl_Interp *interp, CONST char *string, Window *idPtr); /* 6 */ + void (*tkpSetCapture) (TkWindow *winPtr); /* 7 */ + void (*tkpSetCursor) (TkpCursor cursor); /* 8 */ + int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */ + void (*tkSetPixmapColormap) (Pixmap pixmap, Colormap colormap); /* 10 */ + void (*tkWinCancelMouseTimer) (void); /* 11 */ + void (*tkWinClipboardRender) (TkDisplay *dispPtr, UINT format); /* 12 */ + LRESULT (*tkWinEmbeddedEventProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 13 */ + void (*tkWinFillRect) (HDC dc, int x, int y, int width, int height, int pixel); /* 14 */ + COLORREF (*tkWinGetBorderPixels) (Tk_Window tkwin, Tk_3DBorder border, int which); /* 15 */ + HDC (*tkWinGetDrawableDC) (Display *display, Drawable d, TkWinDCState *state); /* 16 */ + int (*tkWinGetModifierState) (void); /* 17 */ + HPALETTE (*tkWinGetSystemPalette) (void); /* 18 */ + HWND (*tkWinGetWrapperWindow) (Tk_Window tkwin); /* 19 */ + int (*tkWinHandleMenuEvent) (HWND *phwnd, UINT *pMessage, WPARAM *pwParam, LPARAM *plParam, LRESULT *plResult); /* 20 */ + int (*tkWinIndexOfColor) (XColor *colorPtr); /* 21 */ + void (*tkWinReleaseDrawableDC) (Drawable d, HDC hdc, TkWinDCState *state); /* 22 */ + LRESULT (*tkWinResendEvent) (WNDPROC wndproc, HWND hwnd, XEvent *eventPtr); /* 23 */ + HPALETTE (*tkWinSelectPalette) (HDC dc, Colormap colormap); /* 24 */ + void (*tkWinSetMenu) (Tk_Window tkwin, HMENU hMenu); /* 25 */ + void (*tkWinSetWindowPos) (HWND hwnd, HWND siblingHwnd, int pos); /* 26 */ + void (*tkWinWmCleanup) (HINSTANCE hInstance); /* 27 */ + void (*tkWinXCleanup) (ClientData clientData); /* 28 */ + void (*tkWinXInit) (HINSTANCE hInstance); /* 29 */ + void (*tkWinSetForegroundWindow) (TkWindow *winPtr); /* 30 */ + void (*tkWinDialogDebug) (int debug); /* 31 */ + Tcl_Obj * (*tkWinGetMenuSystemDefault) (Tk_Window tkwin, CONST char *dbName, CONST char *className); /* 32 */ + int (*tkWinGetPlatformId) (void); /* 33 */ + void (*tkWinSetHINSTANCE) (HINSTANCE hInstance); /* 34 */ + int (*tkWinGetPlatformTheme) (void); /* 35 */ + LRESULT (__stdcall *tkWinChildProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 36 */ + void (*tkCreateXEventSource) (void); /* 37 */ + int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 38 */ + void (*tkpSync) (Display *display); /* 39 */ + Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */ + int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 41 */ + void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ + void (*tkWmCleanup) (TkDisplay *dispPtr); /* 43 */ + void (*tkSendCleanup) (TkDisplay *dispPtr); /* 44 */ + int (*tkpTestsendCmd) (ClientData clientData, Tcl_Interp *interp, int argc, CONST char **argv); /* 45 */ +#endif /* WIN */ +#ifdef MAC_OSX_TK /* AQUA */ + void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 0 */ + VOID *reserved1; + VOID *reserved2; + void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 3 */ + void (*tkpSetCapture) (TkWindow *winPtr); /* 4 */ + void (*tkpSetCursor) (TkpCursor cursor); /* 5 */ + void (*tkpWmSetState) (TkWindow *winPtr, int state); /* 6 */ + void (*tkAboutDlg) (void); /* 7 */ + unsigned int (*tkMacOSXButtonKeyState) (void); /* 8 */ + void (*tkMacOSXClearMenubarActive) (void); /* 9 */ + int (*tkMacOSXDispatchMenuEvent) (int menuID, int index); /* 10 */ + void (*tkMacOSXInstallCursor) (int resizeOverride); /* 11 */ + void (*tkMacOSXHandleTearoffMenu) (void); /* 12 */ + VOID *reserved13; + int (*tkMacOSXDoHLEvent) (VOID *theEvent); /* 14 */ + VOID *reserved15; + Window (*tkMacOSXGetXWindow) (VOID *macWinPtr); /* 16 */ + int (*tkMacOSXGrowToplevel) (VOID *whichWindow, XPoint start); /* 17 */ + void (*tkMacOSXHandleMenuSelect) (short theMenu, unsigned short theItem, int optionKeyPressed); /* 18 */ + VOID *reserved19; + VOID *reserved20; + void (*tkMacOSXInvalidateWindow) (MacDrawable *macWin, int flag); /* 21 */ + int (*tkMacOSXIsCharacterMissing) (Tk_Font tkfont, unsigned int searchChar); /* 22 */ + void (*tkMacOSXMakeRealWindowExist) (TkWindow *winPtr); /* 23 */ + VOID * (*tkMacOSXMakeStippleMap) (Drawable d1, Drawable d2); /* 24 */ + void (*tkMacOSXMenuClick) (void); /* 25 */ + void (*tkMacOSXRegisterOffScreenWindow) (Window window, VOID *portPtr); /* 26 */ + int (*tkMacOSXResizable) (TkWindow *winPtr); /* 27 */ + void (*tkMacOSXSetHelpMenuItemCount) (void); /* 28 */ + void (*tkMacOSXSetScrollbarGrow) (TkWindow *winPtr, int flag); /* 29 */ + void (*tkMacOSXSetUpClippingRgn) (Drawable drawable); /* 30 */ + void (*tkMacOSXSetUpGraphicsPort) (GC gc, VOID *destPort); /* 31 */ + void (*tkMacOSXUpdateClipRgn) (TkWindow *winPtr); /* 32 */ + void (*tkMacOSXUnregisterMacWindow) (VOID *portPtr); /* 33 */ + int (*tkMacOSXUseMenuID) (short macID); /* 34 */ + TkRegion (*tkMacOSXVisableClipRgn) (TkWindow *winPtr); /* 35 */ + void (*tkMacOSXWinBounds) (TkWindow *winPtr, VOID *geometry); /* 36 */ + void (*tkMacOSXWindowOffset) (VOID *wRef, int *xOffset, int *yOffset); /* 37 */ + int (*tkSetMacColor) (unsigned long pixel, VOID *macColor); /* 38 */ + void (*tkSetWMName) (TkWindow *winPtr, Tk_Uid titleUid); /* 39 */ + void (*tkSuspendClipboard) (void); /* 40 */ + int (*tkMacOSXZoomToplevel) (VOID *whichWindow, short zoomPart); /* 41 */ + Tk_Window (*tk_TopCoordsToWindow) (Tk_Window tkwin, int rootX, int rootY, int *newX, int *newY); /* 42 */ + MacDrawable * (*tkMacOSXContainerId) (TkWindow *winPtr); /* 43 */ + MacDrawable * (*tkMacOSXGetHostToplevel) (TkWindow *winPtr); /* 44 */ + void (*tkMacOSXPreprocessMenu) (void); /* 45 */ + int (*tkpIsWindowFloating) (VOID *window); /* 46 */ + Tk_Window (*tkMacOSXGetCapture) (void); /* 47 */ + VOID *reserved48; + Window (*tkGetTransientMaster) (TkWindow *winPtr); /* 49 */ + int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */ + void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */ + VOID *reserved52; + unsigned long (*tkpGetMS) (void); /* 53 */ + VOID * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ + int (*tkpScanWindowId) (Tcl_Interp *interp, CONST char *string, Window *idPtr); /* 55 */ +#endif /* AQUA */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ + void (*tkCreateXEventSource) (void); /* 0 */ + void (*tkFreeWindowId) (TkDisplay *dispPtr, Window w); /* 1 */ + void (*tkInitXId) (TkDisplay *dispPtr); /* 2 */ + int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 3 */ + void (*tkpSync) (Display *display); /* 4 */ + Window (*tkUnixContainerId) (TkWindow *winPtr); /* 5 */ + int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 6 */ + void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 7 */ + int (*tkpScanWindowId) (Tcl_Interp *interp, CONST char *string, Window *idPtr); /* 8 */ + void (*tkWmCleanup) (TkDisplay *dispPtr); /* 9 */ + void (*tkSendCleanup) (TkDisplay *dispPtr); /* 10 */ + void (*tkFreeXId) (TkDisplay *dispPtr); /* 11 */ + int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 12 */ + int (*tkpTestsendCmd) (ClientData clientData, Tcl_Interp *interp, int argc, CONST char **argv); /* 13 */ +#endif /* X11 */ +} TkIntPlatStubs; + +extern TkIntPlatStubs *tkIntPlatStubsPtr; + +#ifdef __cplusplus +} +#endif + +#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) + +/* + * Inline function declarations: + */ + +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ +#ifndef TkAlignImageData +#define TkAlignImageData \ + (tkIntPlatStubsPtr->tkAlignImageData) /* 0 */ +#endif +/* Slot 1 is reserved */ +#ifndef TkGenerateActivateEvents +#define TkGenerateActivateEvents \ + (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ +#endif +#ifndef TkpGetMS +#define TkpGetMS \ + (tkIntPlatStubsPtr->tkpGetMS) /* 3 */ +#endif +#ifndef TkPointerDeadWindow +#define TkPointerDeadWindow \ + (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 4 */ +#endif +#ifndef TkpPrintWindowId +#define TkpPrintWindowId \ + (tkIntPlatStubsPtr->tkpPrintWindowId) /* 5 */ +#endif +#ifndef TkpScanWindowId +#define TkpScanWindowId \ + (tkIntPlatStubsPtr->tkpScanWindowId) /* 6 */ +#endif +#ifndef TkpSetCapture +#define TkpSetCapture \ + (tkIntPlatStubsPtr->tkpSetCapture) /* 7 */ +#endif +#ifndef TkpSetCursor +#define TkpSetCursor \ + (tkIntPlatStubsPtr->tkpSetCursor) /* 8 */ +#endif +#ifndef TkpWmSetState +#define TkpWmSetState \ + (tkIntPlatStubsPtr->tkpWmSetState) /* 9 */ +#endif +#ifndef TkSetPixmapColormap +#define TkSetPixmapColormap \ + (tkIntPlatStubsPtr->tkSetPixmapColormap) /* 10 */ +#endif +#ifndef TkWinCancelMouseTimer +#define TkWinCancelMouseTimer \ + (tkIntPlatStubsPtr->tkWinCancelMouseTimer) /* 11 */ +#endif +#ifndef TkWinClipboardRender +#define TkWinClipboardRender \ + (tkIntPlatStubsPtr->tkWinClipboardRender) /* 12 */ +#endif +#ifndef TkWinEmbeddedEventProc +#define TkWinEmbeddedEventProc \ + (tkIntPlatStubsPtr->tkWinEmbeddedEventProc) /* 13 */ +#endif +#ifndef TkWinFillRect +#define TkWinFillRect \ + (tkIntPlatStubsPtr->tkWinFillRect) /* 14 */ +#endif +#ifndef TkWinGetBorderPixels +#define TkWinGetBorderPixels \ + (tkIntPlatStubsPtr->tkWinGetBorderPixels) /* 15 */ +#endif +#ifndef TkWinGetDrawableDC +#define TkWinGetDrawableDC \ + (tkIntPlatStubsPtr->tkWinGetDrawableDC) /* 16 */ +#endif +#ifndef TkWinGetModifierState +#define TkWinGetModifierState \ + (tkIntPlatStubsPtr->tkWinGetModifierState) /* 17 */ +#endif +#ifndef TkWinGetSystemPalette +#define TkWinGetSystemPalette \ + (tkIntPlatStubsPtr->tkWinGetSystemPalette) /* 18 */ +#endif +#ifndef TkWinGetWrapperWindow +#define TkWinGetWrapperWindow \ + (tkIntPlatStubsPtr->tkWinGetWrapperWindow) /* 19 */ +#endif +#ifndef TkWinHandleMenuEvent +#define TkWinHandleMenuEvent \ + (tkIntPlatStubsPtr->tkWinHandleMenuEvent) /* 20 */ +#endif +#ifndef TkWinIndexOfColor +#define TkWinIndexOfColor \ + (tkIntPlatStubsPtr->tkWinIndexOfColor) /* 21 */ +#endif +#ifndef TkWinReleaseDrawableDC +#define TkWinReleaseDrawableDC \ + (tkIntPlatStubsPtr->tkWinReleaseDrawableDC) /* 22 */ +#endif +#ifndef TkWinResendEvent +#define TkWinResendEvent \ + (tkIntPlatStubsPtr->tkWinResendEvent) /* 23 */ +#endif +#ifndef TkWinSelectPalette +#define TkWinSelectPalette \ + (tkIntPlatStubsPtr->tkWinSelectPalette) /* 24 */ +#endif +#ifndef TkWinSetMenu +#define TkWinSetMenu \ + (tkIntPlatStubsPtr->tkWinSetMenu) /* 25 */ +#endif +#ifndef TkWinSetWindowPos +#define TkWinSetWindowPos \ + (tkIntPlatStubsPtr->tkWinSetWindowPos) /* 26 */ +#endif +#ifndef TkWinWmCleanup +#define TkWinWmCleanup \ + (tkIntPlatStubsPtr->tkWinWmCleanup) /* 27 */ +#endif +#ifndef TkWinXCleanup +#define TkWinXCleanup \ + (tkIntPlatStubsPtr->tkWinXCleanup) /* 28 */ +#endif +#ifndef TkWinXInit +#define TkWinXInit \ + (tkIntPlatStubsPtr->tkWinXInit) /* 29 */ +#endif +#ifndef TkWinSetForegroundWindow +#define TkWinSetForegroundWindow \ + (tkIntPlatStubsPtr->tkWinSetForegroundWindow) /* 30 */ +#endif +#ifndef TkWinDialogDebug +#define TkWinDialogDebug \ + (tkIntPlatStubsPtr->tkWinDialogDebug) /* 31 */ +#endif +#ifndef TkWinGetMenuSystemDefault +#define TkWinGetMenuSystemDefault \ + (tkIntPlatStubsPtr->tkWinGetMenuSystemDefault) /* 32 */ +#endif +#ifndef TkWinGetPlatformId +#define TkWinGetPlatformId \ + (tkIntPlatStubsPtr->tkWinGetPlatformId) /* 33 */ +#endif +#ifndef TkWinSetHINSTANCE +#define TkWinSetHINSTANCE \ + (tkIntPlatStubsPtr->tkWinSetHINSTANCE) /* 34 */ +#endif +#ifndef TkWinGetPlatformTheme +#define TkWinGetPlatformTheme \ + (tkIntPlatStubsPtr->tkWinGetPlatformTheme) /* 35 */ +#endif +#ifndef TkWinChildProc +#define TkWinChildProc \ + (tkIntPlatStubsPtr->tkWinChildProc) /* 36 */ +#endif +#ifndef TkCreateXEventSource +#define TkCreateXEventSource \ + (tkIntPlatStubsPtr->tkCreateXEventSource) /* 37 */ +#endif +#ifndef TkpCmapStressed +#define TkpCmapStressed \ + (tkIntPlatStubsPtr->tkpCmapStressed) /* 38 */ +#endif +#ifndef TkpSync +#define TkpSync \ + (tkIntPlatStubsPtr->tkpSync) /* 39 */ +#endif +#ifndef TkUnixContainerId +#define TkUnixContainerId \ + (tkIntPlatStubsPtr->tkUnixContainerId) /* 40 */ +#endif +#ifndef TkUnixDoOneXEvent +#define TkUnixDoOneXEvent \ + (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 41 */ +#endif +#ifndef TkUnixSetMenubar +#define TkUnixSetMenubar \ + (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 42 */ +#endif +#ifndef TkWmCleanup +#define TkWmCleanup \ + (tkIntPlatStubsPtr->tkWmCleanup) /* 43 */ +#endif +#ifndef TkSendCleanup +#define TkSendCleanup \ + (tkIntPlatStubsPtr->tkSendCleanup) /* 44 */ +#endif +#ifndef TkpTestsendCmd +#define TkpTestsendCmd \ + (tkIntPlatStubsPtr->tkpTestsendCmd) /* 45 */ +#endif +#endif /* WIN */ +#ifdef MAC_OSX_TK /* AQUA */ +#ifndef TkGenerateActivateEvents +#define TkGenerateActivateEvents \ + (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 0 */ +#endif +/* Slot 1 is reserved */ +/* Slot 2 is reserved */ +#ifndef TkPointerDeadWindow +#define TkPointerDeadWindow \ + (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 3 */ +#endif +#ifndef TkpSetCapture +#define TkpSetCapture \ + (tkIntPlatStubsPtr->tkpSetCapture) /* 4 */ +#endif +#ifndef TkpSetCursor +#define TkpSetCursor \ + (tkIntPlatStubsPtr->tkpSetCursor) /* 5 */ +#endif +#ifndef TkpWmSetState +#define TkpWmSetState \ + (tkIntPlatStubsPtr->tkpWmSetState) /* 6 */ +#endif +#ifndef TkAboutDlg +#define TkAboutDlg \ + (tkIntPlatStubsPtr->tkAboutDlg) /* 7 */ +#endif +#ifndef TkMacOSXButtonKeyState +#define TkMacOSXButtonKeyState \ + (tkIntPlatStubsPtr->tkMacOSXButtonKeyState) /* 8 */ +#endif +#ifndef TkMacOSXClearMenubarActive +#define TkMacOSXClearMenubarActive \ + (tkIntPlatStubsPtr->tkMacOSXClearMenubarActive) /* 9 */ +#endif +#ifndef TkMacOSXDispatchMenuEvent +#define TkMacOSXDispatchMenuEvent \ + (tkIntPlatStubsPtr->tkMacOSXDispatchMenuEvent) /* 10 */ +#endif +#ifndef TkMacOSXInstallCursor +#define TkMacOSXInstallCursor \ + (tkIntPlatStubsPtr->tkMacOSXInstallCursor) /* 11 */ +#endif +#ifndef TkMacOSXHandleTearoffMenu +#define TkMacOSXHandleTearoffMenu \ + (tkIntPlatStubsPtr->tkMacOSXHandleTearoffMenu) /* 12 */ +#endif +/* Slot 13 is reserved */ +#ifndef TkMacOSXDoHLEvent +#define TkMacOSXDoHLEvent \ + (tkIntPlatStubsPtr->tkMacOSXDoHLEvent) /* 14 */ +#endif +/* Slot 15 is reserved */ +#ifndef TkMacOSXGetXWindow +#define TkMacOSXGetXWindow \ + (tkIntPlatStubsPtr->tkMacOSXGetXWindow) /* 16 */ +#endif +#ifndef TkMacOSXGrowToplevel +#define TkMacOSXGrowToplevel \ + (tkIntPlatStubsPtr->tkMacOSXGrowToplevel) /* 17 */ +#endif +#ifndef TkMacOSXHandleMenuSelect +#define TkMacOSXHandleMenuSelect \ + (tkIntPlatStubsPtr->tkMacOSXHandleMenuSelect) /* 18 */ +#endif +/* Slot 19 is reserved */ +/* Slot 20 is reserved */ +#ifndef TkMacOSXInvalidateWindow +#define TkMacOSXInvalidateWindow \ + (tkIntPlatStubsPtr->tkMacOSXInvalidateWindow) /* 21 */ +#endif +#ifndef TkMacOSXIsCharacterMissing +#define TkMacOSXIsCharacterMissing \ + (tkIntPlatStubsPtr->tkMacOSXIsCharacterMissing) /* 22 */ +#endif +#ifndef TkMacOSXMakeRealWindowExist +#define TkMacOSXMakeRealWindowExist \ + (tkIntPlatStubsPtr->tkMacOSXMakeRealWindowExist) /* 23 */ +#endif +#ifndef TkMacOSXMakeStippleMap +#define TkMacOSXMakeStippleMap \ + (tkIntPlatStubsPtr->tkMacOSXMakeStippleMap) /* 24 */ +#endif +#ifndef TkMacOSXMenuClick +#define TkMacOSXMenuClick \ + (tkIntPlatStubsPtr->tkMacOSXMenuClick) /* 25 */ +#endif +#ifndef TkMacOSXRegisterOffScreenWindow +#define TkMacOSXRegisterOffScreenWindow \ + (tkIntPlatStubsPtr->tkMacOSXRegisterOffScreenWindow) /* 26 */ +#endif +#ifndef TkMacOSXResizable +#define TkMacOSXResizable \ + (tkIntPlatStubsPtr->tkMacOSXResizable) /* 27 */ +#endif +#ifndef TkMacOSXSetHelpMenuItemCount +#define TkMacOSXSetHelpMenuItemCount \ + (tkIntPlatStubsPtr->tkMacOSXSetHelpMenuItemCount) /* 28 */ +#endif +#ifndef TkMacOSXSetScrollbarGrow +#define TkMacOSXSetScrollbarGrow \ + (tkIntPlatStubsPtr->tkMacOSXSetScrollbarGrow) /* 29 */ +#endif +#ifndef TkMacOSXSetUpClippingRgn +#define TkMacOSXSetUpClippingRgn \ + (tkIntPlatStubsPtr->tkMacOSXSetUpClippingRgn) /* 30 */ +#endif +#ifndef TkMacOSXSetUpGraphicsPort +#define TkMacOSXSetUpGraphicsPort \ + (tkIntPlatStubsPtr->tkMacOSXSetUpGraphicsPort) /* 31 */ +#endif +#ifndef TkMacOSXUpdateClipRgn +#define TkMacOSXUpdateClipRgn \ + (tkIntPlatStubsPtr->tkMacOSXUpdateClipRgn) /* 32 */ +#endif +#ifndef TkMacOSXUnregisterMacWindow +#define TkMacOSXUnregisterMacWindow \ + (tkIntPlatStubsPtr->tkMacOSXUnregisterMacWindow) /* 33 */ +#endif +#ifndef TkMacOSXUseMenuID +#define TkMacOSXUseMenuID \ + (tkIntPlatStubsPtr->tkMacOSXUseMenuID) /* 34 */ +#endif +#ifndef TkMacOSXVisableClipRgn +#define TkMacOSXVisableClipRgn \ + (tkIntPlatStubsPtr->tkMacOSXVisableClipRgn) /* 35 */ +#endif +#ifndef TkMacOSXWinBounds +#define TkMacOSXWinBounds \ + (tkIntPlatStubsPtr->tkMacOSXWinBounds) /* 36 */ +#endif +#ifndef TkMacOSXWindowOffset +#define TkMacOSXWindowOffset \ + (tkIntPlatStubsPtr->tkMacOSXWindowOffset) /* 37 */ +#endif +#ifndef TkSetMacColor +#define TkSetMacColor \ + (tkIntPlatStubsPtr->tkSetMacColor) /* 38 */ +#endif +#ifndef TkSetWMName +#define TkSetWMName \ + (tkIntPlatStubsPtr->tkSetWMName) /* 39 */ +#endif +#ifndef TkSuspendClipboard +#define TkSuspendClipboard \ + (tkIntPlatStubsPtr->tkSuspendClipboard) /* 40 */ +#endif +#ifndef TkMacOSXZoomToplevel +#define TkMacOSXZoomToplevel \ + (tkIntPlatStubsPtr->tkMacOSXZoomToplevel) /* 41 */ +#endif +#ifndef Tk_TopCoordsToWindow +#define Tk_TopCoordsToWindow \ + (tkIntPlatStubsPtr->tk_TopCoordsToWindow) /* 42 */ +#endif +#ifndef TkMacOSXContainerId +#define TkMacOSXContainerId \ + (tkIntPlatStubsPtr->tkMacOSXContainerId) /* 43 */ +#endif +#ifndef TkMacOSXGetHostToplevel +#define TkMacOSXGetHostToplevel \ + (tkIntPlatStubsPtr->tkMacOSXGetHostToplevel) /* 44 */ +#endif +#ifndef TkMacOSXPreprocessMenu +#define TkMacOSXPreprocessMenu \ + (tkIntPlatStubsPtr->tkMacOSXPreprocessMenu) /* 45 */ +#endif +#ifndef TkpIsWindowFloating +#define TkpIsWindowFloating \ + (tkIntPlatStubsPtr->tkpIsWindowFloating) /* 46 */ +#endif +#ifndef TkMacOSXGetCapture +#define TkMacOSXGetCapture \ + (tkIntPlatStubsPtr->tkMacOSXGetCapture) /* 47 */ +#endif +/* Slot 48 is reserved */ +#ifndef TkGetTransientMaster +#define TkGetTransientMaster \ + (tkIntPlatStubsPtr->tkGetTransientMaster) /* 49 */ +#endif +#ifndef TkGenerateButtonEvent +#define TkGenerateButtonEvent \ + (tkIntPlatStubsPtr->tkGenerateButtonEvent) /* 50 */ +#endif +#ifndef TkGenWMDestroyEvent +#define TkGenWMDestroyEvent \ + (tkIntPlatStubsPtr->tkGenWMDestroyEvent) /* 51 */ +#endif +/* Slot 52 is reserved */ +#ifndef TkpGetMS +#define TkpGetMS \ + (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ +#endif +#ifndef TkMacOSXDrawable +#define TkMacOSXDrawable \ + (tkIntPlatStubsPtr->tkMacOSXDrawable) /* 54 */ +#endif +#ifndef TkpScanWindowId +#define TkpScanWindowId \ + (tkIntPlatStubsPtr->tkpScanWindowId) /* 55 */ +#endif +#endif /* AQUA */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ +#ifndef TkCreateXEventSource +#define TkCreateXEventSource \ + (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */ +#endif +#ifndef TkFreeWindowId +#define TkFreeWindowId \ + (tkIntPlatStubsPtr->tkFreeWindowId) /* 1 */ +#endif +#ifndef TkInitXId +#define TkInitXId \ + (tkIntPlatStubsPtr->tkInitXId) /* 2 */ +#endif +#ifndef TkpCmapStressed +#define TkpCmapStressed \ + (tkIntPlatStubsPtr->tkpCmapStressed) /* 3 */ +#endif +#ifndef TkpSync +#define TkpSync \ + (tkIntPlatStubsPtr->tkpSync) /* 4 */ +#endif +#ifndef TkUnixContainerId +#define TkUnixContainerId \ + (tkIntPlatStubsPtr->tkUnixContainerId) /* 5 */ +#endif +#ifndef TkUnixDoOneXEvent +#define TkUnixDoOneXEvent \ + (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 6 */ +#endif +#ifndef TkUnixSetMenubar +#define TkUnixSetMenubar \ + (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 7 */ +#endif +#ifndef TkpScanWindowId +#define TkpScanWindowId \ + (tkIntPlatStubsPtr->tkpScanWindowId) /* 8 */ +#endif +#ifndef TkWmCleanup +#define TkWmCleanup \ + (tkIntPlatStubsPtr->tkWmCleanup) /* 9 */ +#endif +#ifndef TkSendCleanup +#define TkSendCleanup \ + (tkIntPlatStubsPtr->tkSendCleanup) /* 10 */ +#endif +#ifndef TkFreeXId +#define TkFreeXId \ + (tkIntPlatStubsPtr->tkFreeXId) /* 11 */ +#endif +#ifndef TkpWmSetState +#define TkpWmSetState \ + (tkIntPlatStubsPtr->tkpWmSetState) /* 12 */ +#endif +#ifndef TkpTestsendCmd +#define TkpTestsendCmd \ + (tkIntPlatStubsPtr->tkpTestsendCmd) /* 13 */ +#endif +#endif /* X11 */ + +#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ + +/* !END!: Do not edit above this line. */ + +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLIMPORT + +#ifdef __CYGWIN__ + void TkFreeXId(TkDisplay *dispPtr); + void TkFreeWindowId(TkDisplay *dispPtr, Window w); + void TkInitXId(TkDisplay *dispPtr); +#endif + +#ifdef __WIN32__ +#undef TkpCmapStressed +#undef TkpSync +#define TkpCmapStressed(tkwin,colormap) (0) +#define TkpSync(display) +#endif + +#endif /* _TKINTPLATDECLS *//* + * tkIntPlatDecls.h -- + * + * This file contains the declarations for all platform dependent + * unsupported functions that are exported by the Tk library. These + * interfaces are not guaranteed to remain the same between + * versions. Use at your own risk. + * + * Copyright (c) 1998-1999 by Scriptics Corporation. + * All rights reserved. + */ + +#ifndef _TKINTPLATDECLS +#define _TKINTPLATDECLS + +#ifdef BUILD_tk +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLEXPORT +#endif + +/* + * WARNING: This file is automatically generated by the tools/genStubs.tcl + * script. Any modifications to the function declarations below should be made + * in the generic/tkInt.decls script. + */ + +/* !BEGIN!: Do not edit below this line. */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Exported function declarations: + */ + +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ +#ifndef TkAlignImageData_TCL_DECLARED +#define TkAlignImageData_TCL_DECLARED +/* 0 */ +EXTERN char * TkAlignImageData(XImage *image, int alignment, + int bitOrder); +#endif +/* Slot 1 is reserved */ +#ifndef TkGenerateActivateEvents_TCL_DECLARED +#define TkGenerateActivateEvents_TCL_DECLARED +/* 2 */ +EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, + int active); +#endif +#ifndef TkpGetMS_TCL_DECLARED +#define TkpGetMS_TCL_DECLARED +/* 3 */ +EXTERN unsigned long TkpGetMS(void); +#endif +#ifndef TkPointerDeadWindow_TCL_DECLARED +#define TkPointerDeadWindow_TCL_DECLARED +/* 4 */ +EXTERN void TkPointerDeadWindow(TkWindow *winPtr); +#endif +#ifndef TkpPrintWindowId_TCL_DECLARED +#define TkpPrintWindowId_TCL_DECLARED +/* 5 */ +EXTERN void TkpPrintWindowId(char *buf, Window window); +#endif +#ifndef TkpScanWindowId_TCL_DECLARED +#define TkpScanWindowId_TCL_DECLARED +/* 6 */ +EXTERN int TkpScanWindowId(Tcl_Interp *interp, + CONST char *string, Window *idPtr); +#endif +#ifndef TkpSetCapture_TCL_DECLARED +#define TkpSetCapture_TCL_DECLARED +/* 7 */ +EXTERN void TkpSetCapture(TkWindow *winPtr); +#endif +#ifndef TkpSetCursor_TCL_DECLARED +#define TkpSetCursor_TCL_DECLARED +/* 8 */ +EXTERN void TkpSetCursor(TkpCursor cursor); +#endif +#ifndef TkpWmSetState_TCL_DECLARED +#define TkpWmSetState_TCL_DECLARED +/* 9 */ +EXTERN int TkpWmSetState(TkWindow *winPtr, int state); +#endif +#ifndef TkSetPixmapColormap_TCL_DECLARED +#define TkSetPixmapColormap_TCL_DECLARED +/* 10 */ +EXTERN void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap); +#endif +#ifndef TkWinCancelMouseTimer_TCL_DECLARED +#define TkWinCancelMouseTimer_TCL_DECLARED +/* 11 */ +EXTERN void TkWinCancelMouseTimer(void); +#endif +#ifndef TkWinClipboardRender_TCL_DECLARED +#define TkWinClipboardRender_TCL_DECLARED +/* 12 */ +EXTERN void TkWinClipboardRender(TkDisplay *dispPtr, UINT format); +#endif +#ifndef TkWinEmbeddedEventProc_TCL_DECLARED +#define TkWinEmbeddedEventProc_TCL_DECLARED +/* 13 */ +EXTERN LRESULT TkWinEmbeddedEventProc(HWND hwnd, UINT message, + WPARAM wParam, LPARAM lParam); +#endif +#ifndef TkWinFillRect_TCL_DECLARED +#define TkWinFillRect_TCL_DECLARED +/* 14 */ +EXTERN void TkWinFillRect(HDC dc, int x, int y, int width, + int height, int pixel); +#endif +#ifndef TkWinGetBorderPixels_TCL_DECLARED +#define TkWinGetBorderPixels_TCL_DECLARED +/* 15 */ +EXTERN COLORREF TkWinGetBorderPixels(Tk_Window tkwin, + Tk_3DBorder border, int which); +#endif +#ifndef TkWinGetDrawableDC_TCL_DECLARED +#define TkWinGetDrawableDC_TCL_DECLARED +/* 16 */ +EXTERN HDC TkWinGetDrawableDC(Display *display, Drawable d, + TkWinDCState *state); +#endif +#ifndef TkWinGetModifierState_TCL_DECLARED +#define TkWinGetModifierState_TCL_DECLARED +/* 17 */ +EXTERN int TkWinGetModifierState(void); +#endif +#ifndef TkWinGetSystemPalette_TCL_DECLARED +#define TkWinGetSystemPalette_TCL_DECLARED +/* 18 */ +EXTERN HPALETTE TkWinGetSystemPalette(void); +#endif +#ifndef TkWinGetWrapperWindow_TCL_DECLARED +#define TkWinGetWrapperWindow_TCL_DECLARED +/* 19 */ +EXTERN HWND TkWinGetWrapperWindow(Tk_Window tkwin); +#endif +#ifndef TkWinHandleMenuEvent_TCL_DECLARED +#define TkWinHandleMenuEvent_TCL_DECLARED +/* 20 */ +EXTERN int TkWinHandleMenuEvent(HWND *phwnd, UINT *pMessage, + WPARAM *pwParam, LPARAM *plParam, + LRESULT *plResult); +#endif +#ifndef TkWinIndexOfColor_TCL_DECLARED +#define TkWinIndexOfColor_TCL_DECLARED +/* 21 */ +EXTERN int TkWinIndexOfColor(XColor *colorPtr); +#endif +#ifndef TkWinReleaseDrawableDC_TCL_DECLARED +#define TkWinReleaseDrawableDC_TCL_DECLARED +/* 22 */ +EXTERN void TkWinReleaseDrawableDC(Drawable d, HDC hdc, + TkWinDCState *state); +#endif +#ifndef TkWinResendEvent_TCL_DECLARED +#define TkWinResendEvent_TCL_DECLARED +/* 23 */ +EXTERN LRESULT TkWinResendEvent(WNDPROC wndproc, HWND hwnd, + XEvent *eventPtr); +#endif +#ifndef TkWinSelectPalette_TCL_DECLARED +#define TkWinSelectPalette_TCL_DECLARED +/* 24 */ +EXTERN HPALETTE TkWinSelectPalette(HDC dc, Colormap colormap); +#endif +#ifndef TkWinSetMenu_TCL_DECLARED +#define TkWinSetMenu_TCL_DECLARED +/* 25 */ +EXTERN void TkWinSetMenu(Tk_Window tkwin, HMENU hMenu); +#endif +#ifndef TkWinSetWindowPos_TCL_DECLARED +#define TkWinSetWindowPos_TCL_DECLARED +/* 26 */ +EXTERN void TkWinSetWindowPos(HWND hwnd, HWND siblingHwnd, + int pos); +#endif +#ifndef TkWinWmCleanup_TCL_DECLARED +#define TkWinWmCleanup_TCL_DECLARED +/* 27 */ +EXTERN void TkWinWmCleanup(HINSTANCE hInstance); +#endif +#ifndef TkWinXCleanup_TCL_DECLARED +#define TkWinXCleanup_TCL_DECLARED +/* 28 */ +EXTERN void TkWinXCleanup(ClientData clientData); +#endif +#ifndef TkWinXInit_TCL_DECLARED +#define TkWinXInit_TCL_DECLARED +/* 29 */ +EXTERN void TkWinXInit(HINSTANCE hInstance); +#endif +#ifndef TkWinSetForegroundWindow_TCL_DECLARED +#define TkWinSetForegroundWindow_TCL_DECLARED +/* 30 */ +EXTERN void TkWinSetForegroundWindow(TkWindow *winPtr); +#endif +#ifndef TkWinDialogDebug_TCL_DECLARED +#define TkWinDialogDebug_TCL_DECLARED +/* 31 */ +EXTERN void TkWinDialogDebug(int debug); +#endif +#ifndef TkWinGetMenuSystemDefault_TCL_DECLARED +#define TkWinGetMenuSystemDefault_TCL_DECLARED +/* 32 */ +EXTERN Tcl_Obj * TkWinGetMenuSystemDefault(Tk_Window tkwin, + CONST char *dbName, CONST char *className); +#endif +#ifndef TkWinGetPlatformId_TCL_DECLARED +#define TkWinGetPlatformId_TCL_DECLARED +/* 33 */ +EXTERN int TkWinGetPlatformId(void); +#endif +#ifndef TkWinSetHINSTANCE_TCL_DECLARED +#define TkWinSetHINSTANCE_TCL_DECLARED +/* 34 */ +EXTERN void TkWinSetHINSTANCE(HINSTANCE hInstance); +#endif +#ifndef TkWinGetPlatformTheme_TCL_DECLARED +#define TkWinGetPlatformTheme_TCL_DECLARED +/* 35 */ +EXTERN int TkWinGetPlatformTheme(void); +#endif +#ifndef TkWinChildProc_TCL_DECLARED +#define TkWinChildProc_TCL_DECLARED +/* 36 */ +EXTERN LRESULT __stdcall TkWinChildProc(HWND hwnd, UINT message, + WPARAM wParam, LPARAM lParam); +#endif +#ifndef TkCreateXEventSource_TCL_DECLARED +#define TkCreateXEventSource_TCL_DECLARED +/* 37 */ +EXTERN void TkCreateXEventSource(void); +#endif +#ifndef TkpCmapStressed_TCL_DECLARED +#define TkpCmapStressed_TCL_DECLARED +/* 38 */ +EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); +#endif +#ifndef TkpSync_TCL_DECLARED +#define TkpSync_TCL_DECLARED +/* 39 */ +EXTERN void TkpSync(Display *display); +#endif +#ifndef TkUnixContainerId_TCL_DECLARED +#define TkUnixContainerId_TCL_DECLARED +/* 40 */ +EXTERN Window TkUnixContainerId(TkWindow *winPtr); +#endif +#ifndef TkUnixDoOneXEvent_TCL_DECLARED +#define TkUnixDoOneXEvent_TCL_DECLARED +/* 41 */ +EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); +#endif +#ifndef TkUnixSetMenubar_TCL_DECLARED +#define TkUnixSetMenubar_TCL_DECLARED +/* 42 */ +EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); +#endif +#ifndef TkWmCleanup_TCL_DECLARED +#define TkWmCleanup_TCL_DECLARED +/* 43 */ +EXTERN void TkWmCleanup(TkDisplay *dispPtr); #endif +#ifndef TkSendCleanup_TCL_DECLARED +#define TkSendCleanup_TCL_DECLARED +/* 44 */ +EXTERN void TkSendCleanup(TkDisplay *dispPtr); +#endif +#ifndef TkpTestsendCmd_TCL_DECLARED +#define TkpTestsendCmd_TCL_DECLARED +/* 45 */ +EXTERN int TkpTestsendCmd(ClientData clientData, + Tcl_Interp *interp, int argc, + CONST char **argv); +#endif +#endif /* WIN */ +#ifdef MAC_OSX_TK /* AQUA */ +#ifndef TkGenerateActivateEvents_TCL_DECLARED +#define TkGenerateActivateEvents_TCL_DECLARED +/* 0 */ +EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, + int active); +#endif +/* Slot 1 is reserved */ +/* Slot 2 is reserved */ +#ifndef TkPointerDeadWindow_TCL_DECLARED +#define TkPointerDeadWindow_TCL_DECLARED +/* 3 */ +EXTERN void TkPointerDeadWindow(TkWindow *winPtr); +#endif +#ifndef TkpSetCapture_TCL_DECLARED +#define TkpSetCapture_TCL_DECLARED +/* 4 */ +EXTERN void TkpSetCapture(TkWindow *winPtr); +#endif +#ifndef TkpSetCursor_TCL_DECLARED +#define TkpSetCursor_TCL_DECLARED +/* 5 */ +EXTERN void TkpSetCursor(TkpCursor cursor); +#endif +#ifndef TkpWmSetState_TCL_DECLARED +#define TkpWmSetState_TCL_DECLARED +/* 6 */ +EXTERN void TkpWmSetState(TkWindow *winPtr, int state); +#endif +#ifndef TkAboutDlg_TCL_DECLARED +#define TkAboutDlg_TCL_DECLARED +/* 7 */ +EXTERN void TkAboutDlg(void); +#endif +#ifndef TkMacOSXButtonKeyState_TCL_DECLARED +#define TkMacOSXButtonKeyState_TCL_DECLARED +/* 8 */ +EXTERN unsigned int TkMacOSXButtonKeyState(void); +#endif +#ifndef TkMacOSXClearMenubarActive_TCL_DECLARED +#define TkMacOSXClearMenubarActive_TCL_DECLARED +/* 9 */ +EXTERN void TkMacOSXClearMenubarActive(void); +#endif +#ifndef TkMacOSXDispatchMenuEvent_TCL_DECLARED +#define TkMacOSXDispatchMenuEvent_TCL_DECLARED +/* 10 */ +EXTERN int TkMacOSXDispatchMenuEvent(int menuID, int index); +#endif +#ifndef TkMacOSXInstallCursor_TCL_DECLARED +#define TkMacOSXInstallCursor_TCL_DECLARED +/* 11 */ +EXTERN void TkMacOSXInstallCursor(int resizeOverride); +#endif +#ifndef TkMacOSXHandleTearoffMenu_TCL_DECLARED +#define TkMacOSXHandleTearoffMenu_TCL_DECLARED +/* 12 */ +EXTERN void TkMacOSXHandleTearoffMenu(void); +#endif +/* Slot 13 is reserved */ +#ifndef TkMacOSXDoHLEvent_TCL_DECLARED +#define TkMacOSXDoHLEvent_TCL_DECLARED +/* 14 */ +EXTERN int TkMacOSXDoHLEvent(VOID *theEvent); +#endif +/* Slot 15 is reserved */ +#ifndef TkMacOSXGetXWindow_TCL_DECLARED +#define TkMacOSXGetXWindow_TCL_DECLARED +/* 16 */ +EXTERN Window TkMacOSXGetXWindow(VOID *macWinPtr); +#endif +#ifndef TkMacOSXGrowToplevel_TCL_DECLARED +#define TkMacOSXGrowToplevel_TCL_DECLARED +/* 17 */ +EXTERN int TkMacOSXGrowToplevel(VOID *whichWindow, XPoint start); +#endif +#ifndef TkMacOSXHandleMenuSelect_TCL_DECLARED +#define TkMacOSXHandleMenuSelect_TCL_DECLARED +/* 18 */ +EXTERN void TkMacOSXHandleMenuSelect(short theMenu, + unsigned short theItem, int optionKeyPressed); +#endif +/* Slot 19 is reserved */ +/* Slot 20 is reserved */ +#ifndef TkMacOSXInvalidateWindow_TCL_DECLARED +#define TkMacOSXInvalidateWindow_TCL_DECLARED +/* 21 */ +EXTERN void TkMacOSXInvalidateWindow(MacDrawable *macWin, + int flag); +#endif +#ifndef TkMacOSXIsCharacterMissing_TCL_DECLARED +#define TkMacOSXIsCharacterMissing_TCL_DECLARED +/* 22 */ +EXTERN int TkMacOSXIsCharacterMissing(Tk_Font tkfont, + unsigned int searchChar); +#endif +#ifndef TkMacOSXMakeRealWindowExist_TCL_DECLARED +#define TkMacOSXMakeRealWindowExist_TCL_DECLARED +/* 23 */ +EXTERN void TkMacOSXMakeRealWindowExist(TkWindow *winPtr); +#endif +#ifndef TkMacOSXMakeStippleMap_TCL_DECLARED +#define TkMacOSXMakeStippleMap_TCL_DECLARED +/* 24 */ +EXTERN VOID * TkMacOSXMakeStippleMap(Drawable d1, Drawable d2); +#endif +#ifndef TkMacOSXMenuClick_TCL_DECLARED +#define TkMacOSXMenuClick_TCL_DECLARED +/* 25 */ +EXTERN void TkMacOSXMenuClick(void); +#endif +#ifndef TkMacOSXRegisterOffScreenWindow_TCL_DECLARED +#define TkMacOSXRegisterOffScreenWindow_TCL_DECLARED +/* 26 */ +EXTERN void TkMacOSXRegisterOffScreenWindow(Window window, + VOID *portPtr); +#endif +#ifndef TkMacOSXResizable_TCL_DECLARED +#define TkMacOSXResizable_TCL_DECLARED +/* 27 */ +EXTERN int TkMacOSXResizable(TkWindow *winPtr); +#endif +#ifndef TkMacOSXSetHelpMenuItemCount_TCL_DECLARED +#define TkMacOSXSetHelpMenuItemCount_TCL_DECLARED +/* 28 */ +EXTERN void TkMacOSXSetHelpMenuItemCount(void); +#endif +#ifndef TkMacOSXSetScrollbarGrow_TCL_DECLARED +#define TkMacOSXSetScrollbarGrow_TCL_DECLARED +/* 29 */ +EXTERN void TkMacOSXSetScrollbarGrow(TkWindow *winPtr, int flag); +#endif +#ifndef TkMacOSXSetUpClippingRgn_TCL_DECLARED +#define TkMacOSXSetUpClippingRgn_TCL_DECLARED +/* 30 */ +EXTERN void TkMacOSXSetUpClippingRgn(Drawable drawable); +#endif +#ifndef TkMacOSXSetUpGraphicsPort_TCL_DECLARED +#define TkMacOSXSetUpGraphicsPort_TCL_DECLARED +/* 31 */ +EXTERN void TkMacOSXSetUpGraphicsPort(GC gc, VOID *destPort); +#endif +#ifndef TkMacOSXUpdateClipRgn_TCL_DECLARED +#define TkMacOSXUpdateClipRgn_TCL_DECLARED +/* 32 */ +EXTERN void TkMacOSXUpdateClipRgn(TkWindow *winPtr); +#endif +#ifndef TkMacOSXUnregisterMacWindow_TCL_DECLARED +#define TkMacOSXUnregisterMacWindow_TCL_DECLARED +/* 33 */ +EXTERN void TkMacOSXUnregisterMacWindow(VOID *portPtr); +#endif +#ifndef TkMacOSXUseMenuID_TCL_DECLARED +#define TkMacOSXUseMenuID_TCL_DECLARED +/* 34 */ +EXTERN int TkMacOSXUseMenuID(short macID); +#endif +#ifndef TkMacOSXVisableClipRgn_TCL_DECLARED +#define TkMacOSXVisableClipRgn_TCL_DECLARED +/* 35 */ +EXTERN TkRegion TkMacOSXVisableClipRgn(TkWindow *winPtr); +#endif +#ifndef TkMacOSXWinBounds_TCL_DECLARED +#define TkMacOSXWinBounds_TCL_DECLARED +/* 36 */ +EXTERN void TkMacOSXWinBounds(TkWindow *winPtr, VOID *geometry); +#endif +#ifndef TkMacOSXWindowOffset_TCL_DECLARED +#define TkMacOSXWindowOffset_TCL_DECLARED +/* 37 */ +EXTERN void TkMacOSXWindowOffset(VOID *wRef, int *xOffset, + int *yOffset); +#endif +#ifndef TkSetMacColor_TCL_DECLARED +#define TkSetMacColor_TCL_DECLARED +/* 38 */ +EXTERN int TkSetMacColor(unsigned long pixel, VOID *macColor); +#endif +#ifndef TkSetWMName_TCL_DECLARED +#define TkSetWMName_TCL_DECLARED +/* 39 */ +EXTERN void TkSetWMName(TkWindow *winPtr, Tk_Uid titleUid); +#endif +#ifndef TkSuspendClipboard_TCL_DECLARED +#define TkSuspendClipboard_TCL_DECLARED +/* 40 */ +EXTERN void TkSuspendClipboard(void); +#endif +#ifndef TkMacOSXZoomToplevel_TCL_DECLARED +#define TkMacOSXZoomToplevel_TCL_DECLARED +/* 41 */ +EXTERN int TkMacOSXZoomToplevel(VOID *whichWindow, + short zoomPart); +#endif +#ifndef Tk_TopCoordsToWindow_TCL_DECLARED +#define Tk_TopCoordsToWindow_TCL_DECLARED +/* 42 */ +EXTERN Tk_Window Tk_TopCoordsToWindow(Tk_Window tkwin, int rootX, + int rootY, int *newX, int *newY); +#endif +#ifndef TkMacOSXContainerId_TCL_DECLARED +#define TkMacOSXContainerId_TCL_DECLARED +/* 43 */ +EXTERN MacDrawable * TkMacOSXContainerId(TkWindow *winPtr); +#endif +#ifndef TkMacOSXGetHostToplevel_TCL_DECLARED +#define TkMacOSXGetHostToplevel_TCL_DECLARED +/* 44 */ +EXTERN MacDrawable * TkMacOSXGetHostToplevel(TkWindow *winPtr); +#endif +#ifndef TkMacOSXPreprocessMenu_TCL_DECLARED +#define TkMacOSXPreprocessMenu_TCL_DECLARED +/* 45 */ +EXTERN void TkMacOSXPreprocessMenu(void); +#endif +#ifndef TkpIsWindowFloating_TCL_DECLARED +#define TkpIsWindowFloating_TCL_DECLARED +/* 46 */ +EXTERN int TkpIsWindowFloating(VOID *window); +#endif +#ifndef TkMacOSXGetCapture_TCL_DECLARED +#define TkMacOSXGetCapture_TCL_DECLARED +/* 47 */ +EXTERN Tk_Window TkMacOSXGetCapture(void); +#endif +/* Slot 48 is reserved */ +#ifndef TkGetTransientMaster_TCL_DECLARED +#define TkGetTransientMaster_TCL_DECLARED +/* 49 */ +EXTERN Window TkGetTransientMaster(TkWindow *winPtr); +#endif +#ifndef TkGenerateButtonEvent_TCL_DECLARED +#define TkGenerateButtonEvent_TCL_DECLARED +/* 50 */ +EXTERN int TkGenerateButtonEvent(int x, int y, Window window, + unsigned int state); +#endif +#ifndef TkGenWMDestroyEvent_TCL_DECLARED +#define TkGenWMDestroyEvent_TCL_DECLARED +/* 51 */ +EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); +#endif +/* Slot 52 is reserved */ #ifndef TkpGetMS_TCL_DECLARED #define TkpGetMS_TCL_DECLARED /* 53 */ diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 5f69690..bcbb03a 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -3954,19 +3954,6 @@ DisplayText( return; } -#ifdef MAC_OSX_TK - /* - * If drawing is disabled, all we need to do is - * clear the REDRAW_PENDING flag. - */ - TkWindow *winPtr = (TkWindow *)(textPtr->tkwin); - MacDrawable *macWin = winPtr->privatePtr; - if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){ - dInfoPtr->flags &= ~REDRAW_PENDING; - return; - } -#endif - interp = textPtr->interp; Tcl_Preserve((ClientData) interp); @@ -3974,6 +3961,14 @@ DisplayText( Tcl_SetVar2(interp, "tk_textRelayout", NULL, "", TCL_GLOBAL_ONLY); } + if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { + /* + * The widget has been deleted. Don't do anything. + */ + + goto end; + } + if (!Tk_IsMapped(textPtr->tkwin) || (dInfoPtr->maxX <= dInfoPtr->x) || (dInfoPtr->maxY <= dInfoPtr->y)) { UpdateDisplayInfo(textPtr); @@ -3985,6 +3980,14 @@ DisplayText( Tcl_SetVar2(interp, "tk_textRedraw", NULL, "", TCL_GLOBAL_ONLY); } + if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { + /* + * The widget has been deleted. Don't do anything. + */ + + goto end; + } + /* * Choose a new current item if that is needed (this could cause event * handlers to be invoked, hence the preserve/release calls and the loop, diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index 0323081..c1dec90 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -30,10 +30,10 @@ * Default insets for controls */ -#define DEF_INSET_LEFT 12 -#define DEF_INSET_RIGHT 12 -#define DEF_INSET_TOP 1 -#define DEF_INSET_BOTTOM 1 +#define DEF_INSET_LEFT 2 +#define DEF_INSET_RIGHT 2 +#define DEF_INSET_TOP 2 +#define DEF_INSET_BOTTOM 4 /* * Some defines used to control what type of control is drawn. @@ -318,8 +318,8 @@ TkpComputeButtonGeometry( Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength, butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight); - txtWidth = butPtr->textWidth + DEF_INSET_LEFT + DEF_INSET_RIGHT; - txtHeight = butPtr->textHeight + DEF_INSET_BOTTOM + DEF_INSET_TOP; + txtWidth = butPtr->textWidth; + txtHeight = butPtr->textHeight; charWidth = Tk_TextWidth(butPtr->tkfont, "0", 1); Tk_GetFontMetrics(butPtr->tkfont, &fm); haveText = (txtWidth != 0 && txtHeight != 0); @@ -647,7 +647,7 @@ DrawButtonImageAndText( butPtr->textHeight, &x, &y); x += butPtr->indicatorSpace; Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout, - x, y - DEF_INSET_BOTTOM, 0, -1); + x, y, 0, -1); } /* @@ -807,12 +807,9 @@ TkMacOSXDrawButton( hiinfo.animation.time.start = hiinfo.animation.time.current; } - HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal, - &contHIRec); - + HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal, &contHIRec); TkMacOSXRestoreDrawingContext(&dc); - ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, - (MacButton *)mbPtr, 32, true); + ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, (MacButton *)mbPtr, 32, true); } else { if (!TkMacOSXSetupDrawingContext(pixmap, dpPtr->gc, 1, &dc)) { @@ -1210,4 +1207,3 @@ PulseDefaultButtonProc(ClientData clientData) mbPtr->defaultPulseHandler = Tcl_CreateTimerHandler( PULSE_TIMER_MSECS, PulseDefaultButtonProc, clientData); } - diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 3f51d00..c1ffdf8 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -222,8 +222,7 @@ XCopyArea( } if (!TkMacOSXSetupDrawingContext(dst, gc, 1, &dc)) { - return; - /*TkMacOSXDbgMsg("Failed to setup drawing context.");*/ + TkMacOSXDbgMsg("Failed to setup drawing context."); } if ( dc.context ) { @@ -244,8 +243,6 @@ XCopyArea( CGRectMake(src_x, src_y, width, height), CGRectMake(dest_x, dest_y, width, height)); CFRelease(img); - - } else { TkMacOSXDbgMsg("Failed to construct CGImage."); } @@ -655,9 +652,9 @@ GetCGContextForDrawable( CGColorSpaceRef colorspace = NULL; CGBitmapInfo bitmapInfo = #ifdef __LITTLE_ENDIAN__ - kCGBitmapByteOrder32Host; + kCGBitmapByteOrder32Host; #else - kCGBitmapByteOrderDefault; + kCGBitmapByteOrderDefault; #endif char *data; CGRect bounds = CGRectMake(0, 0, macDraw->size.width, @@ -734,7 +731,6 @@ DrawCGImage( } } dstBounds = CGRectOffset(dstBounds, macDraw->xOff, macDraw->yOff); - if (CGImageIsMask(image)) { /*CGContextSaveGState(context);*/ if (macDraw->flags & TK_IS_BW_PIXMAP) { @@ -1478,94 +1474,51 @@ TkScrollWindow( TkRegion damageRgn) /* Region to accumulate damage in. */ { Drawable drawable = Tk_WindowId(tkwin); - MacDrawable *macDraw = (MacDrawable *) drawable; + MacDrawable *macDraw = (MacDrawable *) drawable; NSView *view = TkMacOSXDrawableView(macDraw); CGRect srcRect, dstRect; - HIShapeRef dmgRgn = NULL, extraRgn = NULL; + HIShapeRef dmgRgn = NULL, extraRgn; NSRect bounds, visRect, scrollSrc, scrollDst; - int result = 0; - + int result; + if ( view ) { /* Get the scroll area in NSView coordinates (origin at bottom left). */ bounds = [view bounds]; scrollSrc = NSMakeRect( - macDraw->xOff + x, + macDraw->xOff + x, bounds.size.height - height - (macDraw->yOff + y), width, height); scrollDst = NSOffsetRect(scrollSrc, dx, -dy); - /* Limit scrolling to the window content area. */ visRect = [view visibleRect]; scrollSrc = NSIntersectionRect(scrollSrc, visRect); scrollDst = NSIntersectionRect(scrollDst, visRect); + if ( !NSIsEmptyRect(scrollSrc) && !NSIsEmptyRect(scrollDst) ) { - + /* * Mark the difference between source and destination as damaged. - * This region is described in NSView coordinates (y=0 at the bottom) - * and converted to Tk coordinates later. + * This region is described in the Tk coordinate system. */ - - srcRect = CGRectMake(x, y, width, height); - dstRect = CGRectOffset(srcRect, dx, dy); - - /* Expand the rectangles slightly to avoid degeneracies. */ - srcRect.origin.y -= 1; - srcRect.size.height += 2; - dstRect.origin.y += 1; - dstRect.size.height -= 2; - - /* Compute the damage. */ + + srcRect = CGRectMake(x, y, width, height); + dstRect = CGRectOffset(srcRect, dx, dy); dmgRgn = HIShapeCreateMutableWithRect(&srcRect); extraRgn = HIShapeCreateWithRect(&dstRect); ChkErr(HIShapeDifference, dmgRgn, extraRgn, (HIMutableShapeRef) dmgRgn); - result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; - - /* Convert to Tk coordinates. */ - TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); - if (extraRgn) { - CFRelease(extraRgn); - } - + CFRelease(extraRgn); + /* Scroll the rectangle. */ [view scrollRect:scrollSrc by:NSMakeSize(dx, -dy)]; - - /* Shift the Tk children which meet the source rectangle. */ - TkWindow *winPtr = (TkWindow *)tkwin; - TkWindow *childPtr; - CGRect childBounds; - for (childPtr = winPtr->childList; childPtr != NULL; childPtr = childPtr->nextPtr) { - if (Tk_IsMapped(childPtr) && !Tk_IsTopLevel(childPtr)) { - TkMacOSXWinCGBounds(childPtr, &childBounds); - if (CGRectIntersectsRect(srcRect, childBounds)) { - MacDrawable *macChild = childPtr->privatePtr; - if (macChild) { - macChild->yOff += dy; - macChild->xOff += dx; - childPtr->changes.y = macChild->yOff; - childPtr->changes.x = macChild->xOff; - } - } - } - } - - /* Queue up Expose events for the damage region. */ - int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE); - [view generateExposeEvents:dmgRgn childrenOnly:1]; - Tcl_SetServiceMode(oldMode); - - /* Belt and suspenders: make the AppKit request a redraw - when it gets control again. */ - [view setNeedsDisplay:YES]; } - } else { - dmgRgn = HIShapeCreateEmpty(); - TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); } - - if (dmgRgn) { - CFRelease(dmgRgn); + + if ( dmgRgn == NULL ) { + dmgRgn = HIShapeCreateEmpty(); } + TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); + result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; + CFRelease(dmgRgn); return result; } @@ -1900,7 +1853,6 @@ TkpClipDrawableToRect( CFRelease(macDraw->drawRgn); macDraw->drawRgn = NULL; } - if (width >= 0 && height >= 0) { CGRect clipRect = CGRectMake(x + macDraw->xOff, y + macDraw->yOff, width, height); @@ -2048,7 +2000,7 @@ TkpDrawHighlightBorder ( * TkpDrawFrame -- * * This procedure draws the rectangular frame area. If the user - * has requested themeing, it draws with the background theme. + * has request themeing, it draws with a the background theme. * * Results: * None. @@ -2078,7 +2030,6 @@ TkpDrawFrame( border = themedBorder; } } - Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, highlightWidth, highlightWidth, Tk_Width(tkwin) - 2 * highlightWidth, diff --git a/macosx/tkMacOSXInt.h b/macosx/tkMacOSXInt.h index 6971e26..249d5cf 100644 --- a/macosx/tkMacOSXInt.h +++ b/macosx/tkMacOSXInt.h @@ -86,7 +86,7 @@ typedef struct TkWindowPrivate MacDrawable; #define TK_FOCUSED_VIEW 0x10 #define TK_IS_PIXMAP 0x20 #define TK_IS_BW_PIXMAP 0x40 -#define TK_DO_NOT_DRAW 0x80 + /* * I am reserving TK_EMBEDDED = 0x100 in the MacDrawable flags * This is defined in tk.h. We need to duplicate the TK_EMBEDDED flag in the diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index afa0df8..bc93b79 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -26,7 +26,6 @@ #define RangeToFactor(maximum) (((double) (LONG_MAX >> 1)) / (maximum)) #endif /* __LP64__ */ -#define MOUNTAIN_LION_STYLE (NSAppKitVersionNumber < 1138) /* * Declaration of Mac specific scrollbar structure. @@ -81,6 +80,7 @@ static void ScrollbarEventProc(ClientData clientData, XEvent *eventPtr); static int ScrollbarPress(TkScrollbar *scrollPtr, XEvent *eventPtr); static void UpdateControlValues(TkScrollbar *scrollPtr); + /* *---------------------------------------------------------------------- * @@ -137,6 +137,7 @@ TkpDisplayScrollbar( register TkScrollbar *scrollPtr = (TkScrollbar *) clientData; register Tk_Window tkwin = scrollPtr->tkwin; + if ((scrollPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } @@ -172,6 +173,7 @@ TkpDisplayScrollbar( (Pixmap) macWin); } + Tk_Draw3DRectangle(tkwin, (Pixmap) macWin, scrollPtr->bgBorder, scrollPtr->highlightWidth, scrollPtr->highlightWidth, Tk_Width(tkwin) - 2*scrollPtr->highlightWidth, @@ -184,11 +186,15 @@ TkpDisplayScrollbar( /*Update values and draw in native rect.*/ UpdateControlValues(scrollPtr); - if (MOUNTAIN_LION_STYLE) { - HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationInverted); - } else { +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + if (scrollPtr->vertical) { HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); + } else { + HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationInverted); } +#else + HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); +#endif TkMacOSXRestoreDrawingContext(&dc); scrollPtr->flags &= ~REDRAW_PENDING; @@ -259,12 +265,11 @@ TkpComputeScrollbarGeometry( if (scrollPtr->sliderLast > fieldLength) { scrollPtr->sliderLast = fieldLength; } - if (!(MOUNTAIN_LION_STYLE)) { - scrollPtr->sliderFirst += scrollPtr->inset + + scrollPtr->sliderFirst += scrollPtr->inset + metrics[variant].topArrowHeight; - scrollPtr->sliderLast += scrollPtr->inset + + scrollPtr->sliderLast += scrollPtr->inset + metrics[variant].bottomArrowHeight; - } + /* * Register the desired geometry for the window (leave enough space * for the two arrows plus a minimum-size slider, plus border around @@ -365,29 +370,21 @@ TkpScrollbarPosition( int x, int y) /* Coordinates within scrollPtr's window. */ { - /* - * Using code from tkUnixScrlbr.c because Unix scroll bindings are - * driving the display at the script level. All the Mac scrollbar - * has to do is re-draw itself. - */ - - int length, fieldlength, width, tmp; + /*Using code from tkUnixScrlbr.c because Unix scroll bindings are driving the display at the script level. All the Mac scrollbar has to do is re-draw itself.*/ + + int length, width, tmp; register const int inset = scrollPtr->inset; - register const int arrowSize = scrollPtr->arrowLength + inset; if (scrollPtr->vertical) { length = Tk_Height(scrollPtr->tkwin); - fieldlength = length - 2 * arrowSize; width = Tk_Width(scrollPtr->tkwin); } else { tmp = x; x = y; y = tmp; length = Tk_Width(scrollPtr->tkwin); - fieldlength = length - 2 * arrowSize; width = Tk_Height(scrollPtr->tkwin); } - fieldlength = fieldlength < 0 ? 0 : fieldlength; if (x=width-inset || y=length-inset) { return OUTSIDE; @@ -398,19 +395,19 @@ TkpScrollbarPosition( * TkpDisplayScrollbar. Be sure to keep the two consistent. */ + if (y < inset + scrollPtr->arrowLength) { + return TOP_ARROW; + } if (y < scrollPtr->sliderFirst) { return TOP_GAP; } if (y < scrollPtr->sliderLast) { return SLIDER; } - if (y < fieldlength){ - return BOTTOM_GAP; - } - if (y < fieldlength + arrowSize) { - return TOP_ARROW; + if (y >= length - (scrollPtr->arrowLength + inset)) { + return BOTTOM_ARROW; } - return BOTTOM_ARROW; + return BOTTOM_GAP; } /* @@ -418,11 +415,9 @@ TkpScrollbarPosition( * * UpdateControlValues -- * - * This procedure updates the Macintosh scrollbar control to - * display the values defined by the Tk scrollbar. This is the - * key interface to the Mac-native * scrollbar; the Unix bindings - * drive scrolling in the Tk window and all the Mac scrollbar has - * to do is redraw itself. + * This procedure updates the Macintosh scrollbar control to display the + * values defined by the Tk scrollbar. This is the key interface to the Mac-native * scrollbar; the Unix bindings drive scrolling in the Tk window and all the Mac + * scrollbar has to do is redraw itself. * * Results: * None. @@ -489,11 +484,7 @@ UpdateControlValues( factor - dViewSize; info.trackInfo.scrollbar.viewsize = dViewSize; if (scrollPtr->vertical) { - if (MOUNTAIN_LION_STYLE) { - info.value = factor * scrollPtr->firstFraction; - } else { info.value = info.max - factor * scrollPtr->firstFraction; - } } else { info.value = MIN_SCROLLBAR_VALUE + factor * scrollPtr->firstFraction; } diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 2f500fa..a9703c1 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -657,65 +657,6 @@ XConfigureWindow( /* *---------------------------------------------------------------------- * - * TkMacOSXSetDrawingEnabled -- - * - * This function sets the TK_DO_NOT_DRAW flag for a given window and - * all of its children. - * - * Results: - * None. - * - * Side effects: - * The clipping regions for the window and its children are cleared. - * - *---------------------------------------------------------------------- - */ - -void -TkMacOSXSetDrawingEnabled( - TkWindow *winPtr, - int flag) -{ - TkWindow *childPtr; - MacDrawable *macWin = winPtr->privatePtr; - - if (macWin) { - if (flag ) { - macWin->flags &= ~TK_DO_NOT_DRAW; - } else { - macWin->flags |= TK_DO_NOT_DRAW; - } - } - - /* - * Set the flag for all children & their descendants, excluding - * Toplevels. (??? Do we need to exclude Toplevels?) - */ - - childPtr = winPtr->childList; - while (childPtr) { - if (!Tk_IsTopLevel(childPtr)) { - TkMacOSXSetDrawingEnabled(childPtr, flag); - } - childPtr = childPtr->nextPtr; - } - - /* - * If the window is a container, set the flag for its embedded window. - */ - - if (Tk_IsContainer(winPtr)) { - childPtr = TkpGetOtherWindow(winPtr); - - if (childPtr) { - TkMacOSXSetDrawingEnabled(childPtr, flag); - } - } -} - -/* - *---------------------------------------------------------------------- - * * TkMacOSXUpdateClipRgn -- * * This function updates the clipping regions for a given window and all of diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index d0999d1..d68a933 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -29,7 +29,7 @@ * Declaration of functions used only in this file */ -static int GenerateUpdates(HIShapeRef updateRgn, +static int GenerateUpdates(HIMutableShapeRef updateRgn, CGRect *updateBounds, TkWindow *winPtr); static int GenerateActivateEvents(TkWindow *winPtr, int activeFlag); @@ -316,7 +316,7 @@ extern BOOL opaqueTag; static int GenerateUpdates( - HIShapeRef updateRgn, + HIMutableShapeRef updateRgn, CGRect *updateBounds, TkWindow *winPtr) { @@ -784,8 +784,7 @@ Tk_MacOSXIsAppInFront(void) @interface TKContentView(TKWindowEvent) - (void) drawRect: (NSRect) rect; -- (void) generateExposeEvents: (HIShapeRef) shape; -- (void) generateExposeEvents: (HIShapeRef) shape childrenOnly: (int) childrenOnly; +- (void) generateExposeEvents: (HIMutableShapeRef) shape; - (void) viewDidEndLiveResize; - (void) tkToolbarButton: (id) sender; - (BOOL) isOpaque; @@ -795,8 +794,6 @@ Tk_MacOSXIsAppInFront(void) @end @implementation TKContentView -NSDate *_resizeStart; -NSTimeInterval _resizeDuration; @end /*Restrict event processing to Expose events.*/ @@ -835,7 +832,7 @@ ExposeRestrictProc( HIShapeUnionWithRect(drawShape, &r); } if (CFRunLoopGetMain() == CFRunLoopGetCurrent()) { - [self generateExposeEvents:(HIShapeRef)drawShape]; + [self generateExposeEvents:drawShape]; } else { [self performSelectorOnMainThread:@selector(generateExposeEvents:) withObject:(id)drawShape waitUntilDone:NO @@ -851,33 +848,25 @@ ExposeRestrictProc( -(void) setFrameSize: (NSSize)newsize { if ( [self inLiveResize] ) { - NSWindow *w = [self window]; - TkWindow *winPtr = TkMacOSXGetTkWindow(w); + NSWindow *window = [self window]; + TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); Tk_Window tkwin = (Tk_Window) winPtr; unsigned int width = (unsigned int)newsize.width; unsigned int height=(unsigned int)newsize.height; - /* Resize the NSView */ + /* Resize the Tk Window to the requested size.*/ + TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height, + TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY); + + /* Then resize the NSView to the actual window size*/ + newsize.width = (CGFloat)Tk_Width(tkwin); + newsize.height = (CGFloat)Tk_Height(tkwin); [super setFrameSize: newsize]; - /* Disable drawing until the window has been completely configured.*/ - TkMacOSXSetDrawingEnabled(winPtr, 0); + /* Process all pending events to update the window. */ + while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {} + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} - /* Generate and handle a ConfigureNotify event for the new size.*/ - TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height, - TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY); - while ( Tk_DoOneEvent(TK_X_EVENTS|TK_DONT_WAIT) ) {} - - /* Now that Tk has configured all subwindows we can create the clip regions. */ - TkMacOSXSetDrawingEnabled(winPtr, 1); - TkMacOSXInvalClipRgns(tkwin); - TkMacOSXUpdateClipRgn(winPtr); - - /* Finally, generate and process expose events to redraw the window. */ - HIRect bounds = NSRectToCGRect([self bounds]); - HIShapeRef shape = HIShapeCreateWithRect(&bounds); - [self generateExposeEvents: shape]; - while ( Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT) ) {} } else { [super setFrameSize: newsize]; } @@ -897,44 +886,48 @@ ExposeRestrictProc( } -/* Core method of this class: generates expose events for redrawing. - * Whereas drawRect is intended to be called only from the Appkit event - * loop, this can be called from Tk. If the Tcl_ServiceMode is set to - * TCL_SERVICE_ALL then the expose events will be immediately removed - * from the Tcl event loop and processed. Typically, they should be queued, - * however. - */ -- (void) generateExposeEvents: (HIShapeRef) shape -{ - [self generateExposeEvents:shape childrenOnly:0]; -} -- (void) generateExposeEvents: (HIShapeRef) shape - childrenOnly: (int) childrenOnly +/*Core function of this class, generates expose events for redrawing.*/ +- (void) generateExposeEvents: (HIMutableShapeRef) shape { + TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); unsigned long serial; CGRect updateBounds; - int updatesNeeded; if (!winPtr) { return; } - /* Generate Tk Expose events. */ HIShapeGetBounds(shape, &updateBounds); - /* All of these events will share the same serial number. */ serial = LastKnownRequestProcessed(Tk_Display(winPtr)); - updatesNeeded = GenerateUpdates(shape, &updateBounds, winPtr); - - /* Process the Expose events if the service mode is TCL_SERVICE_ALL */ - if (updatesNeeded && Tcl_GetServiceMode() == TCL_SERVICE_ALL) { - ClientData oldArg; + if (GenerateUpdates(shape, &updateBounds, winPtr) && + ![[NSRunLoop currentRunLoop] currentMode] && + Tcl_GetServiceMode() != TCL_SERVICE_NONE) { + /* + * Ensure there are no pending idle-time redraws that could + * prevent the just posted Expose events from generating + * new redraws. + */ + + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} + + /* + * For smoother drawing, process Expose events and resulting + * redraws immediately instead of at idle time. + */ + + ClientData oldArg; Tk_RestrictProc *oldProc = Tk_RestrictEvents(ExposeRestrictProc, UINT2PTR(serial), &oldArg); + while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {} + Tk_RestrictEvents(oldProc, oldArg, &oldArg); + + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} } + } /* @@ -950,6 +943,7 @@ ExposeRestrictProc( int x, y; TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); Tk_Window tkwin = (Tk_Window) winPtr; + bzero(&event, sizeof(XVirtualEvent)); event.type = VirtualEvent; event.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); -- cgit v0.12 From 4610c49d14dca5fccf40ec756596ce6258821130 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 7 Apr 2015 20:12:59 +0000 Subject: Fix wordstart modifier for UTF-8 text - Bug [562118ce41] --- generic/tkTextIndex.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index 13f3957..7cb71bb 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -2369,11 +2369,20 @@ StartEnd( } firstChar = 0; } - offset -= chSize; - indexPtr->byteIndex -= chSize; + if (offset == 0) { + if (modifier == TKINDEX_DISPLAY) { + TkTextIndexBackChars(textPtr, indexPtr, 1, indexPtr, + COUNT_DISPLAY_INDICES); + } else { + TkTextIndexBackChars(NULL, indexPtr, 1, indexPtr, + COUNT_INDICES); + } + } else { + indexPtr->byteIndex -= chSize; + } + offset -= chSize; if (offset < 0) { - if (indexPtr->byteIndex < 0) { - indexPtr->byteIndex = 0; + if (indexPtr->byteIndex == 0) { goto done; } segPtr = TkTextIndexToSeg(indexPtr, &offset); -- cgit v0.12 From d9cdbff3a06fecca2a07844fd0bd43fbfe6b85fb Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 7 Apr 2015 20:14:18 +0000 Subject: Fix typo in comment --- generic/tkTextIndex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index 7cb71bb..35ed143 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -2218,7 +2218,7 @@ StartEnd( TkText *textPtr, /* Information about text widget. */ CONST char *string, /* String to parse for additional info about * modifier (count and units). Points to first - * character of modifer word. */ + * character of modifier word. */ TkTextIndex *indexPtr) /* Index to modify based on string. */ { CONST char *p; -- cgit v0.12 From f801eafc556ad7c6648d5da223a6563c99b998ca Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 8 Apr 2015 12:20:17 +0000 Subject: Repair mangled stubs header file. --- generic/tkIntPlatDecls.h | 1220 ---------------------------------------------- 1 file changed, 1220 deletions(-) diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 8bc1815..b377173 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -1218,1224 +1218,4 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; #define TkpSync(display) #endif -#endif /* _TKINTPLATDECLS *//* - * tkIntPlatDecls.h -- - * - * This file contains the declarations for all platform dependent - * unsupported functions that are exported by the Tk library. These - * interfaces are not guaranteed to remain the same between - * versions. Use at your own risk. - * - * Copyright (c) 1998-1999 by Scriptics Corporation. - * All rights reserved. - */ - -#ifndef _TKINTPLATDECLS -#define _TKINTPLATDECLS - -#ifdef BUILD_tk -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLEXPORT -#endif - -/* - * WARNING: This file is automatically generated by the tools/genStubs.tcl - * script. Any modifications to the function declarations below should be made - * in the generic/tkInt.decls script. - */ - -/* !BEGIN!: Do not edit below this line. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Exported function declarations: - */ - -#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ -#ifndef TkAlignImageData_TCL_DECLARED -#define TkAlignImageData_TCL_DECLARED -/* 0 */ -EXTERN char * TkAlignImageData(XImage *image, int alignment, - int bitOrder); -#endif -/* Slot 1 is reserved */ -#ifndef TkGenerateActivateEvents_TCL_DECLARED -#define TkGenerateActivateEvents_TCL_DECLARED -/* 2 */ -EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, - int active); -#endif -#ifndef TkpGetMS_TCL_DECLARED -#define TkpGetMS_TCL_DECLARED -/* 3 */ -EXTERN unsigned long TkpGetMS(void); -#endif -#ifndef TkPointerDeadWindow_TCL_DECLARED -#define TkPointerDeadWindow_TCL_DECLARED -/* 4 */ -EXTERN void TkPointerDeadWindow(TkWindow *winPtr); -#endif -#ifndef TkpPrintWindowId_TCL_DECLARED -#define TkpPrintWindowId_TCL_DECLARED -/* 5 */ -EXTERN void TkpPrintWindowId(char *buf, Window window); -#endif -#ifndef TkpScanWindowId_TCL_DECLARED -#define TkpScanWindowId_TCL_DECLARED -/* 6 */ -EXTERN int TkpScanWindowId(Tcl_Interp *interp, - CONST char *string, Window *idPtr); -#endif -#ifndef TkpSetCapture_TCL_DECLARED -#define TkpSetCapture_TCL_DECLARED -/* 7 */ -EXTERN void TkpSetCapture(TkWindow *winPtr); -#endif -#ifndef TkpSetCursor_TCL_DECLARED -#define TkpSetCursor_TCL_DECLARED -/* 8 */ -EXTERN void TkpSetCursor(TkpCursor cursor); -#endif -#ifndef TkpWmSetState_TCL_DECLARED -#define TkpWmSetState_TCL_DECLARED -/* 9 */ -EXTERN int TkpWmSetState(TkWindow *winPtr, int state); -#endif -#ifndef TkSetPixmapColormap_TCL_DECLARED -#define TkSetPixmapColormap_TCL_DECLARED -/* 10 */ -EXTERN void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap); -#endif -#ifndef TkWinCancelMouseTimer_TCL_DECLARED -#define TkWinCancelMouseTimer_TCL_DECLARED -/* 11 */ -EXTERN void TkWinCancelMouseTimer(void); -#endif -#ifndef TkWinClipboardRender_TCL_DECLARED -#define TkWinClipboardRender_TCL_DECLARED -/* 12 */ -EXTERN void TkWinClipboardRender(TkDisplay *dispPtr, UINT format); -#endif -#ifndef TkWinEmbeddedEventProc_TCL_DECLARED -#define TkWinEmbeddedEventProc_TCL_DECLARED -/* 13 */ -EXTERN LRESULT TkWinEmbeddedEventProc(HWND hwnd, UINT message, - WPARAM wParam, LPARAM lParam); -#endif -#ifndef TkWinFillRect_TCL_DECLARED -#define TkWinFillRect_TCL_DECLARED -/* 14 */ -EXTERN void TkWinFillRect(HDC dc, int x, int y, int width, - int height, int pixel); -#endif -#ifndef TkWinGetBorderPixels_TCL_DECLARED -#define TkWinGetBorderPixels_TCL_DECLARED -/* 15 */ -EXTERN COLORREF TkWinGetBorderPixels(Tk_Window tkwin, - Tk_3DBorder border, int which); -#endif -#ifndef TkWinGetDrawableDC_TCL_DECLARED -#define TkWinGetDrawableDC_TCL_DECLARED -/* 16 */ -EXTERN HDC TkWinGetDrawableDC(Display *display, Drawable d, - TkWinDCState *state); -#endif -#ifndef TkWinGetModifierState_TCL_DECLARED -#define TkWinGetModifierState_TCL_DECLARED -/* 17 */ -EXTERN int TkWinGetModifierState(void); -#endif -#ifndef TkWinGetSystemPalette_TCL_DECLARED -#define TkWinGetSystemPalette_TCL_DECLARED -/* 18 */ -EXTERN HPALETTE TkWinGetSystemPalette(void); -#endif -#ifndef TkWinGetWrapperWindow_TCL_DECLARED -#define TkWinGetWrapperWindow_TCL_DECLARED -/* 19 */ -EXTERN HWND TkWinGetWrapperWindow(Tk_Window tkwin); -#endif -#ifndef TkWinHandleMenuEvent_TCL_DECLARED -#define TkWinHandleMenuEvent_TCL_DECLARED -/* 20 */ -EXTERN int TkWinHandleMenuEvent(HWND *phwnd, UINT *pMessage, - WPARAM *pwParam, LPARAM *plParam, - LRESULT *plResult); -#endif -#ifndef TkWinIndexOfColor_TCL_DECLARED -#define TkWinIndexOfColor_TCL_DECLARED -/* 21 */ -EXTERN int TkWinIndexOfColor(XColor *colorPtr); -#endif -#ifndef TkWinReleaseDrawableDC_TCL_DECLARED -#define TkWinReleaseDrawableDC_TCL_DECLARED -/* 22 */ -EXTERN void TkWinReleaseDrawableDC(Drawable d, HDC hdc, - TkWinDCState *state); -#endif -#ifndef TkWinResendEvent_TCL_DECLARED -#define TkWinResendEvent_TCL_DECLARED -/* 23 */ -EXTERN LRESULT TkWinResendEvent(WNDPROC wndproc, HWND hwnd, - XEvent *eventPtr); -#endif -#ifndef TkWinSelectPalette_TCL_DECLARED -#define TkWinSelectPalette_TCL_DECLARED -/* 24 */ -EXTERN HPALETTE TkWinSelectPalette(HDC dc, Colormap colormap); -#endif -#ifndef TkWinSetMenu_TCL_DECLARED -#define TkWinSetMenu_TCL_DECLARED -/* 25 */ -EXTERN void TkWinSetMenu(Tk_Window tkwin, HMENU hMenu); -#endif -#ifndef TkWinSetWindowPos_TCL_DECLARED -#define TkWinSetWindowPos_TCL_DECLARED -/* 26 */ -EXTERN void TkWinSetWindowPos(HWND hwnd, HWND siblingHwnd, - int pos); -#endif -#ifndef TkWinWmCleanup_TCL_DECLARED -#define TkWinWmCleanup_TCL_DECLARED -/* 27 */ -EXTERN void TkWinWmCleanup(HINSTANCE hInstance); -#endif -#ifndef TkWinXCleanup_TCL_DECLARED -#define TkWinXCleanup_TCL_DECLARED -/* 28 */ -EXTERN void TkWinXCleanup(ClientData clientData); -#endif -#ifndef TkWinXInit_TCL_DECLARED -#define TkWinXInit_TCL_DECLARED -/* 29 */ -EXTERN void TkWinXInit(HINSTANCE hInstance); -#endif -#ifndef TkWinSetForegroundWindow_TCL_DECLARED -#define TkWinSetForegroundWindow_TCL_DECLARED -/* 30 */ -EXTERN void TkWinSetForegroundWindow(TkWindow *winPtr); -#endif -#ifndef TkWinDialogDebug_TCL_DECLARED -#define TkWinDialogDebug_TCL_DECLARED -/* 31 */ -EXTERN void TkWinDialogDebug(int debug); -#endif -#ifndef TkWinGetMenuSystemDefault_TCL_DECLARED -#define TkWinGetMenuSystemDefault_TCL_DECLARED -/* 32 */ -EXTERN Tcl_Obj * TkWinGetMenuSystemDefault(Tk_Window tkwin, - CONST char *dbName, CONST char *className); -#endif -#ifndef TkWinGetPlatformId_TCL_DECLARED -#define TkWinGetPlatformId_TCL_DECLARED -/* 33 */ -EXTERN int TkWinGetPlatformId(void); -#endif -#ifndef TkWinSetHINSTANCE_TCL_DECLARED -#define TkWinSetHINSTANCE_TCL_DECLARED -/* 34 */ -EXTERN void TkWinSetHINSTANCE(HINSTANCE hInstance); -#endif -#ifndef TkWinGetPlatformTheme_TCL_DECLARED -#define TkWinGetPlatformTheme_TCL_DECLARED -/* 35 */ -EXTERN int TkWinGetPlatformTheme(void); -#endif -#ifndef TkWinChildProc_TCL_DECLARED -#define TkWinChildProc_TCL_DECLARED -/* 36 */ -EXTERN LRESULT __stdcall TkWinChildProc(HWND hwnd, UINT message, - WPARAM wParam, LPARAM lParam); -#endif -#ifndef TkCreateXEventSource_TCL_DECLARED -#define TkCreateXEventSource_TCL_DECLARED -/* 37 */ -EXTERN void TkCreateXEventSource(void); -#endif -#ifndef TkpCmapStressed_TCL_DECLARED -#define TkpCmapStressed_TCL_DECLARED -/* 38 */ -EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); -#endif -#ifndef TkpSync_TCL_DECLARED -#define TkpSync_TCL_DECLARED -/* 39 */ -EXTERN void TkpSync(Display *display); -#endif -#ifndef TkUnixContainerId_TCL_DECLARED -#define TkUnixContainerId_TCL_DECLARED -/* 40 */ -EXTERN Window TkUnixContainerId(TkWindow *winPtr); -#endif -#ifndef TkUnixDoOneXEvent_TCL_DECLARED -#define TkUnixDoOneXEvent_TCL_DECLARED -/* 41 */ -EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); -#endif -#ifndef TkUnixSetMenubar_TCL_DECLARED -#define TkUnixSetMenubar_TCL_DECLARED -/* 42 */ -EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); -#endif -#ifndef TkWmCleanup_TCL_DECLARED -#define TkWmCleanup_TCL_DECLARED -/* 43 */ -EXTERN void TkWmCleanup(TkDisplay *dispPtr); -#endif -#ifndef TkSendCleanup_TCL_DECLARED -#define TkSendCleanup_TCL_DECLARED -/* 44 */ -EXTERN void TkSendCleanup(TkDisplay *dispPtr); -#endif -#ifndef TkpTestsendCmd_TCL_DECLARED -#define TkpTestsendCmd_TCL_DECLARED -/* 45 */ -EXTERN int TkpTestsendCmd(ClientData clientData, - Tcl_Interp *interp, int argc, - CONST char **argv); -#endif -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ -#ifndef TkGenerateActivateEvents_TCL_DECLARED -#define TkGenerateActivateEvents_TCL_DECLARED -/* 0 */ -EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, - int active); -#endif -/* Slot 1 is reserved */ -/* Slot 2 is reserved */ -#ifndef TkPointerDeadWindow_TCL_DECLARED -#define TkPointerDeadWindow_TCL_DECLARED -/* 3 */ -EXTERN void TkPointerDeadWindow(TkWindow *winPtr); -#endif -#ifndef TkpSetCapture_TCL_DECLARED -#define TkpSetCapture_TCL_DECLARED -/* 4 */ -EXTERN void TkpSetCapture(TkWindow *winPtr); -#endif -#ifndef TkpSetCursor_TCL_DECLARED -#define TkpSetCursor_TCL_DECLARED -/* 5 */ -EXTERN void TkpSetCursor(TkpCursor cursor); -#endif -#ifndef TkpWmSetState_TCL_DECLARED -#define TkpWmSetState_TCL_DECLARED -/* 6 */ -EXTERN void TkpWmSetState(TkWindow *winPtr, int state); -#endif -#ifndef TkAboutDlg_TCL_DECLARED -#define TkAboutDlg_TCL_DECLARED -/* 7 */ -EXTERN void TkAboutDlg(void); -#endif -#ifndef TkMacOSXButtonKeyState_TCL_DECLARED -#define TkMacOSXButtonKeyState_TCL_DECLARED -/* 8 */ -EXTERN unsigned int TkMacOSXButtonKeyState(void); -#endif -#ifndef TkMacOSXClearMenubarActive_TCL_DECLARED -#define TkMacOSXClearMenubarActive_TCL_DECLARED -/* 9 */ -EXTERN void TkMacOSXClearMenubarActive(void); -#endif -#ifndef TkMacOSXDispatchMenuEvent_TCL_DECLARED -#define TkMacOSXDispatchMenuEvent_TCL_DECLARED -/* 10 */ -EXTERN int TkMacOSXDispatchMenuEvent(int menuID, int index); -#endif -#ifndef TkMacOSXInstallCursor_TCL_DECLARED -#define TkMacOSXInstallCursor_TCL_DECLARED -/* 11 */ -EXTERN void TkMacOSXInstallCursor(int resizeOverride); -#endif -#ifndef TkMacOSXHandleTearoffMenu_TCL_DECLARED -#define TkMacOSXHandleTearoffMenu_TCL_DECLARED -/* 12 */ -EXTERN void TkMacOSXHandleTearoffMenu(void); -#endif -/* Slot 13 is reserved */ -#ifndef TkMacOSXDoHLEvent_TCL_DECLARED -#define TkMacOSXDoHLEvent_TCL_DECLARED -/* 14 */ -EXTERN int TkMacOSXDoHLEvent(VOID *theEvent); -#endif -/* Slot 15 is reserved */ -#ifndef TkMacOSXGetXWindow_TCL_DECLARED -#define TkMacOSXGetXWindow_TCL_DECLARED -/* 16 */ -EXTERN Window TkMacOSXGetXWindow(VOID *macWinPtr); -#endif -#ifndef TkMacOSXGrowToplevel_TCL_DECLARED -#define TkMacOSXGrowToplevel_TCL_DECLARED -/* 17 */ -EXTERN int TkMacOSXGrowToplevel(VOID *whichWindow, XPoint start); -#endif -#ifndef TkMacOSXHandleMenuSelect_TCL_DECLARED -#define TkMacOSXHandleMenuSelect_TCL_DECLARED -/* 18 */ -EXTERN void TkMacOSXHandleMenuSelect(short theMenu, - unsigned short theItem, int optionKeyPressed); -#endif -/* Slot 19 is reserved */ -/* Slot 20 is reserved */ -#ifndef TkMacOSXInvalidateWindow_TCL_DECLARED -#define TkMacOSXInvalidateWindow_TCL_DECLARED -/* 21 */ -EXTERN void TkMacOSXInvalidateWindow(MacDrawable *macWin, - int flag); -#endif -#ifndef TkMacOSXIsCharacterMissing_TCL_DECLARED -#define TkMacOSXIsCharacterMissing_TCL_DECLARED -/* 22 */ -EXTERN int TkMacOSXIsCharacterMissing(Tk_Font tkfont, - unsigned int searchChar); -#endif -#ifndef TkMacOSXMakeRealWindowExist_TCL_DECLARED -#define TkMacOSXMakeRealWindowExist_TCL_DECLARED -/* 23 */ -EXTERN void TkMacOSXMakeRealWindowExist(TkWindow *winPtr); -#endif -#ifndef TkMacOSXMakeStippleMap_TCL_DECLARED -#define TkMacOSXMakeStippleMap_TCL_DECLARED -/* 24 */ -EXTERN VOID * TkMacOSXMakeStippleMap(Drawable d1, Drawable d2); -#endif -#ifndef TkMacOSXMenuClick_TCL_DECLARED -#define TkMacOSXMenuClick_TCL_DECLARED -/* 25 */ -EXTERN void TkMacOSXMenuClick(void); -#endif -#ifndef TkMacOSXRegisterOffScreenWindow_TCL_DECLARED -#define TkMacOSXRegisterOffScreenWindow_TCL_DECLARED -/* 26 */ -EXTERN void TkMacOSXRegisterOffScreenWindow(Window window, - VOID *portPtr); -#endif -#ifndef TkMacOSXResizable_TCL_DECLARED -#define TkMacOSXResizable_TCL_DECLARED -/* 27 */ -EXTERN int TkMacOSXResizable(TkWindow *winPtr); -#endif -#ifndef TkMacOSXSetHelpMenuItemCount_TCL_DECLARED -#define TkMacOSXSetHelpMenuItemCount_TCL_DECLARED -/* 28 */ -EXTERN void TkMacOSXSetHelpMenuItemCount(void); -#endif -#ifndef TkMacOSXSetScrollbarGrow_TCL_DECLARED -#define TkMacOSXSetScrollbarGrow_TCL_DECLARED -/* 29 */ -EXTERN void TkMacOSXSetScrollbarGrow(TkWindow *winPtr, int flag); -#endif -#ifndef TkMacOSXSetUpClippingRgn_TCL_DECLARED -#define TkMacOSXSetUpClippingRgn_TCL_DECLARED -/* 30 */ -EXTERN void TkMacOSXSetUpClippingRgn(Drawable drawable); -#endif -#ifndef TkMacOSXSetUpGraphicsPort_TCL_DECLARED -#define TkMacOSXSetUpGraphicsPort_TCL_DECLARED -/* 31 */ -EXTERN void TkMacOSXSetUpGraphicsPort(GC gc, VOID *destPort); -#endif -#ifndef TkMacOSXUpdateClipRgn_TCL_DECLARED -#define TkMacOSXUpdateClipRgn_TCL_DECLARED -/* 32 */ -EXTERN void TkMacOSXUpdateClipRgn(TkWindow *winPtr); -#endif -#ifndef TkMacOSXUnregisterMacWindow_TCL_DECLARED -#define TkMacOSXUnregisterMacWindow_TCL_DECLARED -/* 33 */ -EXTERN void TkMacOSXUnregisterMacWindow(VOID *portPtr); -#endif -#ifndef TkMacOSXUseMenuID_TCL_DECLARED -#define TkMacOSXUseMenuID_TCL_DECLARED -/* 34 */ -EXTERN int TkMacOSXUseMenuID(short macID); -#endif -#ifndef TkMacOSXVisableClipRgn_TCL_DECLARED -#define TkMacOSXVisableClipRgn_TCL_DECLARED -/* 35 */ -EXTERN TkRegion TkMacOSXVisableClipRgn(TkWindow *winPtr); -#endif -#ifndef TkMacOSXWinBounds_TCL_DECLARED -#define TkMacOSXWinBounds_TCL_DECLARED -/* 36 */ -EXTERN void TkMacOSXWinBounds(TkWindow *winPtr, VOID *geometry); -#endif -#ifndef TkMacOSXWindowOffset_TCL_DECLARED -#define TkMacOSXWindowOffset_TCL_DECLARED -/* 37 */ -EXTERN void TkMacOSXWindowOffset(VOID *wRef, int *xOffset, - int *yOffset); -#endif -#ifndef TkSetMacColor_TCL_DECLARED -#define TkSetMacColor_TCL_DECLARED -/* 38 */ -EXTERN int TkSetMacColor(unsigned long pixel, VOID *macColor); -#endif -#ifndef TkSetWMName_TCL_DECLARED -#define TkSetWMName_TCL_DECLARED -/* 39 */ -EXTERN void TkSetWMName(TkWindow *winPtr, Tk_Uid titleUid); -#endif -#ifndef TkSuspendClipboard_TCL_DECLARED -#define TkSuspendClipboard_TCL_DECLARED -/* 40 */ -EXTERN void TkSuspendClipboard(void); -#endif -#ifndef TkMacOSXZoomToplevel_TCL_DECLARED -#define TkMacOSXZoomToplevel_TCL_DECLARED -/* 41 */ -EXTERN int TkMacOSXZoomToplevel(VOID *whichWindow, - short zoomPart); -#endif -#ifndef Tk_TopCoordsToWindow_TCL_DECLARED -#define Tk_TopCoordsToWindow_TCL_DECLARED -/* 42 */ -EXTERN Tk_Window Tk_TopCoordsToWindow(Tk_Window tkwin, int rootX, - int rootY, int *newX, int *newY); -#endif -#ifndef TkMacOSXContainerId_TCL_DECLARED -#define TkMacOSXContainerId_TCL_DECLARED -/* 43 */ -EXTERN MacDrawable * TkMacOSXContainerId(TkWindow *winPtr); -#endif -#ifndef TkMacOSXGetHostToplevel_TCL_DECLARED -#define TkMacOSXGetHostToplevel_TCL_DECLARED -/* 44 */ -EXTERN MacDrawable * TkMacOSXGetHostToplevel(TkWindow *winPtr); -#endif -#ifndef TkMacOSXPreprocessMenu_TCL_DECLARED -#define TkMacOSXPreprocessMenu_TCL_DECLARED -/* 45 */ -EXTERN void TkMacOSXPreprocessMenu(void); -#endif -#ifndef TkpIsWindowFloating_TCL_DECLARED -#define TkpIsWindowFloating_TCL_DECLARED -/* 46 */ -EXTERN int TkpIsWindowFloating(VOID *window); -#endif -#ifndef TkMacOSXGetCapture_TCL_DECLARED -#define TkMacOSXGetCapture_TCL_DECLARED -/* 47 */ -EXTERN Tk_Window TkMacOSXGetCapture(void); -#endif -/* Slot 48 is reserved */ -#ifndef TkGetTransientMaster_TCL_DECLARED -#define TkGetTransientMaster_TCL_DECLARED -/* 49 */ -EXTERN Window TkGetTransientMaster(TkWindow *winPtr); -#endif -#ifndef TkGenerateButtonEvent_TCL_DECLARED -#define TkGenerateButtonEvent_TCL_DECLARED -/* 50 */ -EXTERN int TkGenerateButtonEvent(int x, int y, Window window, - unsigned int state); -#endif -#ifndef TkGenWMDestroyEvent_TCL_DECLARED -#define TkGenWMDestroyEvent_TCL_DECLARED -/* 51 */ -EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); -#endif -/* Slot 52 is reserved */ -#ifndef TkpGetMS_TCL_DECLARED -#define TkpGetMS_TCL_DECLARED -/* 53 */ -EXTERN unsigned long TkpGetMS(void); -#endif -#ifndef TkMacOSXDrawable_TCL_DECLARED -#define TkMacOSXDrawable_TCL_DECLARED -/* 54 */ -EXTERN VOID * TkMacOSXDrawable(Drawable drawable); -#endif -#ifndef TkpScanWindowId_TCL_DECLARED -#define TkpScanWindowId_TCL_DECLARED -/* 55 */ -EXTERN int TkpScanWindowId(Tcl_Interp *interp, - CONST char *string, Window *idPtr); -#endif -#endif /* AQUA */ -#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ -#ifndef TkCreateXEventSource_TCL_DECLARED -#define TkCreateXEventSource_TCL_DECLARED -/* 0 */ -EXTERN void TkCreateXEventSource(void); -#endif -#ifndef TkFreeWindowId_TCL_DECLARED -#define TkFreeWindowId_TCL_DECLARED -/* 1 */ -EXTERN void TkFreeWindowId(TkDisplay *dispPtr, Window w); -#endif -#ifndef TkInitXId_TCL_DECLARED -#define TkInitXId_TCL_DECLARED -/* 2 */ -EXTERN void TkInitXId(TkDisplay *dispPtr); -#endif -#ifndef TkpCmapStressed_TCL_DECLARED -#define TkpCmapStressed_TCL_DECLARED -/* 3 */ -EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); -#endif -#ifndef TkpSync_TCL_DECLARED -#define TkpSync_TCL_DECLARED -/* 4 */ -EXTERN void TkpSync(Display *display); -#endif -#ifndef TkUnixContainerId_TCL_DECLARED -#define TkUnixContainerId_TCL_DECLARED -/* 5 */ -EXTERN Window TkUnixContainerId(TkWindow *winPtr); -#endif -#ifndef TkUnixDoOneXEvent_TCL_DECLARED -#define TkUnixDoOneXEvent_TCL_DECLARED -/* 6 */ -EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); -#endif -#ifndef TkUnixSetMenubar_TCL_DECLARED -#define TkUnixSetMenubar_TCL_DECLARED -/* 7 */ -EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); -#endif -#ifndef TkpScanWindowId_TCL_DECLARED -#define TkpScanWindowId_TCL_DECLARED -/* 8 */ -EXTERN int TkpScanWindowId(Tcl_Interp *interp, - CONST char *string, Window *idPtr); -#endif -#ifndef TkWmCleanup_TCL_DECLARED -#define TkWmCleanup_TCL_DECLARED -/* 9 */ -EXTERN void TkWmCleanup(TkDisplay *dispPtr); -#endif -#ifndef TkSendCleanup_TCL_DECLARED -#define TkSendCleanup_TCL_DECLARED -/* 10 */ -EXTERN void TkSendCleanup(TkDisplay *dispPtr); -#endif -#ifndef TkFreeXId_TCL_DECLARED -#define TkFreeXId_TCL_DECLARED -/* 11 */ -EXTERN void TkFreeXId(TkDisplay *dispPtr); -#endif -#ifndef TkpWmSetState_TCL_DECLARED -#define TkpWmSetState_TCL_DECLARED -/* 12 */ -EXTERN int TkpWmSetState(TkWindow *winPtr, int state); -#endif -#ifndef TkpTestsendCmd_TCL_DECLARED -#define TkpTestsendCmd_TCL_DECLARED -/* 13 */ -EXTERN int TkpTestsendCmd(ClientData clientData, - Tcl_Interp *interp, int argc, - CONST char **argv); -#endif -#endif /* X11 */ - -typedef struct TkIntPlatStubs { - int magic; - struct TkIntPlatStubHooks *hooks; - -#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ - char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 0 */ - VOID *reserved1; - void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ - unsigned long (*tkpGetMS) (void); /* 3 */ - void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 4 */ - void (*tkpPrintWindowId) (char *buf, Window window); /* 5 */ - int (*tkpScanWindowId) (Tcl_Interp *interp, CONST char *string, Window *idPtr); /* 6 */ - void (*tkpSetCapture) (TkWindow *winPtr); /* 7 */ - void (*tkpSetCursor) (TkpCursor cursor); /* 8 */ - int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */ - void (*tkSetPixmapColormap) (Pixmap pixmap, Colormap colormap); /* 10 */ - void (*tkWinCancelMouseTimer) (void); /* 11 */ - void (*tkWinClipboardRender) (TkDisplay *dispPtr, UINT format); /* 12 */ - LRESULT (*tkWinEmbeddedEventProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 13 */ - void (*tkWinFillRect) (HDC dc, int x, int y, int width, int height, int pixel); /* 14 */ - COLORREF (*tkWinGetBorderPixels) (Tk_Window tkwin, Tk_3DBorder border, int which); /* 15 */ - HDC (*tkWinGetDrawableDC) (Display *display, Drawable d, TkWinDCState *state); /* 16 */ - int (*tkWinGetModifierState) (void); /* 17 */ - HPALETTE (*tkWinGetSystemPalette) (void); /* 18 */ - HWND (*tkWinGetWrapperWindow) (Tk_Window tkwin); /* 19 */ - int (*tkWinHandleMenuEvent) (HWND *phwnd, UINT *pMessage, WPARAM *pwParam, LPARAM *plParam, LRESULT *plResult); /* 20 */ - int (*tkWinIndexOfColor) (XColor *colorPtr); /* 21 */ - void (*tkWinReleaseDrawableDC) (Drawable d, HDC hdc, TkWinDCState *state); /* 22 */ - LRESULT (*tkWinResendEvent) (WNDPROC wndproc, HWND hwnd, XEvent *eventPtr); /* 23 */ - HPALETTE (*tkWinSelectPalette) (HDC dc, Colormap colormap); /* 24 */ - void (*tkWinSetMenu) (Tk_Window tkwin, HMENU hMenu); /* 25 */ - void (*tkWinSetWindowPos) (HWND hwnd, HWND siblingHwnd, int pos); /* 26 */ - void (*tkWinWmCleanup) (HINSTANCE hInstance); /* 27 */ - void (*tkWinXCleanup) (ClientData clientData); /* 28 */ - void (*tkWinXInit) (HINSTANCE hInstance); /* 29 */ - void (*tkWinSetForegroundWindow) (TkWindow *winPtr); /* 30 */ - void (*tkWinDialogDebug) (int debug); /* 31 */ - Tcl_Obj * (*tkWinGetMenuSystemDefault) (Tk_Window tkwin, CONST char *dbName, CONST char *className); /* 32 */ - int (*tkWinGetPlatformId) (void); /* 33 */ - void (*tkWinSetHINSTANCE) (HINSTANCE hInstance); /* 34 */ - int (*tkWinGetPlatformTheme) (void); /* 35 */ - LRESULT (__stdcall *tkWinChildProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 36 */ - void (*tkCreateXEventSource) (void); /* 37 */ - int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 38 */ - void (*tkpSync) (Display *display); /* 39 */ - Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */ - int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 41 */ - void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ - void (*tkWmCleanup) (TkDisplay *dispPtr); /* 43 */ - void (*tkSendCleanup) (TkDisplay *dispPtr); /* 44 */ - int (*tkpTestsendCmd) (ClientData clientData, Tcl_Interp *interp, int argc, CONST char **argv); /* 45 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 0 */ - VOID *reserved1; - VOID *reserved2; - void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 3 */ - void (*tkpSetCapture) (TkWindow *winPtr); /* 4 */ - void (*tkpSetCursor) (TkpCursor cursor); /* 5 */ - void (*tkpWmSetState) (TkWindow *winPtr, int state); /* 6 */ - void (*tkAboutDlg) (void); /* 7 */ - unsigned int (*tkMacOSXButtonKeyState) (void); /* 8 */ - void (*tkMacOSXClearMenubarActive) (void); /* 9 */ - int (*tkMacOSXDispatchMenuEvent) (int menuID, int index); /* 10 */ - void (*tkMacOSXInstallCursor) (int resizeOverride); /* 11 */ - void (*tkMacOSXHandleTearoffMenu) (void); /* 12 */ - VOID *reserved13; - int (*tkMacOSXDoHLEvent) (VOID *theEvent); /* 14 */ - VOID *reserved15; - Window (*tkMacOSXGetXWindow) (VOID *macWinPtr); /* 16 */ - int (*tkMacOSXGrowToplevel) (VOID *whichWindow, XPoint start); /* 17 */ - void (*tkMacOSXHandleMenuSelect) (short theMenu, unsigned short theItem, int optionKeyPressed); /* 18 */ - VOID *reserved19; - VOID *reserved20; - void (*tkMacOSXInvalidateWindow) (MacDrawable *macWin, int flag); /* 21 */ - int (*tkMacOSXIsCharacterMissing) (Tk_Font tkfont, unsigned int searchChar); /* 22 */ - void (*tkMacOSXMakeRealWindowExist) (TkWindow *winPtr); /* 23 */ - VOID * (*tkMacOSXMakeStippleMap) (Drawable d1, Drawable d2); /* 24 */ - void (*tkMacOSXMenuClick) (void); /* 25 */ - void (*tkMacOSXRegisterOffScreenWindow) (Window window, VOID *portPtr); /* 26 */ - int (*tkMacOSXResizable) (TkWindow *winPtr); /* 27 */ - void (*tkMacOSXSetHelpMenuItemCount) (void); /* 28 */ - void (*tkMacOSXSetScrollbarGrow) (TkWindow *winPtr, int flag); /* 29 */ - void (*tkMacOSXSetUpClippingRgn) (Drawable drawable); /* 30 */ - void (*tkMacOSXSetUpGraphicsPort) (GC gc, VOID *destPort); /* 31 */ - void (*tkMacOSXUpdateClipRgn) (TkWindow *winPtr); /* 32 */ - void (*tkMacOSXUnregisterMacWindow) (VOID *portPtr); /* 33 */ - int (*tkMacOSXUseMenuID) (short macID); /* 34 */ - TkRegion (*tkMacOSXVisableClipRgn) (TkWindow *winPtr); /* 35 */ - void (*tkMacOSXWinBounds) (TkWindow *winPtr, VOID *geometry); /* 36 */ - void (*tkMacOSXWindowOffset) (VOID *wRef, int *xOffset, int *yOffset); /* 37 */ - int (*tkSetMacColor) (unsigned long pixel, VOID *macColor); /* 38 */ - void (*tkSetWMName) (TkWindow *winPtr, Tk_Uid titleUid); /* 39 */ - void (*tkSuspendClipboard) (void); /* 40 */ - int (*tkMacOSXZoomToplevel) (VOID *whichWindow, short zoomPart); /* 41 */ - Tk_Window (*tk_TopCoordsToWindow) (Tk_Window tkwin, int rootX, int rootY, int *newX, int *newY); /* 42 */ - MacDrawable * (*tkMacOSXContainerId) (TkWindow *winPtr); /* 43 */ - MacDrawable * (*tkMacOSXGetHostToplevel) (TkWindow *winPtr); /* 44 */ - void (*tkMacOSXPreprocessMenu) (void); /* 45 */ - int (*tkpIsWindowFloating) (VOID *window); /* 46 */ - Tk_Window (*tkMacOSXGetCapture) (void); /* 47 */ - VOID *reserved48; - Window (*tkGetTransientMaster) (TkWindow *winPtr); /* 49 */ - int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */ - void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */ - VOID *reserved52; - unsigned long (*tkpGetMS) (void); /* 53 */ - VOID * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ - int (*tkpScanWindowId) (Tcl_Interp *interp, CONST char *string, Window *idPtr); /* 55 */ -#endif /* AQUA */ -#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ - void (*tkCreateXEventSource) (void); /* 0 */ - void (*tkFreeWindowId) (TkDisplay *dispPtr, Window w); /* 1 */ - void (*tkInitXId) (TkDisplay *dispPtr); /* 2 */ - int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 3 */ - void (*tkpSync) (Display *display); /* 4 */ - Window (*tkUnixContainerId) (TkWindow *winPtr); /* 5 */ - int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 6 */ - void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 7 */ - int (*tkpScanWindowId) (Tcl_Interp *interp, CONST char *string, Window *idPtr); /* 8 */ - void (*tkWmCleanup) (TkDisplay *dispPtr); /* 9 */ - void (*tkSendCleanup) (TkDisplay *dispPtr); /* 10 */ - void (*tkFreeXId) (TkDisplay *dispPtr); /* 11 */ - int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 12 */ - int (*tkpTestsendCmd) (ClientData clientData, Tcl_Interp *interp, int argc, CONST char **argv); /* 13 */ -#endif /* X11 */ -} TkIntPlatStubs; - -extern TkIntPlatStubs *tkIntPlatStubsPtr; - -#ifdef __cplusplus -} -#endif - -#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) - -/* - * Inline function declarations: - */ - -#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ -#ifndef TkAlignImageData -#define TkAlignImageData \ - (tkIntPlatStubsPtr->tkAlignImageData) /* 0 */ -#endif -/* Slot 1 is reserved */ -#ifndef TkGenerateActivateEvents -#define TkGenerateActivateEvents \ - (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ -#endif -#ifndef TkpGetMS -#define TkpGetMS \ - (tkIntPlatStubsPtr->tkpGetMS) /* 3 */ -#endif -#ifndef TkPointerDeadWindow -#define TkPointerDeadWindow \ - (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 4 */ -#endif -#ifndef TkpPrintWindowId -#define TkpPrintWindowId \ - (tkIntPlatStubsPtr->tkpPrintWindowId) /* 5 */ -#endif -#ifndef TkpScanWindowId -#define TkpScanWindowId \ - (tkIntPlatStubsPtr->tkpScanWindowId) /* 6 */ -#endif -#ifndef TkpSetCapture -#define TkpSetCapture \ - (tkIntPlatStubsPtr->tkpSetCapture) /* 7 */ -#endif -#ifndef TkpSetCursor -#define TkpSetCursor \ - (tkIntPlatStubsPtr->tkpSetCursor) /* 8 */ -#endif -#ifndef TkpWmSetState -#define TkpWmSetState \ - (tkIntPlatStubsPtr->tkpWmSetState) /* 9 */ -#endif -#ifndef TkSetPixmapColormap -#define TkSetPixmapColormap \ - (tkIntPlatStubsPtr->tkSetPixmapColormap) /* 10 */ -#endif -#ifndef TkWinCancelMouseTimer -#define TkWinCancelMouseTimer \ - (tkIntPlatStubsPtr->tkWinCancelMouseTimer) /* 11 */ -#endif -#ifndef TkWinClipboardRender -#define TkWinClipboardRender \ - (tkIntPlatStubsPtr->tkWinClipboardRender) /* 12 */ -#endif -#ifndef TkWinEmbeddedEventProc -#define TkWinEmbeddedEventProc \ - (tkIntPlatStubsPtr->tkWinEmbeddedEventProc) /* 13 */ -#endif -#ifndef TkWinFillRect -#define TkWinFillRect \ - (tkIntPlatStubsPtr->tkWinFillRect) /* 14 */ -#endif -#ifndef TkWinGetBorderPixels -#define TkWinGetBorderPixels \ - (tkIntPlatStubsPtr->tkWinGetBorderPixels) /* 15 */ -#endif -#ifndef TkWinGetDrawableDC -#define TkWinGetDrawableDC \ - (tkIntPlatStubsPtr->tkWinGetDrawableDC) /* 16 */ -#endif -#ifndef TkWinGetModifierState -#define TkWinGetModifierState \ - (tkIntPlatStubsPtr->tkWinGetModifierState) /* 17 */ -#endif -#ifndef TkWinGetSystemPalette -#define TkWinGetSystemPalette \ - (tkIntPlatStubsPtr->tkWinGetSystemPalette) /* 18 */ -#endif -#ifndef TkWinGetWrapperWindow -#define TkWinGetWrapperWindow \ - (tkIntPlatStubsPtr->tkWinGetWrapperWindow) /* 19 */ -#endif -#ifndef TkWinHandleMenuEvent -#define TkWinHandleMenuEvent \ - (tkIntPlatStubsPtr->tkWinHandleMenuEvent) /* 20 */ -#endif -#ifndef TkWinIndexOfColor -#define TkWinIndexOfColor \ - (tkIntPlatStubsPtr->tkWinIndexOfColor) /* 21 */ -#endif -#ifndef TkWinReleaseDrawableDC -#define TkWinReleaseDrawableDC \ - (tkIntPlatStubsPtr->tkWinReleaseDrawableDC) /* 22 */ -#endif -#ifndef TkWinResendEvent -#define TkWinResendEvent \ - (tkIntPlatStubsPtr->tkWinResendEvent) /* 23 */ -#endif -#ifndef TkWinSelectPalette -#define TkWinSelectPalette \ - (tkIntPlatStubsPtr->tkWinSelectPalette) /* 24 */ -#endif -#ifndef TkWinSetMenu -#define TkWinSetMenu \ - (tkIntPlatStubsPtr->tkWinSetMenu) /* 25 */ -#endif -#ifndef TkWinSetWindowPos -#define TkWinSetWindowPos \ - (tkIntPlatStubsPtr->tkWinSetWindowPos) /* 26 */ -#endif -#ifndef TkWinWmCleanup -#define TkWinWmCleanup \ - (tkIntPlatStubsPtr->tkWinWmCleanup) /* 27 */ -#endif -#ifndef TkWinXCleanup -#define TkWinXCleanup \ - (tkIntPlatStubsPtr->tkWinXCleanup) /* 28 */ -#endif -#ifndef TkWinXInit -#define TkWinXInit \ - (tkIntPlatStubsPtr->tkWinXInit) /* 29 */ -#endif -#ifndef TkWinSetForegroundWindow -#define TkWinSetForegroundWindow \ - (tkIntPlatStubsPtr->tkWinSetForegroundWindow) /* 30 */ -#endif -#ifndef TkWinDialogDebug -#define TkWinDialogDebug \ - (tkIntPlatStubsPtr->tkWinDialogDebug) /* 31 */ -#endif -#ifndef TkWinGetMenuSystemDefault -#define TkWinGetMenuSystemDefault \ - (tkIntPlatStubsPtr->tkWinGetMenuSystemDefault) /* 32 */ -#endif -#ifndef TkWinGetPlatformId -#define TkWinGetPlatformId \ - (tkIntPlatStubsPtr->tkWinGetPlatformId) /* 33 */ -#endif -#ifndef TkWinSetHINSTANCE -#define TkWinSetHINSTANCE \ - (tkIntPlatStubsPtr->tkWinSetHINSTANCE) /* 34 */ -#endif -#ifndef TkWinGetPlatformTheme -#define TkWinGetPlatformTheme \ - (tkIntPlatStubsPtr->tkWinGetPlatformTheme) /* 35 */ -#endif -#ifndef TkWinChildProc -#define TkWinChildProc \ - (tkIntPlatStubsPtr->tkWinChildProc) /* 36 */ -#endif -#ifndef TkCreateXEventSource -#define TkCreateXEventSource \ - (tkIntPlatStubsPtr->tkCreateXEventSource) /* 37 */ -#endif -#ifndef TkpCmapStressed -#define TkpCmapStressed \ - (tkIntPlatStubsPtr->tkpCmapStressed) /* 38 */ -#endif -#ifndef TkpSync -#define TkpSync \ - (tkIntPlatStubsPtr->tkpSync) /* 39 */ -#endif -#ifndef TkUnixContainerId -#define TkUnixContainerId \ - (tkIntPlatStubsPtr->tkUnixContainerId) /* 40 */ -#endif -#ifndef TkUnixDoOneXEvent -#define TkUnixDoOneXEvent \ - (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 41 */ -#endif -#ifndef TkUnixSetMenubar -#define TkUnixSetMenubar \ - (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 42 */ -#endif -#ifndef TkWmCleanup -#define TkWmCleanup \ - (tkIntPlatStubsPtr->tkWmCleanup) /* 43 */ -#endif -#ifndef TkSendCleanup -#define TkSendCleanup \ - (tkIntPlatStubsPtr->tkSendCleanup) /* 44 */ -#endif -#ifndef TkpTestsendCmd -#define TkpTestsendCmd \ - (tkIntPlatStubsPtr->tkpTestsendCmd) /* 45 */ -#endif -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ -#ifndef TkGenerateActivateEvents -#define TkGenerateActivateEvents \ - (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 0 */ -#endif -/* Slot 1 is reserved */ -/* Slot 2 is reserved */ -#ifndef TkPointerDeadWindow -#define TkPointerDeadWindow \ - (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 3 */ -#endif -#ifndef TkpSetCapture -#define TkpSetCapture \ - (tkIntPlatStubsPtr->tkpSetCapture) /* 4 */ -#endif -#ifndef TkpSetCursor -#define TkpSetCursor \ - (tkIntPlatStubsPtr->tkpSetCursor) /* 5 */ -#endif -#ifndef TkpWmSetState -#define TkpWmSetState \ - (tkIntPlatStubsPtr->tkpWmSetState) /* 6 */ -#endif -#ifndef TkAboutDlg -#define TkAboutDlg \ - (tkIntPlatStubsPtr->tkAboutDlg) /* 7 */ -#endif -#ifndef TkMacOSXButtonKeyState -#define TkMacOSXButtonKeyState \ - (tkIntPlatStubsPtr->tkMacOSXButtonKeyState) /* 8 */ -#endif -#ifndef TkMacOSXClearMenubarActive -#define TkMacOSXClearMenubarActive \ - (tkIntPlatStubsPtr->tkMacOSXClearMenubarActive) /* 9 */ -#endif -#ifndef TkMacOSXDispatchMenuEvent -#define TkMacOSXDispatchMenuEvent \ - (tkIntPlatStubsPtr->tkMacOSXDispatchMenuEvent) /* 10 */ -#endif -#ifndef TkMacOSXInstallCursor -#define TkMacOSXInstallCursor \ - (tkIntPlatStubsPtr->tkMacOSXInstallCursor) /* 11 */ -#endif -#ifndef TkMacOSXHandleTearoffMenu -#define TkMacOSXHandleTearoffMenu \ - (tkIntPlatStubsPtr->tkMacOSXHandleTearoffMenu) /* 12 */ -#endif -/* Slot 13 is reserved */ -#ifndef TkMacOSXDoHLEvent -#define TkMacOSXDoHLEvent \ - (tkIntPlatStubsPtr->tkMacOSXDoHLEvent) /* 14 */ -#endif -/* Slot 15 is reserved */ -#ifndef TkMacOSXGetXWindow -#define TkMacOSXGetXWindow \ - (tkIntPlatStubsPtr->tkMacOSXGetXWindow) /* 16 */ -#endif -#ifndef TkMacOSXGrowToplevel -#define TkMacOSXGrowToplevel \ - (tkIntPlatStubsPtr->tkMacOSXGrowToplevel) /* 17 */ -#endif -#ifndef TkMacOSXHandleMenuSelect -#define TkMacOSXHandleMenuSelect \ - (tkIntPlatStubsPtr->tkMacOSXHandleMenuSelect) /* 18 */ -#endif -/* Slot 19 is reserved */ -/* Slot 20 is reserved */ -#ifndef TkMacOSXInvalidateWindow -#define TkMacOSXInvalidateWindow \ - (tkIntPlatStubsPtr->tkMacOSXInvalidateWindow) /* 21 */ -#endif -#ifndef TkMacOSXIsCharacterMissing -#define TkMacOSXIsCharacterMissing \ - (tkIntPlatStubsPtr->tkMacOSXIsCharacterMissing) /* 22 */ -#endif -#ifndef TkMacOSXMakeRealWindowExist -#define TkMacOSXMakeRealWindowExist \ - (tkIntPlatStubsPtr->tkMacOSXMakeRealWindowExist) /* 23 */ -#endif -#ifndef TkMacOSXMakeStippleMap -#define TkMacOSXMakeStippleMap \ - (tkIntPlatStubsPtr->tkMacOSXMakeStippleMap) /* 24 */ -#endif -#ifndef TkMacOSXMenuClick -#define TkMacOSXMenuClick \ - (tkIntPlatStubsPtr->tkMacOSXMenuClick) /* 25 */ -#endif -#ifndef TkMacOSXRegisterOffScreenWindow -#define TkMacOSXRegisterOffScreenWindow \ - (tkIntPlatStubsPtr->tkMacOSXRegisterOffScreenWindow) /* 26 */ -#endif -#ifndef TkMacOSXResizable -#define TkMacOSXResizable \ - (tkIntPlatStubsPtr->tkMacOSXResizable) /* 27 */ -#endif -#ifndef TkMacOSXSetHelpMenuItemCount -#define TkMacOSXSetHelpMenuItemCount \ - (tkIntPlatStubsPtr->tkMacOSXSetHelpMenuItemCount) /* 28 */ -#endif -#ifndef TkMacOSXSetScrollbarGrow -#define TkMacOSXSetScrollbarGrow \ - (tkIntPlatStubsPtr->tkMacOSXSetScrollbarGrow) /* 29 */ -#endif -#ifndef TkMacOSXSetUpClippingRgn -#define TkMacOSXSetUpClippingRgn \ - (tkIntPlatStubsPtr->tkMacOSXSetUpClippingRgn) /* 30 */ -#endif -#ifndef TkMacOSXSetUpGraphicsPort -#define TkMacOSXSetUpGraphicsPort \ - (tkIntPlatStubsPtr->tkMacOSXSetUpGraphicsPort) /* 31 */ -#endif -#ifndef TkMacOSXUpdateClipRgn -#define TkMacOSXUpdateClipRgn \ - (tkIntPlatStubsPtr->tkMacOSXUpdateClipRgn) /* 32 */ -#endif -#ifndef TkMacOSXUnregisterMacWindow -#define TkMacOSXUnregisterMacWindow \ - (tkIntPlatStubsPtr->tkMacOSXUnregisterMacWindow) /* 33 */ -#endif -#ifndef TkMacOSXUseMenuID -#define TkMacOSXUseMenuID \ - (tkIntPlatStubsPtr->tkMacOSXUseMenuID) /* 34 */ -#endif -#ifndef TkMacOSXVisableClipRgn -#define TkMacOSXVisableClipRgn \ - (tkIntPlatStubsPtr->tkMacOSXVisableClipRgn) /* 35 */ -#endif -#ifndef TkMacOSXWinBounds -#define TkMacOSXWinBounds \ - (tkIntPlatStubsPtr->tkMacOSXWinBounds) /* 36 */ -#endif -#ifndef TkMacOSXWindowOffset -#define TkMacOSXWindowOffset \ - (tkIntPlatStubsPtr->tkMacOSXWindowOffset) /* 37 */ -#endif -#ifndef TkSetMacColor -#define TkSetMacColor \ - (tkIntPlatStubsPtr->tkSetMacColor) /* 38 */ -#endif -#ifndef TkSetWMName -#define TkSetWMName \ - (tkIntPlatStubsPtr->tkSetWMName) /* 39 */ -#endif -#ifndef TkSuspendClipboard -#define TkSuspendClipboard \ - (tkIntPlatStubsPtr->tkSuspendClipboard) /* 40 */ -#endif -#ifndef TkMacOSXZoomToplevel -#define TkMacOSXZoomToplevel \ - (tkIntPlatStubsPtr->tkMacOSXZoomToplevel) /* 41 */ -#endif -#ifndef Tk_TopCoordsToWindow -#define Tk_TopCoordsToWindow \ - (tkIntPlatStubsPtr->tk_TopCoordsToWindow) /* 42 */ -#endif -#ifndef TkMacOSXContainerId -#define TkMacOSXContainerId \ - (tkIntPlatStubsPtr->tkMacOSXContainerId) /* 43 */ -#endif -#ifndef TkMacOSXGetHostToplevel -#define TkMacOSXGetHostToplevel \ - (tkIntPlatStubsPtr->tkMacOSXGetHostToplevel) /* 44 */ -#endif -#ifndef TkMacOSXPreprocessMenu -#define TkMacOSXPreprocessMenu \ - (tkIntPlatStubsPtr->tkMacOSXPreprocessMenu) /* 45 */ -#endif -#ifndef TkpIsWindowFloating -#define TkpIsWindowFloating \ - (tkIntPlatStubsPtr->tkpIsWindowFloating) /* 46 */ -#endif -#ifndef TkMacOSXGetCapture -#define TkMacOSXGetCapture \ - (tkIntPlatStubsPtr->tkMacOSXGetCapture) /* 47 */ -#endif -/* Slot 48 is reserved */ -#ifndef TkGetTransientMaster -#define TkGetTransientMaster \ - (tkIntPlatStubsPtr->tkGetTransientMaster) /* 49 */ -#endif -#ifndef TkGenerateButtonEvent -#define TkGenerateButtonEvent \ - (tkIntPlatStubsPtr->tkGenerateButtonEvent) /* 50 */ -#endif -#ifndef TkGenWMDestroyEvent -#define TkGenWMDestroyEvent \ - (tkIntPlatStubsPtr->tkGenWMDestroyEvent) /* 51 */ -#endif -/* Slot 52 is reserved */ -#ifndef TkpGetMS -#define TkpGetMS \ - (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ -#endif -#ifndef TkMacOSXDrawable -#define TkMacOSXDrawable \ - (tkIntPlatStubsPtr->tkMacOSXDrawable) /* 54 */ -#endif -#ifndef TkpScanWindowId -#define TkpScanWindowId \ - (tkIntPlatStubsPtr->tkpScanWindowId) /* 55 */ -#endif -#endif /* AQUA */ -#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ -#ifndef TkCreateXEventSource -#define TkCreateXEventSource \ - (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */ -#endif -#ifndef TkFreeWindowId -#define TkFreeWindowId \ - (tkIntPlatStubsPtr->tkFreeWindowId) /* 1 */ -#endif -#ifndef TkInitXId -#define TkInitXId \ - (tkIntPlatStubsPtr->tkInitXId) /* 2 */ -#endif -#ifndef TkpCmapStressed -#define TkpCmapStressed \ - (tkIntPlatStubsPtr->tkpCmapStressed) /* 3 */ -#endif -#ifndef TkpSync -#define TkpSync \ - (tkIntPlatStubsPtr->tkpSync) /* 4 */ -#endif -#ifndef TkUnixContainerId -#define TkUnixContainerId \ - (tkIntPlatStubsPtr->tkUnixContainerId) /* 5 */ -#endif -#ifndef TkUnixDoOneXEvent -#define TkUnixDoOneXEvent \ - (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 6 */ -#endif -#ifndef TkUnixSetMenubar -#define TkUnixSetMenubar \ - (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 7 */ -#endif -#ifndef TkpScanWindowId -#define TkpScanWindowId \ - (tkIntPlatStubsPtr->tkpScanWindowId) /* 8 */ -#endif -#ifndef TkWmCleanup -#define TkWmCleanup \ - (tkIntPlatStubsPtr->tkWmCleanup) /* 9 */ -#endif -#ifndef TkSendCleanup -#define TkSendCleanup \ - (tkIntPlatStubsPtr->tkSendCleanup) /* 10 */ -#endif -#ifndef TkFreeXId -#define TkFreeXId \ - (tkIntPlatStubsPtr->tkFreeXId) /* 11 */ -#endif -#ifndef TkpWmSetState -#define TkpWmSetState \ - (tkIntPlatStubsPtr->tkpWmSetState) /* 12 */ -#endif -#ifndef TkpTestsendCmd -#define TkpTestsendCmd \ - (tkIntPlatStubsPtr->tkpTestsendCmd) /* 13 */ -#endif -#endif /* X11 */ - -#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ - -/* !END!: Do not edit above this line. */ - -#undef TCL_STORAGE_CLASS -#define TCL_STORAGE_CLASS DLLIMPORT - -#ifdef __CYGWIN__ - void TkFreeXId(TkDisplay *dispPtr); - void TkFreeWindowId(TkDisplay *dispPtr, Window w); - void TkInitXId(TkDisplay *dispPtr); -#endif - -#ifdef __WIN32__ -#undef TkpCmapStressed -#undef TkpSync -#define TkpCmapStressed(tkwin,colormap) (0) -#define TkpSync(display) -#endif - #endif /* _TKINTPLATDECLS */ -- cgit v0.12 From 092fc0d2df191c5676cd4c39da254d9a35e8da1e Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 8 Apr 2015 19:05:28 +0000 Subject: Added test for bug [562118ce41] --- tests/textIndex.test | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/textIndex.test b/tests/textIndex.test index 28dc0df..b9cc74d 100644 --- a/tests/textIndex.test +++ b/tests/textIndex.test @@ -905,6 +905,16 @@ test textIndex-22.12 {text index wordstart, unicode} { test textIndex-22.13 {text index wordstart, unicode} { text_test_word wordstart "\uc700\uc700 abc" 8 } 3 +test textIndex-22.14 {text index wordstart, unicode, start index at internal segment start} { + catch {destroy .t} + text .t + .t insert end "C'est du texte en fran\u00e7ais\n" + .t insert end "\u042D\u0442\u043E\u0020\u0442\u0435\u043A\u0441\u0442\u0020\u043D\u0430\u0020\u0440\u0443\u0441\u0441\u043A\u043E\u043C" + .t mark set insert 1.23 + set res [.t index "1.23 wordstart"] + .t mark set insert 2.16 + lappend res [.t index "2.16 wordstart"] [.t index "2.15 wordstart"] +} {1.18 2.13 2.13} test textIndex-23.1 {text paragraph start} { pack [text .t2] -- cgit v0.12 From 18281d841cc01351755fbbda09b3ec6ce0a39255 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 8 Apr 2015 19:32:52 +0000 Subject: Fixed crash with display wordstart - Bug [e4ed00a954] --- generic/tkTextIndex.c | 2 +- tests/textIndex.test | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index 13f3957..b2919d5 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -2340,7 +2340,7 @@ StartEnd( int offset; if (modifier == TKINDEX_DISPLAY) { - TkTextIndexForwChars(NULL, indexPtr, 0, indexPtr, + TkTextIndexForwChars(textPtr, indexPtr, 0, indexPtr, COUNT_DISPLAY_INDICES); } diff --git a/tests/textIndex.test b/tests/textIndex.test index 28dc0df..92cbff0 100644 --- a/tests/textIndex.test +++ b/tests/textIndex.test @@ -905,6 +905,11 @@ test textIndex-22.12 {text index wordstart, unicode} { test textIndex-22.13 {text index wordstart, unicode} { text_test_word wordstart "\uc700\uc700 abc" 8 } 3 +test textIndex-22.15 {text index display wordstart} { + catch {destroy .t} + text .t + .t index "1.0 display wordstart" ; # used to crash +} 1.0 test textIndex-23.1 {text paragraph start} { pack [text .t2] -- cgit v0.12 From 69e749839382af95c02bdb100c49402eb6b926ae Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Thu, 9 Apr 2015 02:00:49 +0000 Subject: Re-working of internal Cocoa widget drawing routines, especially when resizing; fix rendering of scrollbar when resized or clipped; cleanup of button metrics; thanks to Marc Culler for extensive patches --- generic/tkCanvas.c | 13 ++++++ generic/tkInt.decls | 3 ++ generic/tkIntPlatDecls.h | 5 ++- generic/tkTextDisp.c | 28 +++++------- macosx/tkMacOSXButton.c | 21 +++++---- macosx/tkMacOSXDraw.c | 86 ++++++++++++++++++++++++++++-------- macosx/tkMacOSXInt.h | 2 +- macosx/tkMacOSXMouseEvent.c | 6 --- macosx/tkMacOSXNotify.c | 27 ++++++++---- macosx/tkMacOSXScrlbr.c | 84 +++++++++++++++++++---------------- macosx/tkMacOSXSubwindows.c | 59 +++++++++++++++++++++++++ macosx/tkMacOSXWindowEvent.c | 101 ++++++++++++++++++++++++++----------------- 12 files changed, 297 insertions(+), 138 deletions(-) diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 8e14852..9c4d60a 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -2447,6 +2447,19 @@ DisplayCanvas( goto done; } +#ifdef MAC_OSX_TK + /* + * If drawing is disabled, all we need to do is + * clear the REDRAW_PENDING flag. + */ + TkWindow *winPtr = (TkWindow *)(canvasPtr->tkwin); + MacDrawable *macWin = winPtr->privatePtr; + if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){ + canvasPtr->flags &= ~REDRAW_PENDING; + return; + } +#endif + /* * Choose a new current item if that is needed (this could cause event * handlers to be invoked). diff --git a/generic/tkInt.decls b/generic/tkInt.decls index ebbadba..8924d68 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -1017,6 +1017,9 @@ declare 50 aqua { declare 51 aqua { void TkGenWMDestroyEvent(Tk_Window tkwin) } +declare 52 aqua { + TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); +} # removed duplicate from tkPlat table (tk.decls) #declare 52 aqua { diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 3a2a8aa..3a4bdac 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -250,7 +250,8 @@ EXTERN int TkGenerateButtonEvent(int x, int y, Window window, unsigned int state); /* 51 */ EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); -/* Slot 52 is reserved */ +/* 52 */ +EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); /* 53 */ EXTERN unsigned long TkpGetMS(void); /* 54 */ @@ -395,7 +396,7 @@ typedef struct TkIntPlatStubs { Window (*tkGetTransientMaster) (TkWindow *winPtr); /* 49 */ int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */ void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */ - void (*reserved52)(void); + void (*tkMacOSXSetDrawingEnabled) (TkWindow *winPtr, int flag); /* 52 */ unsigned long (*tkpGetMS) (void); /* 53 */ void * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 55 */ diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 95ea935..a95bb91 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -3948,6 +3948,18 @@ DisplayText( * warnings. */ Tcl_Interp *interp; +#ifdef MAC_OSX_TK + /* + * If drawing is disabled, all we need to do is + * clear the REDRAW_PENDING flag. + */ + TkWindow *winPtr = (TkWindow *)(textPtr->tkwin); + MacDrawable *macWin = winPtr->privatePtr; + if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){ + dInfoPtr->flags &= ~REDRAW_PENDING; + return; + } +#endif if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { /* @@ -3964,14 +3976,6 @@ DisplayText( Tcl_SetVar2(interp, "tk_textRelayout", NULL, "", TCL_GLOBAL_ONLY); } - if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { - /* - * The widget has been deleted. Don't do anything. - */ - - goto end; - } - if (!Tk_IsMapped(textPtr->tkwin) || (dInfoPtr->maxX <= dInfoPtr->x) || (dInfoPtr->maxY <= dInfoPtr->y)) { UpdateDisplayInfo(textPtr); @@ -3983,14 +3987,6 @@ DisplayText( Tcl_SetVar2(interp, "tk_textRedraw", NULL, "", TCL_GLOBAL_ONLY); } - if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { - /* - * The widget has been deleted. Don't do anything. - */ - - goto end; - } - /* * Choose a new current item if that is needed (this could cause event * handlers to be invoked, hence the preserve/release calls and the loop, diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index 725c211..59d394e 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -30,10 +30,10 @@ * Default insets for controls */ -#define DEF_INSET_LEFT 2 -#define DEF_INSET_RIGHT 2 -#define DEF_INSET_TOP 2 -#define DEF_INSET_BOTTOM 4 +#define DEF_INSET_LEFT 12 +#define DEF_INSET_RIGHT 12 +#define DEF_INSET_TOP 1 +#define DEF_INSET_BOTTOM 1 /* * Some defines used to control what type of control is drawn. @@ -318,8 +318,8 @@ TkpComputeButtonGeometry( Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength, butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight); - txtWidth = butPtr->textWidth; - txtHeight = butPtr->textHeight; + txtWidth = butPtr->textWidth + DEF_INSET_LEFT + DEF_INSET_RIGHT; + txtHeight = butPtr->textHeight + DEF_INSET_BOTTOM + DEF_INSET_TOP; charWidth = Tk_TextWidth(butPtr->tkfont, "0", 1); Tk_GetFontMetrics(butPtr->tkfont, &fm); haveText = (txtWidth != 0 && txtHeight != 0); @@ -647,7 +647,7 @@ DrawButtonImageAndText( butPtr->textHeight, &x, &y); x += butPtr->indicatorSpace; Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout, - x, y, 0, -1); + x, y - DEF_INSET_BOTTOM, 0, -1); } /* @@ -807,9 +807,12 @@ TkMacOSXDrawButton( hiinfo.animation.time.start = hiinfo.animation.time.current; } - HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal, &contHIRec); + HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal, + &contHIRec); + TkMacOSXRestoreDrawingContext(&dc); - ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, (MacButton *)mbPtr, 32, true); + ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, + (MacButton *)mbPtr, 32, true); } else { if (!TkMacOSXSetupDrawingContext(pixmap, dpPtr->gc, 1, &dc)) { diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 328f905..0f6d2f0 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -222,7 +222,8 @@ XCopyArea( } if (!TkMacOSXSetupDrawingContext(dst, gc, 1, &dc)) { - TkMacOSXDbgMsg("Failed to setup drawing context."); + return; + /*TkMacOSXDbgMsg("Failed to setup drawing context.");*/ } if ( dc.context ) { @@ -243,6 +244,8 @@ XCopyArea( CGRectMake(src_x, src_y, width, height), CGRectMake(dest_x, dest_y, width, height)); CFRelease(img); + + } else { TkMacOSXDbgMsg("Failed to construct CGImage."); } @@ -652,9 +655,9 @@ GetCGContextForDrawable( CGColorSpaceRef colorspace = NULL; CGBitmapInfo bitmapInfo = #ifdef __LITTLE_ENDIAN__ - kCGBitmapByteOrder32Host; + kCGBitmapByteOrder32Host; #else - kCGBitmapByteOrderDefault; + kCGBitmapByteOrderDefault; #endif char *data; CGRect bounds = CGRectMake(0, 0, macDraw->size.width, @@ -731,6 +734,7 @@ DrawCGImage( } } dstBounds = CGRectOffset(dstBounds, macDraw->xOff, macDraw->yOff); + if (CGImageIsMask(image)) { /*CGContextSaveGState(context);*/ if (macDraw->flags & TK_IS_BW_PIXMAP) { @@ -765,8 +769,8 @@ DrawCGImage( dstBounds.size.width, dstBounds.size.height); #else /* TK_MAC_DEBUG_IMAGE_DRAWING */ CGContextSaveGState(context); - CGContextTranslateCTM(context, - 0, dstBounds.origin.y + CGRectGetMaxY(dstBounds)); + CGContextTranslateCTM(context, 0, + dstBounds.origin.y + CGRectGetMaxY(dstBounds)); CGContextScaleCTM(context, 1, -1); CGContextDrawImage(context, dstBounds, image); CGContextRestoreGState(context); @@ -1478,10 +1482,9 @@ TkScrollWindow( MacDrawable *macDraw = (MacDrawable *) drawable; NSView *view = TkMacOSXDrawableView(macDraw); CGRect srcRect, dstRect; - HIShapeRef dmgRgn = NULL, extraRgn; + HIShapeRef dmgRgn = NULL, extraRgn = NULL; NSRect bounds, visRect, scrollSrc, scrollDst; - int result; - + int result = 0; if ( view ) { /* Get the scroll area in NSView coordinates (origin at bottom left). */ @@ -1491,36 +1494,79 @@ TkScrollWindow( bounds.size.height - height - (macDraw->yOff + y), width, height); scrollDst = NSOffsetRect(scrollSrc, dx, -dy); + /* Limit scrolling to the window content area. */ visRect = [view visibleRect]; scrollSrc = NSIntersectionRect(scrollSrc, visRect); scrollDst = NSIntersectionRect(scrollDst, visRect); - if ( !NSIsEmptyRect(scrollSrc) && !NSIsEmptyRect(scrollDst) ) { /* * Mark the difference between source and destination as damaged. - * This region is described in the Tk coordinate system. + * This region is described in NSView coordinates (y=0 at the bottom) + * and converted to Tk coordinates later. */ - srcRect = CGRectMake(x, y, width, height); - dstRect = CGRectOffset(srcRect, dx, dy); + srcRect = CGRectMake(x, y, width, height); + dstRect = CGRectOffset(srcRect, dx, dy); + + /* Expand the rectangles slightly to avoid degeneracies. */ + srcRect.origin.y -= 1; + srcRect.size.height += 2; + dstRect.origin.y += 1; + dstRect.size.height -= 2; + + /* Compute the damage. */ dmgRgn = HIShapeCreateMutableWithRect(&srcRect); extraRgn = HIShapeCreateWithRect(&dstRect); ChkErr(HIShapeDifference, dmgRgn, extraRgn, (HIMutableShapeRef) dmgRgn); - CFRelease(extraRgn); + result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; + + /* Convert to Tk coordinates. */ + TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); + if (extraRgn) { + CFRelease(extraRgn); + } /* Scroll the rectangle. */ [view scrollRect:scrollSrc by:NSMakeSize(dx, -dy)]; + + /* Shift the Tk children which meet the source rectangle. */ + TkWindow *winPtr = (TkWindow *)tkwin; + TkWindow *childPtr; + CGRect childBounds; + for (childPtr = winPtr->childList; childPtr != NULL; childPtr = childPtr->nextPtr) { + if (Tk_IsMapped(childPtr) && !Tk_IsTopLevel(childPtr)) { + TkMacOSXWinCGBounds(childPtr, &childBounds); + if (CGRectIntersectsRect(srcRect, childBounds)) { + MacDrawable *macChild = childPtr->privatePtr; + if (macChild) { + macChild->yOff += dy; + macChild->xOff += dx; + childPtr->changes.y = macChild->yOff; + childPtr->changes.x = macChild->xOff; + } + } + } + } + + /* Queue up Expose events for the damage region. */ + int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE); + [view generateExposeEvents:dmgRgn childrenOnly:1]; + Tcl_SetServiceMode(oldMode); + + /* Belt and suspenders: make the AppKit request a redraw + when it gets control again. */ + [view setNeedsDisplay:YES]; } + } else { + dmgRgn = HIShapeCreateEmpty(); + TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); } - if ( dmgRgn == NULL ) { - dmgRgn = HIShapeCreateEmpty(); + if (dmgRgn) { + CFRelease(dmgRgn); } - TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); - result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; - CFRelease(dmgRgn); return result; } @@ -1855,6 +1901,7 @@ TkpClipDrawableToRect( CFRelease(macDraw->drawRgn); macDraw->drawRgn = NULL; } + if (width >= 0 && height >= 0) { CGRect clipRect = CGRectMake(x + macDraw->xOff, y + macDraw->yOff, width, height); @@ -2002,7 +2049,7 @@ TkpDrawHighlightBorder ( * TkpDrawFrame -- * * This procedure draws the rectangular frame area. If the user - * has request themeing, it draws with a the background theme. + * has requested themeing, it draws with the background theme. * * Results: * None. @@ -2032,6 +2079,7 @@ TkpDrawFrame( border = themedBorder; } } + Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, highlightWidth, highlightWidth, Tk_Width(tkwin) - 2 * highlightWidth, diff --git a/macosx/tkMacOSXInt.h b/macosx/tkMacOSXInt.h index 249d5cf..6971e26 100644 --- a/macosx/tkMacOSXInt.h +++ b/macosx/tkMacOSXInt.h @@ -86,7 +86,7 @@ typedef struct TkWindowPrivate MacDrawable; #define TK_FOCUSED_VIEW 0x10 #define TK_IS_PIXMAP 0x20 #define TK_IS_BW_PIXMAP 0x40 - +#define TK_DO_NOT_DRAW 0x80 /* * I am reserving TK_EMBEDDED = 0x100 in the MacDrawable flags * This is defined in tk.h. We need to duplicate the TK_EMBEDDED flag in the diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 95f0021..8c0a2e6 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -104,12 +104,6 @@ enum { return theEvent; /* Give up. No window for this event. */ } - /* - MacDrawable *macWin = (MacDrawable *) window; - NSView *view = TkMacOSXDrawableView(macWin); - local = [view convertPoint:local fromView:nil]; - local.y = NSHeight([view bounds]) - local.y; - */ TkWindow *winPtr = (TkWindow *) tkwin; local.x -= winPtr->wmInfoPtr->xInParent; local.y -= winPtr->wmInfoPtr->yInParent; diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 8b9745d..1d4c6c5 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -50,18 +50,18 @@ static void TkMacOSXEventsCheckProc(ClientData clientData, int flags); @end @implementation TKApplication(TKNotify) -/* Redisplay all of our windows, then call super. */ +/* Call super then redisplay all of our windows. */ - (NSEvent *) nextEventMatchingMask: (NSUInteger) mask untilDate: (NSDate *) expiration inMode: (NSString *) mode dequeue: (BOOL) deqFlag { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - [NSApp makeWindowsPerform:@selector(tkDisplayIfNeeded) inOrder:NO]; - [pool drain]; NSEvent *event = [super nextEventMatchingMask:mask untilDate:expiration inMode:mode dequeue:deqFlag]; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + [NSApp makeWindowsPerform:@selector(tkDisplayIfNeeded) inOrder:NO]; + [pool drain]; return event; } @@ -226,7 +226,7 @@ TkMacOSXEventsSetupProc( untilDate:[NSDate distantPast] inMode:GetRunLoopMode(TkMacOSXGetModalSession()) dequeue:NO]; - if (currentEvent) { + if (currentEvent && currentEvent.type > 0) { Tcl_SetMaxBlockTime(&zeroBlockTime); } } @@ -254,19 +254,30 @@ TkMacOSXEventsCheckProc( ClientData clientData, int flags) { - if (flags & TCL_WINDOW_EVENTS && - ![[NSRunLoop currentRunLoop] currentMode]) { + NSString *runloopMode = [[NSRunLoop currentRunLoop] currentMode]; + if (flags & TCL_WINDOW_EVENTS && !runloopMode) { + NSEvent *currentEvent = nil; + NSEvent *testEvent = nil; NSModalSession modalSession; do { modalSession = TkMacOSXGetModalSession(); + testEvent = [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:[NSDate distantPast] + inMode:GetRunLoopMode(modalSession) + dequeue:NO]; + /* We must not steal any events during LiveResize. */ + if (testEvent && [[testEvent window] inLiveResize]) { + break; + } + currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:GetRunLoopMode(modalSession) dequeue:YES]; if (!currentEvent) { - break; /* No more events. */ + break; /* No events are available. */ } NSAutoreleasePool *pool = [NSAutoreleasePool new]; /* Generate Xevents. */ diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index bdb76af..37178ed 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -26,6 +26,7 @@ #define RangeToFactor(maximum) (((double) (LONG_MAX >> 1)) / (maximum)) #endif /* __LP64__ */ +#define MOUNTAIN_LION_STYLE (NSAppKitVersionNumber < 1138) /* * Declaration of Mac specific scrollbar structure. @@ -80,7 +81,6 @@ static void ScrollbarEventProc(ClientData clientData, XEvent *eventPtr); static int ScrollbarPress(TkScrollbar *scrollPtr, XEvent *eventPtr); static void UpdateControlValues(TkScrollbar *scrollPtr); - /* *---------------------------------------------------------------------- * @@ -136,27 +136,26 @@ TkpDisplayScrollbar( { register TkScrollbar *scrollPtr = (TkScrollbar *) clientData; register Tk_Window tkwin = scrollPtr->tkwin; + TkWindow *winPtr = (TkWindow *) tkwin; + TkMacOSXDrawingContext dc; + scrollPtr->flags &= ~REDRAW_PENDING; - if ((scrollPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { + if (tkwin == NULL || !Tk_IsMapped(tkwin)) { return; } - TkWindow *winPtr = (TkWindow *) tkwin; MacDrawable *macWin = (MacDrawable *) winPtr->window; - TkMacOSXDrawingContext dc; NSView *view = TkMacOSXDrawableView(macWin); + if (!view || + macWin->flags & TK_DO_NOT_DRAW || + !TkMacOSXSetupDrawingContext((Drawable) macWin, NULL, 1, &dc)) { + return; + } + CGFloat viewHeight = [view bounds].size.height; CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1, .tx = 0, .ty = viewHeight}; - - - scrollPtr->flags &= ~REDRAW_PENDING; - if (!scrollPtr->tkwin || !Tk_IsMapped(tkwin) || !view || - !TkMacOSXSetupDrawingContext((Drawable) macWin, NULL, 1, &dc)) { - return; - } - CGContextConcatCTM(dc.context, t); /*Draw Unix-style scroll trough to provide rect for native scrollbar.*/ @@ -173,7 +172,6 @@ TkpDisplayScrollbar( (Pixmap) macWin); } - Tk_Draw3DRectangle(tkwin, (Pixmap) macWin, scrollPtr->bgBorder, scrollPtr->highlightWidth, scrollPtr->highlightWidth, Tk_Width(tkwin) - 2*scrollPtr->highlightWidth, @@ -186,15 +184,11 @@ TkpDisplayScrollbar( /*Update values and draw in native rect.*/ UpdateControlValues(scrollPtr); -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 - if (scrollPtr->vertical) { - HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); - } else { + if (MOUNTAIN_LION_STYLE) { HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationInverted); + } else { + HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); } -#else - HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); -#endif TkMacOSXRestoreDrawingContext(&dc); scrollPtr->flags &= ~REDRAW_PENDING; @@ -265,11 +259,12 @@ TkpComputeScrollbarGeometry( if (scrollPtr->sliderLast > fieldLength) { scrollPtr->sliderLast = fieldLength; } - scrollPtr->sliderFirst += scrollPtr->inset + + if (!(MOUNTAIN_LION_STYLE)) { + scrollPtr->sliderFirst += scrollPtr->inset + metrics[variant].topArrowHeight; - scrollPtr->sliderLast += scrollPtr->inset + + scrollPtr->sliderLast += scrollPtr->inset + metrics[variant].bottomArrowHeight; - + } /* * Register the desired geometry for the window (leave enough space * for the two arrows plus a minimum-size slider, plus border around @@ -370,21 +365,29 @@ TkpScrollbarPosition( int x, int y) /* Coordinates within scrollPtr's window. */ { - /*Using code from tkUnixScrlbr.c because Unix scroll bindings are driving the display at the script level. All the Mac scrollbar has to do is re-draw itself.*/ + /* + * Using code from tkUnixScrlbr.c because Unix scroll bindings are + * driving the display at the script level. All the Mac scrollbar + * has to do is re-draw itself. + */ - int length, width, tmp; + int length, fieldlength, width, tmp; register const int inset = scrollPtr->inset; + register const int arrowSize = scrollPtr->arrowLength + inset; if (scrollPtr->vertical) { length = Tk_Height(scrollPtr->tkwin); + fieldlength = length - 2 * arrowSize; width = Tk_Width(scrollPtr->tkwin); } else { tmp = x; x = y; y = tmp; length = Tk_Width(scrollPtr->tkwin); + fieldlength = length - 2 * arrowSize; width = Tk_Height(scrollPtr->tkwin); } + fieldlength = fieldlength < 0 ? 0 : fieldlength; if (x=width-inset || y=length-inset) { return OUTSIDE; @@ -395,19 +398,19 @@ TkpScrollbarPosition( * TkpDisplayScrollbar. Be sure to keep the two consistent. */ - if (y < inset + scrollPtr->arrowLength) { - return TOP_ARROW; - } if (y < scrollPtr->sliderFirst) { return TOP_GAP; } if (y < scrollPtr->sliderLast) { return SLIDER; } - if (y >= length - (scrollPtr->arrowLength + inset)) { - return BOTTOM_ARROW; + if (y < fieldlength){ + return BOTTOM_GAP; + } + if (y < fieldlength + arrowSize) { + return TOP_ARROW; } - return BOTTOM_GAP; + return BOTTOM_ARROW; } /* @@ -415,9 +418,11 @@ TkpScrollbarPosition( * * UpdateControlValues -- * - * This procedure updates the Macintosh scrollbar control to display the - * values defined by the Tk scrollbar. This is the key interface to the Mac-native * scrollbar; the Unix bindings drive scrolling in the Tk window and all the Mac - * scrollbar has to do is redraw itself. + * This procedure updates the Macintosh scrollbar control to + * display the values defined by the Tk scrollbar. This is the + * key interface to the Mac-native * scrollbar; the Unix bindings + * drive scrolling in the Tk window and all the Mac scrollbar has + * to do is redraw itself. * * Results: * None. @@ -432,7 +437,6 @@ static void UpdateControlValues( TkScrollbar *scrollPtr) /* Scrollbar data struct. */ { - Tk_Window tkwin = scrollPtr->tkwin; MacDrawable *macWin = (MacDrawable *) Tk_WindowId(scrollPtr->tkwin); double dViewSize; @@ -462,8 +466,10 @@ UpdateControlValues( */ info.bounds = contrlRect; - if (!scrollPtr->vertical) { - info.attributes |= kThemeTrackHorizontal; + if (scrollPtr->vertical) { + info.attributes &= ~kThemeTrackHorizontal; + } else { + info.attributes |= kThemeTrackHorizontal; } /* @@ -484,7 +490,11 @@ UpdateControlValues( factor - dViewSize; info.trackInfo.scrollbar.viewsize = dViewSize; if (scrollPtr->vertical) { + if (MOUNTAIN_LION_STYLE) { + info.value = factor * scrollPtr->firstFraction; + } else { info.value = info.max - factor * scrollPtr->firstFraction; + } } else { info.value = MIN_SCROLLBAR_VALUE + factor * scrollPtr->firstFraction; } diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 869f717..2a88422 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -657,6 +657,65 @@ XConfigureWindow( /* *---------------------------------------------------------------------- * + * TkMacOSXSetDrawingEnabled -- + * + * This function sets the TK_DO_NOT_DRAW flag for a given window and + * all of its children. + * + * Results: + * None. + * + * Side effects: + * The clipping regions for the window and its children are cleared. + * + *---------------------------------------------------------------------- + */ + +void +TkMacOSXSetDrawingEnabled( + TkWindow *winPtr, + int flag) +{ + TkWindow *childPtr; + MacDrawable *macWin = winPtr->privatePtr; + + if (macWin) { + if (flag ) { + macWin->flags &= ~TK_DO_NOT_DRAW; + } else { + macWin->flags |= TK_DO_NOT_DRAW; + } + } + + /* + * Set the flag for all children & their descendants, excluding + * Toplevels. (??? Do we need to exclude Toplevels?) + */ + + childPtr = winPtr->childList; + while (childPtr) { + if (!Tk_IsTopLevel(childPtr)) { + TkMacOSXSetDrawingEnabled(childPtr, flag); + } + childPtr = childPtr->nextPtr; + } + + /* + * If the window is a container, set the flag for its embedded window. + */ + + if (Tk_IsContainer(winPtr)) { + childPtr = TkpGetOtherWindow(winPtr); + + if (childPtr) { + TkMacOSXSetDrawingEnabled(childPtr, flag); + } + } +} + +/* + *---------------------------------------------------------------------- + * * TkMacOSXUpdateClipRgn -- * * This function updates the clipping regions for a given window and all of diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 2e7c041..15e86ca 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -29,7 +29,7 @@ * Declaration of functions used only in this file */ -static int GenerateUpdates(HIMutableShapeRef updateRgn, +static int GenerateUpdates(HIShapeRef updateRgn, CGRect *updateBounds, TkWindow *winPtr); static int GenerateActivateEvents(TkWindow *winPtr, int activeFlag); @@ -315,7 +315,7 @@ extern BOOL opaqueTag; static int GenerateUpdates( - HIMutableShapeRef updateRgn, + HIShapeRef updateRgn, CGRect *updateBounds, TkWindow *winPtr) { @@ -782,7 +782,8 @@ Tk_MacOSXIsAppInFront(void) @interface TKContentView(TKWindowEvent) - (void) drawRect: (NSRect) rect; -- (void) generateExposeEvents: (HIMutableShapeRef) shape; +- (void) generateExposeEvents: (HIShapeRef) shape; +- (void) generateExposeEvents: (HIShapeRef) shape childrenOnly: (int) childrenOnly; - (void) viewDidEndLiveResize; - (void) tkToolbarButton: (id) sender; - (BOOL) isOpaque; @@ -804,6 +805,15 @@ ExposeRestrictProc( ? TK_PROCESS_EVENT : TK_DEFER_EVENT); } +/*Restrict event processing to ConfigureNotify events.*/ +static Tk_RestrictAction +ConfigureRestrictProc( + ClientData arg, + XEvent *eventPtr) +{ + return (eventPtr->type==ConfigureNotify ? TK_PROCESS_EVENT : TK_DEFER_EVENT); +} + @implementation TKContentView(TKWindowEvent) - (void) drawRect: (NSRect) rect @@ -829,11 +839,12 @@ ExposeRestrictProc( HIShapeUnionWithRect(drawShape, &r); } if (CFRunLoopGetMain() == CFRunLoopGetCurrent()) { - [self generateExposeEvents:drawShape]; + [self generateExposeEvents:(HIShapeRef)drawShape]; } else { [self performSelectorOnMainThread:@selector(generateExposeEvents:) withObject:(id)drawShape waitUntilDone:NO modes:[NSArray arrayWithObjects:NSRunLoopCommonModes, + NSEventTrackingRunLoopMode, NSModalPanelRunLoopMode, nil]]; } @@ -844,25 +855,37 @@ ExposeRestrictProc( -(void) setFrameSize: (NSSize)newsize { if ( [self inLiveResize] ) { - NSWindow *window = [self window]; - TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); + NSWindow *w = [self window]; + TkWindow *winPtr = TkMacOSXGetTkWindow(w); Tk_Window tkwin = (Tk_Window) winPtr; unsigned int width = (unsigned int)newsize.width; unsigned int height=(unsigned int)newsize.height; + ClientData oldArg; + Tk_RestrictProc *oldProc; + + /* Resize the NSView */ + [super setFrameSize: newsize]; - /* Resize the Tk Window to the requested size.*/ + /* Disable drawing until the window has been completely configured.*/ + TkMacOSXSetDrawingEnabled(winPtr, 0); + + /* Generate and handle a ConfigureNotify event for the new size.*/ TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height, TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY); + oldProc = Tk_RestrictEvents(ConfigureRestrictProc, NULL, &oldArg); + while ( Tk_DoOneEvent(TK_X_EVENTS|TK_DONT_WAIT) ) {} + Tk_RestrictEvents(oldProc, oldArg, &oldArg); - /* Then resize the NSView to the actual window size*/ - newsize.width = (CGFloat)Tk_Width(tkwin); - newsize.height = (CGFloat)Tk_Height(tkwin); - [super setFrameSize: newsize]; - - /* Process all pending events to update the window. */ - while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {} - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} + /* Now that Tk has configured all subwindows we can create the clip regions. */ + TkMacOSXSetDrawingEnabled(winPtr, 1); + TkMacOSXInvalClipRgns(tkwin); + TkMacOSXUpdateClipRgn(winPtr); + /* Finally, generate and process expose events to redraw the window. */ + HIRect bounds = NSRectToCGRect([self bounds]); + HIShapeRef shape = HIShapeCreateWithRect(&bounds); + [self generateExposeEvents: shape]; + while ( Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT) ) {} } else { [super setFrameSize: newsize]; } @@ -878,49 +901,48 @@ ExposeRestrictProc( { HIRect bounds = NSRectToCGRect([self bounds]); HIShapeRef shape = HIShapeCreateWithRect(&bounds); + [super viewDidEndLiveResize]; [self generateExposeEvents: shape]; } -/*Core function of this class, generates expose events for redrawing.*/ -- (void) generateExposeEvents: (HIMutableShapeRef) shape +/* Core method of this class: generates expose events for redrawing. + * Whereas drawRect is intended to be called only from the Appkit event + * loop, this can be called from Tk. If the Tcl_ServiceMode is set to + * TCL_SERVICE_ALL then the expose events will be immediately removed + * from the Tcl event loop and processed. Typically, they should be queued, + * however. + */ +- (void) generateExposeEvents: (HIShapeRef) shape +{ + [self generateExposeEvents:shape childrenOnly:0]; +} + +- (void) generateExposeEvents: (HIShapeRef) shape + childrenOnly: (int) childrenOnly { TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); unsigned long serial; CGRect updateBounds; + int updatesNeeded; if (!winPtr) { return; } + /* Generate Tk Expose events. */ HIShapeGetBounds(shape, &updateBounds); + /* All of these events will share the same serial number. */ serial = LastKnownRequestProcessed(Tk_Display(winPtr)); - if (GenerateUpdates(shape, &updateBounds, winPtr) && - ![[NSRunLoop currentRunLoop] currentMode] && - Tcl_GetServiceMode() != TCL_SERVICE_NONE) { - /* - * Ensure there are no pending idle-time redraws that could - * prevent the just posted Expose events from generating - * new redraws. - */ - - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} - - /* - * For smoother drawing, process Expose events and resulting - * redraws immediately instead of at idle time. - */ - - ClientData oldArg; + updatesNeeded = GenerateUpdates(shape, &updateBounds, winPtr); + + /* Process the Expose events if the service mode is TCL_SERVICE_ALL */ + if (updatesNeeded && Tcl_GetServiceMode() == TCL_SERVICE_ALL) { + ClientData oldArg; Tk_RestrictProc *oldProc = Tk_RestrictEvents(ExposeRestrictProc, UINT2PTR(serial), &oldArg); - while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {} - Tk_RestrictEvents(oldProc, oldArg, &oldArg); - - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} } - } /* @@ -936,7 +958,6 @@ ExposeRestrictProc( int x, y; TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); Tk_Window tkwin = (Tk_Window) winPtr; - bzero(&event, sizeof(XVirtualEvent)); event.type = VirtualEvent; event.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); -- cgit v0.12 From d10216afc1dcddd76f93bcdbb6e87bdca8dc7453 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Thu, 9 Apr 2015 02:00:59 +0000 Subject: Re-working of internal Cocoa widget drawing routines, especially when resizing; fix rendering of scrollbar when resized or clipped; cleanup of button metrics; thanks to Marc Culler for extensive patches --- generic/tkCanvas.c | 13 ++++++ generic/tkInt.decls | 3 ++ generic/tkIntPlatDecls.h | 6 ++- generic/tkTextDisp.c | 29 ++++++------- macosx/tkMacOSXButton.c | 21 +++++---- macosx/tkMacOSXDraw.c | 95 ++++++++++++++++++++++++++++++---------- macosx/tkMacOSXInt.h | 2 +- macosx/tkMacOSXMouseEvent.c | 6 --- macosx/tkMacOSXNotify.c | 27 ++++++++---- macosx/tkMacOSXScrlbr.c | 89 +++++++++++++++++++++----------------- macosx/tkMacOSXSubwindows.c | 59 +++++++++++++++++++++++++ macosx/tkMacOSXWindowEvent.c | 101 +++++++++++++++++++++++++------------------ 12 files changed, 307 insertions(+), 144 deletions(-) diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 14fe1ab..8ebe9ba 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -2101,6 +2101,19 @@ DisplayCanvas( goto done; } +#ifdef MAC_OSX_TK + /* + * If drawing is disabled, all we need to do is + * clear the REDRAW_PENDING flag. + */ + TkWindow *winPtr = (TkWindow *)(canvasPtr->tkwin); + MacDrawable *macWin = winPtr->privatePtr; + if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){ + canvasPtr->flags &= ~REDRAW_PENDING; + return; + } +#endif + /* * Choose a new current item if that is needed (this could cause event * handlers to be invoked). diff --git a/generic/tkInt.decls b/generic/tkInt.decls index ab56bed..7921852 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -956,6 +956,9 @@ declare 50 aqua { declare 51 aqua { void TkGenWMDestroyEvent(Tk_Window tkwin) } +declare 52 aqua { + TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); +} # removed duplicate from tkPlat table (tk.decls) #declare 52 aqua { diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index b377173..7654b5d 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -520,7 +520,11 @@ EXTERN int TkGenerateButtonEvent(int x, int y, Window window, /* 51 */ EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); #endif -/* Slot 52 is reserved */ +#ifndef TkMacOSXSetDrawingEnabled_TCL_DECLARED +#define TkMacOSXSetDrawingEnabled_TCL_DECLARED +/* 52 */ +EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); +#endif #ifndef TkpGetMS_TCL_DECLARED #define TkpGetMS_TCL_DECLARED /* 53 */ diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index bcbb03a..fc7b46b 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -3946,6 +3946,19 @@ DisplayText( * warnings. */ Tcl_Interp *interp; +#ifdef MAC_OSX_TK + /* + * If drawing is disabled, all we need to do is + * clear the REDRAW_PENDING flag. + */ + TkWindow *winPtr = (TkWindow *)(textPtr->tkwin); + MacDrawable *macWin = winPtr->privatePtr; + if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){ + dInfoPtr->flags &= ~REDRAW_PENDING; + return; + } +#endif + if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { /* * The widget has been deleted. Don't do anything. @@ -3961,14 +3974,6 @@ DisplayText( Tcl_SetVar2(interp, "tk_textRelayout", NULL, "", TCL_GLOBAL_ONLY); } - if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { - /* - * The widget has been deleted. Don't do anything. - */ - - goto end; - } - if (!Tk_IsMapped(textPtr->tkwin) || (dInfoPtr->maxX <= dInfoPtr->x) || (dInfoPtr->maxY <= dInfoPtr->y)) { UpdateDisplayInfo(textPtr); @@ -3980,14 +3985,6 @@ DisplayText( Tcl_SetVar2(interp, "tk_textRedraw", NULL, "", TCL_GLOBAL_ONLY); } - if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { - /* - * The widget has been deleted. Don't do anything. - */ - - goto end; - } - /* * Choose a new current item if that is needed (this could cause event * handlers to be invoked, hence the preserve/release calls and the loop, diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index c1dec90..adb78c6 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -30,10 +30,10 @@ * Default insets for controls */ -#define DEF_INSET_LEFT 2 -#define DEF_INSET_RIGHT 2 -#define DEF_INSET_TOP 2 -#define DEF_INSET_BOTTOM 4 +#define DEF_INSET_LEFT 12 +#define DEF_INSET_RIGHT 12 +#define DEF_INSET_TOP 1 +#define DEF_INSET_BOTTOM 1 /* * Some defines used to control what type of control is drawn. @@ -318,8 +318,8 @@ TkpComputeButtonGeometry( Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength, butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight); - txtWidth = butPtr->textWidth; - txtHeight = butPtr->textHeight; + txtWidth = butPtr->textWidth + DEF_INSET_LEFT + DEF_INSET_RIGHT; + txtHeight = butPtr->textHeight + DEF_INSET_BOTTOM + DEF_INSET_TOP; charWidth = Tk_TextWidth(butPtr->tkfont, "0", 1); Tk_GetFontMetrics(butPtr->tkfont, &fm); haveText = (txtWidth != 0 && txtHeight != 0); @@ -647,7 +647,7 @@ DrawButtonImageAndText( butPtr->textHeight, &x, &y); x += butPtr->indicatorSpace; Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout, - x, y, 0, -1); + x, y - DEF_INSET_BOTTOM, 0, -1); } /* @@ -807,9 +807,12 @@ TkMacOSXDrawButton( hiinfo.animation.time.start = hiinfo.animation.time.current; } - HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal, &contHIRec); + HIThemeDrawButton(&cntrRect, &hiinfo, dc.context, kHIThemeOrientationNormal, + &contHIRec); + TkMacOSXRestoreDrawingContext(&dc); - ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, (MacButton *)mbPtr, 32, true); + ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, + (MacButton *)mbPtr, 32, true); } else { if (!TkMacOSXSetupDrawingContext(pixmap, dpPtr->gc, 1, &dc)) { diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index c1ffdf8..3f51d00 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -222,7 +222,8 @@ XCopyArea( } if (!TkMacOSXSetupDrawingContext(dst, gc, 1, &dc)) { - TkMacOSXDbgMsg("Failed to setup drawing context."); + return; + /*TkMacOSXDbgMsg("Failed to setup drawing context.");*/ } if ( dc.context ) { @@ -243,6 +244,8 @@ XCopyArea( CGRectMake(src_x, src_y, width, height), CGRectMake(dest_x, dest_y, width, height)); CFRelease(img); + + } else { TkMacOSXDbgMsg("Failed to construct CGImage."); } @@ -652,9 +655,9 @@ GetCGContextForDrawable( CGColorSpaceRef colorspace = NULL; CGBitmapInfo bitmapInfo = #ifdef __LITTLE_ENDIAN__ - kCGBitmapByteOrder32Host; + kCGBitmapByteOrder32Host; #else - kCGBitmapByteOrderDefault; + kCGBitmapByteOrderDefault; #endif char *data; CGRect bounds = CGRectMake(0, 0, macDraw->size.width, @@ -731,6 +734,7 @@ DrawCGImage( } } dstBounds = CGRectOffset(dstBounds, macDraw->xOff, macDraw->yOff); + if (CGImageIsMask(image)) { /*CGContextSaveGState(context);*/ if (macDraw->flags & TK_IS_BW_PIXMAP) { @@ -1474,51 +1478,94 @@ TkScrollWindow( TkRegion damageRgn) /* Region to accumulate damage in. */ { Drawable drawable = Tk_WindowId(tkwin); - MacDrawable *macDraw = (MacDrawable *) drawable; + MacDrawable *macDraw = (MacDrawable *) drawable; NSView *view = TkMacOSXDrawableView(macDraw); CGRect srcRect, dstRect; - HIShapeRef dmgRgn = NULL, extraRgn; + HIShapeRef dmgRgn = NULL, extraRgn = NULL; NSRect bounds, visRect, scrollSrc, scrollDst; - int result; - + int result = 0; + if ( view ) { /* Get the scroll area in NSView coordinates (origin at bottom left). */ bounds = [view bounds]; scrollSrc = NSMakeRect( - macDraw->xOff + x, + macDraw->xOff + x, bounds.size.height - height - (macDraw->yOff + y), width, height); scrollDst = NSOffsetRect(scrollSrc, dx, -dy); + /* Limit scrolling to the window content area. */ visRect = [view visibleRect]; scrollSrc = NSIntersectionRect(scrollSrc, visRect); scrollDst = NSIntersectionRect(scrollDst, visRect); - if ( !NSIsEmptyRect(scrollSrc) && !NSIsEmptyRect(scrollDst) ) { - + /* * Mark the difference between source and destination as damaged. - * This region is described in the Tk coordinate system. + * This region is described in NSView coordinates (y=0 at the bottom) + * and converted to Tk coordinates later. */ - - srcRect = CGRectMake(x, y, width, height); - dstRect = CGRectOffset(srcRect, dx, dy); + + srcRect = CGRectMake(x, y, width, height); + dstRect = CGRectOffset(srcRect, dx, dy); + + /* Expand the rectangles slightly to avoid degeneracies. */ + srcRect.origin.y -= 1; + srcRect.size.height += 2; + dstRect.origin.y += 1; + dstRect.size.height -= 2; + + /* Compute the damage. */ dmgRgn = HIShapeCreateMutableWithRect(&srcRect); extraRgn = HIShapeCreateWithRect(&dstRect); ChkErr(HIShapeDifference, dmgRgn, extraRgn, (HIMutableShapeRef) dmgRgn); - CFRelease(extraRgn); - + result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; + + /* Convert to Tk coordinates. */ + TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); + if (extraRgn) { + CFRelease(extraRgn); + } + /* Scroll the rectangle. */ [view scrollRect:scrollSrc by:NSMakeSize(dx, -dy)]; + + /* Shift the Tk children which meet the source rectangle. */ + TkWindow *winPtr = (TkWindow *)tkwin; + TkWindow *childPtr; + CGRect childBounds; + for (childPtr = winPtr->childList; childPtr != NULL; childPtr = childPtr->nextPtr) { + if (Tk_IsMapped(childPtr) && !Tk_IsTopLevel(childPtr)) { + TkMacOSXWinCGBounds(childPtr, &childBounds); + if (CGRectIntersectsRect(srcRect, childBounds)) { + MacDrawable *macChild = childPtr->privatePtr; + if (macChild) { + macChild->yOff += dy; + macChild->xOff += dx; + childPtr->changes.y = macChild->yOff; + childPtr->changes.x = macChild->xOff; + } + } + } + } + + /* Queue up Expose events for the damage region. */ + int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE); + [view generateExposeEvents:dmgRgn childrenOnly:1]; + Tcl_SetServiceMode(oldMode); + + /* Belt and suspenders: make the AppKit request a redraw + when it gets control again. */ + [view setNeedsDisplay:YES]; } + } else { + dmgRgn = HIShapeCreateEmpty(); + TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); } - - if ( dmgRgn == NULL ) { - dmgRgn = HIShapeCreateEmpty(); + + if (dmgRgn) { + CFRelease(dmgRgn); } - TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); - result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; - CFRelease(dmgRgn); return result; } @@ -1853,6 +1900,7 @@ TkpClipDrawableToRect( CFRelease(macDraw->drawRgn); macDraw->drawRgn = NULL; } + if (width >= 0 && height >= 0) { CGRect clipRect = CGRectMake(x + macDraw->xOff, y + macDraw->yOff, width, height); @@ -2000,7 +2048,7 @@ TkpDrawHighlightBorder ( * TkpDrawFrame -- * * This procedure draws the rectangular frame area. If the user - * has request themeing, it draws with a the background theme. + * has requested themeing, it draws with the background theme. * * Results: * None. @@ -2030,6 +2078,7 @@ TkpDrawFrame( border = themedBorder; } } + Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, highlightWidth, highlightWidth, Tk_Width(tkwin) - 2 * highlightWidth, diff --git a/macosx/tkMacOSXInt.h b/macosx/tkMacOSXInt.h index 249d5cf..6971e26 100644 --- a/macosx/tkMacOSXInt.h +++ b/macosx/tkMacOSXInt.h @@ -86,7 +86,7 @@ typedef struct TkWindowPrivate MacDrawable; #define TK_FOCUSED_VIEW 0x10 #define TK_IS_PIXMAP 0x20 #define TK_IS_BW_PIXMAP 0x40 - +#define TK_DO_NOT_DRAW 0x80 /* * I am reserving TK_EMBEDDED = 0x100 in the MacDrawable flags * This is defined in tk.h. We need to duplicate the TK_EMBEDDED flag in the diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index d1b4114..10a615e 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -102,12 +102,6 @@ enum { return theEvent; /* Give up. No window for this event. */ } - /* - MacDrawable *macWin = (MacDrawable *) window; - NSView *view = TkMacOSXDrawableView(macWin); - local = [view convertPoint:local fromView:nil]; - local.y = NSHeight([view bounds]) - local.y; - */ TkWindow *winPtr = (TkWindow *) tkwin; local.x -= winPtr->wmInfoPtr->xInParent; local.y -= winPtr->wmInfoPtr->yInParent; diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index cc1ba06..4cfb5a9 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -49,17 +49,17 @@ static void TkMacOSXEventsCheckProc(ClientData clientData, int flags); @end @implementation TKApplication(TKNotify) -/* Redisplay all of our windows, then call super. */ +/* Call super then redisplay all of our windows. */ - (NSEvent *)nextEventMatchingMask:(NSUInteger)mask untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - [NSApp makeWindowsPerform:@selector(tkDisplayIfNeeded) inOrder:NO]; - [pool drain]; NSEvent *event = [super nextEventMatchingMask:mask untilDate:expiration inMode:mode dequeue:deqFlag]; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + [NSApp makeWindowsPerform:@selector(tkDisplayIfNeeded) inOrder:NO]; + [pool drain]; return event; } @@ -220,7 +220,7 @@ TkMacOSXEventsSetupProc( untilDate:[NSDate distantPast] inMode:GetRunLoopMode(TkMacOSXGetModalSession()) dequeue:NO]; - if (currentEvent) { + if (currentEvent && currentEvent.type > 0) { Tcl_SetMaxBlockTime(&zeroBlockTime); } } @@ -248,19 +248,30 @@ TkMacOSXEventsCheckProc( ClientData clientData, int flags) { - if (flags & TCL_WINDOW_EVENTS && - ![[NSRunLoop currentRunLoop] currentMode]) { + NSString *runloopMode = [[NSRunLoop currentRunLoop] currentMode]; + if (flags & TCL_WINDOW_EVENTS && !runloopMode) { + NSEvent *currentEvent = nil; + NSEvent *testEvent = nil; NSModalSession modalSession; do { modalSession = TkMacOSXGetModalSession(); + testEvent = [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:[NSDate distantPast] + inMode:GetRunLoopMode(modalSession) + dequeue:NO]; + /* We must not steal any events during LiveResize. */ + if (testEvent && [[testEvent window] inLiveResize]) { + break; + } + currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:GetRunLoopMode(modalSession) dequeue:YES]; if (!currentEvent) { - break; /* No more events. */ + break; /* No events are available. */ } NSAutoreleasePool *pool = [NSAutoreleasePool new]; /* Generate Xevents. */ diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index bc93b79..7dde501 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -26,6 +26,7 @@ #define RangeToFactor(maximum) (((double) (LONG_MAX >> 1)) / (maximum)) #endif /* __LP64__ */ +#define MOUNTAIN_LION_STYLE (NSAppKitVersionNumber < 1138) /* * Declaration of Mac specific scrollbar structure. @@ -80,7 +81,6 @@ static void ScrollbarEventProc(ClientData clientData, XEvent *eventPtr); static int ScrollbarPress(TkScrollbar *scrollPtr, XEvent *eventPtr); static void UpdateControlValues(TkScrollbar *scrollPtr); - /* *---------------------------------------------------------------------- * @@ -136,27 +136,26 @@ TkpDisplayScrollbar( { register TkScrollbar *scrollPtr = (TkScrollbar *) clientData; register Tk_Window tkwin = scrollPtr->tkwin; - - - if ((scrollPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { + TkWindow *winPtr = (TkWindow *) tkwin; + TkMacOSXDrawingContext dc; + + scrollPtr->flags &= ~REDRAW_PENDING; + + if (tkwin == NULL || !Tk_IsMapped(tkwin)) { return; } - TkWindow *winPtr = (TkWindow *) tkwin; MacDrawable *macWin = (MacDrawable *) winPtr->window; - TkMacOSXDrawingContext dc; NSView *view = TkMacOSXDrawableView(macWin); + if (!view || + macWin->flags & TK_DO_NOT_DRAW || + !TkMacOSXSetupDrawingContext((Drawable) macWin, NULL, 1, &dc)) { + return; + } + CGFloat viewHeight = [view bounds].size.height; CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1, .tx = 0, .ty = viewHeight}; - - - scrollPtr->flags &= ~REDRAW_PENDING; - if (!scrollPtr->tkwin || !Tk_IsMapped(tkwin) || !view || - !TkMacOSXSetupDrawingContext((Drawable) macWin, NULL, 1, &dc)) { - return; - } - CGContextConcatCTM(dc.context, t); /*Draw Unix-style scroll trough to provide rect for native scrollbar.*/ @@ -173,7 +172,6 @@ TkpDisplayScrollbar( (Pixmap) macWin); } - Tk_Draw3DRectangle(tkwin, (Pixmap) macWin, scrollPtr->bgBorder, scrollPtr->highlightWidth, scrollPtr->highlightWidth, Tk_Width(tkwin) - 2*scrollPtr->highlightWidth, @@ -186,15 +184,11 @@ TkpDisplayScrollbar( /*Update values and draw in native rect.*/ UpdateControlValues(scrollPtr); -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 - if (scrollPtr->vertical) { - HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); - } else { + if (MOUNTAIN_LION_STYLE) { HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationInverted); + } else { + HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); } -#else - HIThemeDrawTrack (&info, 0, dc.context, kHIThemeOrientationNormal); -#endif TkMacOSXRestoreDrawingContext(&dc); scrollPtr->flags &= ~REDRAW_PENDING; @@ -265,11 +259,12 @@ TkpComputeScrollbarGeometry( if (scrollPtr->sliderLast > fieldLength) { scrollPtr->sliderLast = fieldLength; } - scrollPtr->sliderFirst += scrollPtr->inset + + if (!(MOUNTAIN_LION_STYLE)) { + scrollPtr->sliderFirst += scrollPtr->inset + metrics[variant].topArrowHeight; - scrollPtr->sliderLast += scrollPtr->inset + + scrollPtr->sliderLast += scrollPtr->inset + metrics[variant].bottomArrowHeight; - + } /* * Register the desired geometry for the window (leave enough space * for the two arrows plus a minimum-size slider, plus border around @@ -370,21 +365,29 @@ TkpScrollbarPosition( int x, int y) /* Coordinates within scrollPtr's window. */ { - /*Using code from tkUnixScrlbr.c because Unix scroll bindings are driving the display at the script level. All the Mac scrollbar has to do is re-draw itself.*/ - - int length, width, tmp; + /* + * Using code from tkUnixScrlbr.c because Unix scroll bindings are + * driving the display at the script level. All the Mac scrollbar + * has to do is re-draw itself. + */ + + int length, fieldlength, width, tmp; register const int inset = scrollPtr->inset; + register const int arrowSize = scrollPtr->arrowLength + inset; if (scrollPtr->vertical) { length = Tk_Height(scrollPtr->tkwin); + fieldlength = length - 2 * arrowSize; width = Tk_Width(scrollPtr->tkwin); } else { tmp = x; x = y; y = tmp; length = Tk_Width(scrollPtr->tkwin); + fieldlength = length - 2 * arrowSize; width = Tk_Height(scrollPtr->tkwin); } + fieldlength = fieldlength < 0 ? 0 : fieldlength; if (x=width-inset || y=length-inset) { return OUTSIDE; @@ -395,19 +398,19 @@ TkpScrollbarPosition( * TkpDisplayScrollbar. Be sure to keep the two consistent. */ - if (y < inset + scrollPtr->arrowLength) { - return TOP_ARROW; - } if (y < scrollPtr->sliderFirst) { return TOP_GAP; } if (y < scrollPtr->sliderLast) { return SLIDER; } - if (y >= length - (scrollPtr->arrowLength + inset)) { - return BOTTOM_ARROW; + if (y < fieldlength){ + return BOTTOM_GAP; } - return BOTTOM_GAP; + if (y < fieldlength + arrowSize) { + return TOP_ARROW; + } + return BOTTOM_ARROW; } /* @@ -415,9 +418,11 @@ TkpScrollbarPosition( * * UpdateControlValues -- * - * This procedure updates the Macintosh scrollbar control to display the - * values defined by the Tk scrollbar. This is the key interface to the Mac-native * scrollbar; the Unix bindings drive scrolling in the Tk window and all the Mac - * scrollbar has to do is redraw itself. + * This procedure updates the Macintosh scrollbar control to + * display the values defined by the Tk scrollbar. This is the + * key interface to the Mac-native * scrollbar; the Unix bindings + * drive scrolling in the Tk window and all the Mac scrollbar has + * to do is redraw itself. * * Results: * None. @@ -462,8 +467,10 @@ UpdateControlValues( */ info.bounds = contrlRect; - if (!scrollPtr->vertical) { - info.attributes |= kThemeTrackHorizontal; + if (scrollPtr->vertical) { + info.attributes &= ~kThemeTrackHorizontal; + } else { + info.attributes |= kThemeTrackHorizontal; } /* @@ -484,7 +491,11 @@ UpdateControlValues( factor - dViewSize; info.trackInfo.scrollbar.viewsize = dViewSize; if (scrollPtr->vertical) { + if (MOUNTAIN_LION_STYLE) { + info.value = factor * scrollPtr->firstFraction; + } else { info.value = info.max - factor * scrollPtr->firstFraction; + } } else { info.value = MIN_SCROLLBAR_VALUE + factor * scrollPtr->firstFraction; } diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index a9703c1..2f500fa 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -657,6 +657,65 @@ XConfigureWindow( /* *---------------------------------------------------------------------- * + * TkMacOSXSetDrawingEnabled -- + * + * This function sets the TK_DO_NOT_DRAW flag for a given window and + * all of its children. + * + * Results: + * None. + * + * Side effects: + * The clipping regions for the window and its children are cleared. + * + *---------------------------------------------------------------------- + */ + +void +TkMacOSXSetDrawingEnabled( + TkWindow *winPtr, + int flag) +{ + TkWindow *childPtr; + MacDrawable *macWin = winPtr->privatePtr; + + if (macWin) { + if (flag ) { + macWin->flags &= ~TK_DO_NOT_DRAW; + } else { + macWin->flags |= TK_DO_NOT_DRAW; + } + } + + /* + * Set the flag for all children & their descendants, excluding + * Toplevels. (??? Do we need to exclude Toplevels?) + */ + + childPtr = winPtr->childList; + while (childPtr) { + if (!Tk_IsTopLevel(childPtr)) { + TkMacOSXSetDrawingEnabled(childPtr, flag); + } + childPtr = childPtr->nextPtr; + } + + /* + * If the window is a container, set the flag for its embedded window. + */ + + if (Tk_IsContainer(winPtr)) { + childPtr = TkpGetOtherWindow(winPtr); + + if (childPtr) { + TkMacOSXSetDrawingEnabled(childPtr, flag); + } + } +} + +/* + *---------------------------------------------------------------------- + * * TkMacOSXUpdateClipRgn -- * * This function updates the clipping regions for a given window and all of diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index d68a933..ef3c86b 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -29,7 +29,7 @@ * Declaration of functions used only in this file */ -static int GenerateUpdates(HIMutableShapeRef updateRgn, +static int GenerateUpdates(HIShapeRef updateRgn, CGRect *updateBounds, TkWindow *winPtr); static int GenerateActivateEvents(TkWindow *winPtr, int activeFlag); @@ -316,7 +316,7 @@ extern BOOL opaqueTag; static int GenerateUpdates( - HIMutableShapeRef updateRgn, + HIShapeRef updateRgn, CGRect *updateBounds, TkWindow *winPtr) { @@ -784,7 +784,8 @@ Tk_MacOSXIsAppInFront(void) @interface TKContentView(TKWindowEvent) - (void) drawRect: (NSRect) rect; -- (void) generateExposeEvents: (HIMutableShapeRef) shape; +- (void) generateExposeEvents: (HIShapeRef) shape; +- (void) generateExposeEvents: (HIShapeRef) shape childrenOnly: (int) childrenOnly; - (void) viewDidEndLiveResize; - (void) tkToolbarButton: (id) sender; - (BOOL) isOpaque; @@ -806,6 +807,15 @@ ExposeRestrictProc( ? TK_PROCESS_EVENT : TK_DEFER_EVENT); } +/*Restrict event processing to ConfigureNotify events.*/ +static Tk_RestrictAction +ConfigureRestrictProc( + ClientData arg, + XEvent *eventPtr) +{ + return (eventPtr->type==ConfigureNotify ? TK_PROCESS_EVENT : TK_DEFER_EVENT); +} + @implementation TKContentView(TKWindowEvent) - (void) drawRect: (NSRect) rect @@ -832,11 +842,12 @@ ExposeRestrictProc( HIShapeUnionWithRect(drawShape, &r); } if (CFRunLoopGetMain() == CFRunLoopGetCurrent()) { - [self generateExposeEvents:drawShape]; + [self generateExposeEvents:(HIShapeRef)drawShape]; } else { [self performSelectorOnMainThread:@selector(generateExposeEvents:) withObject:(id)drawShape waitUntilDone:NO modes:[NSArray arrayWithObjects:NSRunLoopCommonModes, + NSEventTrackingRunLoopMode, NSModalPanelRunLoopMode, nil]]; } @@ -848,25 +859,37 @@ ExposeRestrictProc( -(void) setFrameSize: (NSSize)newsize { if ( [self inLiveResize] ) { - NSWindow *window = [self window]; - TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); + NSWindow *w = [self window]; + TkWindow *winPtr = TkMacOSXGetTkWindow(w); Tk_Window tkwin = (Tk_Window) winPtr; unsigned int width = (unsigned int)newsize.width; unsigned int height=(unsigned int)newsize.height; + ClientData oldArg; + Tk_RestrictProc *oldProc; + + /* Resize the NSView */ + [super setFrameSize: newsize]; - /* Resize the Tk Window to the requested size.*/ + /* Disable drawing until the window has been completely configured.*/ + TkMacOSXSetDrawingEnabled(winPtr, 0); + + /* Generate and handle a ConfigureNotify event for the new size.*/ TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height, TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY); + oldProc = Tk_RestrictEvents(ConfigureRestrictProc, NULL, &oldArg); + while ( Tk_DoOneEvent(TK_X_EVENTS|TK_DONT_WAIT) ) {} + Tk_RestrictEvents(oldProc, oldArg, &oldArg); - /* Then resize the NSView to the actual window size*/ - newsize.width = (CGFloat)Tk_Width(tkwin); - newsize.height = (CGFloat)Tk_Height(tkwin); - [super setFrameSize: newsize]; - - /* Process all pending events to update the window. */ - while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {} - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} + /* Now that Tk has configured all subwindows we can create the clip regions. */ + TkMacOSXSetDrawingEnabled(winPtr, 1); + TkMacOSXInvalClipRgns(tkwin); + TkMacOSXUpdateClipRgn(winPtr); + /* Finally, generate and process expose events to redraw the window. */ + HIRect bounds = NSRectToCGRect([self bounds]); + HIShapeRef shape = HIShapeCreateWithRect(&bounds); + [self generateExposeEvents: shape]; + while ( Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT) ) {} } else { [super setFrameSize: newsize]; } @@ -882,52 +905,49 @@ ExposeRestrictProc( { HIRect bounds = NSRectToCGRect([self bounds]); HIShapeRef shape = HIShapeCreateWithRect(&bounds); + [super viewDidEndLiveResize]; [self generateExposeEvents: shape]; } - -/*Core function of this class, generates expose events for redrawing.*/ -- (void) generateExposeEvents: (HIMutableShapeRef) shape +/* Core method of this class: generates expose events for redrawing. + * Whereas drawRect is intended to be called only from the Appkit event + * loop, this can be called from Tk. If the Tcl_ServiceMode is set to + * TCL_SERVICE_ALL then the expose events will be immediately removed + * from the Tcl event loop and processed. Typically, they should be queued, + * however. + */ +- (void) generateExposeEvents: (HIShapeRef) shape { + [self generateExposeEvents:shape childrenOnly:0]; +} +- (void) generateExposeEvents: (HIShapeRef) shape + childrenOnly: (int) childrenOnly +{ TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); unsigned long serial; CGRect updateBounds; + int updatesNeeded; if (!winPtr) { return; } + /* Generate Tk Expose events. */ HIShapeGetBounds(shape, &updateBounds); + /* All of these events will share the same serial number. */ serial = LastKnownRequestProcessed(Tk_Display(winPtr)); - if (GenerateUpdates(shape, &updateBounds, winPtr) && - ![[NSRunLoop currentRunLoop] currentMode] && - Tcl_GetServiceMode() != TCL_SERVICE_NONE) { - /* - * Ensure there are no pending idle-time redraws that could - * prevent the just posted Expose events from generating - * new redraws. - */ - - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} - - /* - * For smoother drawing, process Expose events and resulting - * redraws immediately instead of at idle time. - */ - - ClientData oldArg; + updatesNeeded = GenerateUpdates(shape, &updateBounds, winPtr); + + /* Process the Expose events if the service mode is TCL_SERVICE_ALL */ + if (updatesNeeded && Tcl_GetServiceMode() == TCL_SERVICE_ALL) { + ClientData oldArg; Tk_RestrictProc *oldProc = Tk_RestrictEvents(ExposeRestrictProc, UINT2PTR(serial), &oldArg); - while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) {} - Tk_RestrictEvents(oldProc, oldArg, &oldArg); - - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT)) {} } - } /* @@ -943,7 +963,6 @@ ExposeRestrictProc( int x, y; TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); Tk_Window tkwin = (Tk_Window) winPtr; - bzero(&event, sizeof(XVirtualEvent)); event.type = VirtualEvent; event.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); -- cgit v0.12 From bd5f98d30fa3fccd6ba5e1d106b1bfd55f1ede2e Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Thu, 9 Apr 2015 22:15:18 +0000 Subject: Small patch for menubtton demo on OS X; thanks to Marc Culler --- library/menu.tcl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/menu.tcl b/library/menu.tcl index d05740f..cd05207 100644 --- a/library/menu.tcl +++ b/library/menu.tcl @@ -313,6 +313,9 @@ proc ::tk::MbPost {w {x {}} {y {}}} { set x [expr {[winfo rootx $w] - [winfo reqwidth $menu]}] set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}] set entry [MenuFindName $menu [$w cget -text]] + if {$entry eq ""} { + set entry 0 + } if {[$w cget -indicatoron]} { if {$entry == [$menu index last]} { incr y [expr {-([$menu yposition $entry] \ @@ -333,6 +336,9 @@ proc ::tk::MbPost {w {x {}} {y {}}} { set x [expr {[winfo rootx $w] + [winfo width $w]}] set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}] set entry [MenuFindName $menu [$w cget -text]] + if {$entry eq ""} { + set entry 0 + } if {[$w cget -indicatoron]} { if {$entry == [$menu index last]} { incr y [expr {-([$menu yposition $entry] \ -- cgit v0.12 From 8ddaa831ca302ae37df69efe436d6cd99b368dbf Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Thu, 9 Apr 2015 22:16:06 +0000 Subject: Small patch for menubtton demo on OS X; thanks to Marc Culler --- library/menu.tcl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/menu.tcl b/library/menu.tcl index 8b29f00..fd814b3 100644 --- a/library/menu.tcl +++ b/library/menu.tcl @@ -312,6 +312,9 @@ proc ::tk::MbPost {w {x {}} {y {}}} { set x [expr {[winfo rootx $w] - [winfo reqwidth $menu]}] set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}] set entry [MenuFindName $menu [$w cget -text]] + if {$entry eq ""} { + set entry 0 + } if {[$w cget -indicatoron]} { if {$entry == [$menu index last]} { incr y [expr {-([$menu yposition $entry] \ @@ -332,6 +335,9 @@ proc ::tk::MbPost {w {x {}} {y {}}} { set x [expr {[winfo rootx $w] + [winfo width $w]}] set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}] set entry [MenuFindName $menu [$w cget -text]] + if {$entry eq ""} { + set entry 0 + } if {[$w cget -indicatoron]} { if {$entry == [$menu index last]} { incr y [expr {-([$menu yposition $entry] \ -- cgit v0.12 From e6b0c3f882ca44d680a9306287c1b279ce16fa1e Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 26 Apr 2015 18:30:17 +0000 Subject: Fixed bug [3554052fff] by applying [b28d8aaa7c] to core-8-5-branch --- tests/textTag.test | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/textTag.test b/tests/textTag.test index dcec25d..be31ebb 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -599,6 +599,7 @@ set x3 [expr [lindex $c 0] + [lindex $c 2]/2] set y3 [expr [lindex $c 1] + [lindex $c 3]/2] test textTag-15.1 {TkTextBindProc} haveCourier12 { + event generate {} -warp 1 -x -1 -y -1; update bind .t {lappend x up} .t tag bind x {lappend x x-up} .t tag bind y {lappend x y-up} @@ -618,6 +619,7 @@ test textTag-15.1 {TkTextBindProc} haveCourier12 { set x } {x-up up up y-up up} test textTag-15.2 {TkTextBindProc} haveCourier12 { + event generate {} -warp 1 -x -1 -y -1; update catch {.t tag delete x} catch {.t tag delete y} .t tag bind x {lappend x x-enter} @@ -675,6 +677,7 @@ foreach tag [.t tag names] { } .t tag configure big -font $bigFont test textTag-16.1 {TkTextPickCurrent procedure} haveCourier12 { + event generate {} -warp 1 -x -1 -y -1; update event gen .t -state 0x100 -x $x1 -y $y1 set x [.t index current] event gen .t -x $x2 -y $y2 @@ -691,6 +694,7 @@ test textTag-16.1 {TkTextPickCurrent procedure} haveCourier12 { lappend x [.t index current] } {2.1 3.2 3.2 3.2 3.2 3.2 4.3} test textTag-16.2 {TkTextPickCurrent procedure} haveCourier12 { + event generate {} -warp 1 -x -1 -y -1; update event gen .t -state 0x100 -x $x1 -y $y1 event gen .t -x $x2 -y $y2 set x [.t index current] @@ -704,6 +708,7 @@ foreach i {a b c d} { .t tag bind $i "lappend x leave-$i" } test textTag-16.3 {TkTextPickCurrent procedure} haveCourier12 { + event generate {} -warp 1 -x -1 -y -1; update foreach i {a b c d} { .t tag remove $i 1.0 end } @@ -722,6 +727,7 @@ test textTag-16.3 {TkTextPickCurrent procedure} haveCourier12 { set x } {enter-a enter-b | leave-b enter-c | leave-a leave-c} test textTag-16.4 {TkTextPickCurrent procedure} haveCourier12 { + event generate {} -warp 1 -x -1 -y -1; update foreach i {a b c d} { .t tag remove $i 1.0 end } @@ -742,6 +748,7 @@ foreach i {a b c d} { .t tag delete $i } test textTag-16.5 {TkTextPickCurrent procedure} haveCourier12 { + event generate {} -warp 1 -x -1 -y -1; update foreach i {a b c d} { .t tag remove $i 1.0 end } @@ -752,6 +759,7 @@ test textTag-16.5 {TkTextPickCurrent procedure} haveCourier12 { .t index current } {3.2} test textTag-16.6 {TkTextPickCurrent procedure} haveCourier12 { + event generate {} -warp 1 -x -1 -y -1; update foreach i {a b c d} { .t tag remove $i 1.0 end } @@ -763,6 +771,7 @@ test textTag-16.6 {TkTextPickCurrent procedure} haveCourier12 { .t index current } {3.1} test textTag-16.7 {TkTextPickCurrent procedure} haveCourier12 { + event generate {} -warp 1 -x -1 -y -1; update foreach i {a b c d} { .t tag remove $i 1.0 end } @@ -785,6 +794,7 @@ test textTag-17.1 {insert procedure inserts tags} { catch {destroy .t} test textTag-18.1 {TkTextPickCurrent tag bindings} { + event generate {} -warp 1 -x -1 -y -1; update text .t -width 30 -height 4 -relief sunken -borderwidth 10 \ -highlightthickness 10 -pady 2 pack .t -- cgit v0.12 From d1dd76e66ac3f2e94f74fa863b4f90c76e278db4 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 5 May 2015 19:30:16 +0000 Subject: [3603436][06c3fcb136] Correction to earlier bugfix. When alpha values are all opaque, so that image format writers may use non-alpha supporting formats losslessly, make sure that message always gets back to the caller. --- generic/tkImgPhoto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 58c4484..780b0c2 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -5648,6 +5648,9 @@ ImgGetPhoto( break; } } + if (!alphaOffset) { + blockPtr->offset[3]= -1; /* Tell caller alpha need not be read */ + } greenOffset = blockPtr->offset[1] - blockPtr->offset[0]; blueOffset = blockPtr->offset[2] - blockPtr->offset[0]; if (((optPtr->options & OPT_BACKGROUND) && alphaOffset) || @@ -5766,9 +5769,6 @@ ImgGetPhoto( blockPtr->offset[2]= 0; blockPtr->offset[3]= 1; } - if (!alphaOffset) { - blockPtr->offset[3]= -1; - } return data; } return NULL; -- cgit v0.12 From 5f46d2f08eda1b81b09264e12b2fdf4a16342e2f Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 15 May 2015 12:03:25 +0000 Subject: Use assertion to prevent writing pixel lines beyond end of Photo image block. --- generic/tkImgPNG.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index d6a706a..8146e33 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -10,6 +10,7 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +#include "assert.h" #include "tkInt.h" #define PNG_INT32(a,b,c,d) \ @@ -1880,6 +1881,8 @@ DecodeLine( * Calculate offset into pixelPtr for the first pixel of the line. */ + assert(pngPtr->currentLine < pngPtr->block.height); + offset = pngPtr->currentLine * pngPtr->block.pitch; /* -- cgit v0.12 From a7faf9f8a33c55adb9081e5a27a31d2eae249638 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 15 May 2015 15:51:20 +0000 Subject: [dece631375] Prevent PNG Reader writing to memory beyond end of photo image block. --- generic/tkImgPNG.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index 8146e33..9d0fb30 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -2092,7 +2092,8 @@ ReadIDAT( * Process IDAT contents until there is no more in this chunk. */ - while (chunkSz && !Tcl_ZlibStreamEof(pngPtr->stream)) { + while (chunkSz && !Tcl_ZlibStreamEof(pngPtr->stream) + && pngPtr->currentLine < pngPtr->block.height) { int len1, len2; /* @@ -2178,10 +2179,13 @@ ReadIDAT( /* * Try to read another line of pixels out of the buffer - * immediately. + * immediately, but don't allow write past end of block. */ - goto getNextLine; + if (pngPtr->currentLine < pngPtr->block.height) { + goto getNextLine; + } + } /* -- cgit v0.12 From 348a58fe272f747f88db363b397cc98e8980e8e7 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 15 May 2015 19:26:36 +0000 Subject: [dece63137] Correct problems with overflow computing memory block sizes. --- generic/tkImgPhoto.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 63e2fa8..73a06b7 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -2051,8 +2051,8 @@ static int ToggleComplexAlphaIfNeeded( PhotoMaster *mPtr) { - size_t len = MAX(mPtr->userWidth, mPtr->width) * - MAX(mPtr->userHeight, mPtr->height) * 4; + size_t len = (size_t)MAX(mPtr->userWidth, mPtr->width) * + (size_t)MAX(mPtr->userHeight, mPtr->height) * 4; unsigned char *c = mPtr->pix32; unsigned char *end = c + len; @@ -2257,14 +2257,14 @@ ImgPhotoSetSize( if ((masterPtr->pix32 != NULL) && ((width == masterPtr->width) || (width == validBox.width))) { if (validBox.y > 0) { - memset(newPix32, 0, (size_t) (validBox.y * pitch)); + memset(newPix32, 0, ((size_t) validBox.y * pitch)); } h = validBox.y + validBox.height; if (h < height) { - memset(newPix32 + h*pitch, 0, (size_t) ((height - h) * pitch)); + memset(newPix32 + h*pitch, 0, ((size_t) (height - h) * pitch)); } } else { - memset(newPix32, 0, (size_t) (height * pitch)); + memset(newPix32, 0, ((size_t)height * pitch)); } if (masterPtr->pix32 != NULL) { @@ -2281,7 +2281,7 @@ ImgPhotoSetSize( offset = validBox.y * pitch; memcpy(newPix32 + offset, masterPtr->pix32 + offset, - (size_t) (validBox.height * pitch)); + ((size_t)validBox.height * pitch)); } else if ((validBox.width > 0) && (validBox.height > 0)) { /* @@ -2292,7 +2292,7 @@ ImgPhotoSetSize( srcPtr = masterPtr->pix32 + (validBox.y * masterPtr->width + validBox.x) * 4; for (h = validBox.height; h > 0; h--) { - memcpy(destPtr, srcPtr, (size_t) (validBox.width * 4)); + memcpy(destPtr, srcPtr, ((size_t)validBox.width * 4)); destPtr += width * 4; srcPtr += masterPtr->width * 4; } @@ -2772,7 +2772,7 @@ Tk_PhotoPutBlock( && (blockPtr->pitch == pitch))) && (compRule == TK_PHOTO_COMPOSITE_SET)) { memmove(destLinePtr, blockPtr->pixelPtr + blockPtr->offset[0], - (size_t) (height * width * 4)); + ((size_t)height * width * 4)); /* * We know there's an alpha offset and we're setting the data, so skip @@ -2804,7 +2804,7 @@ Tk_PhotoPutBlock( && (blueOffset == 2) && (alphaOffset == 3) && (width <= blockPtr->width) && compRuleSet) { - memcpy(destLinePtr, srcLinePtr, (size_t) (width * 4)); + memcpy(destLinePtr, srcLinePtr, ((size_t)width * 4)); srcLinePtr += blockPtr->pitch; destLinePtr += pitch; continue; @@ -3454,7 +3454,7 @@ Tk_PhotoBlank( */ memset(masterPtr->pix32, 0, - (size_t) (masterPtr->width * masterPtr->height * 4)); + ((size_t)masterPtr->width * masterPtr->height * 4)); for (instancePtr = masterPtr->instancePtr; instancePtr != NULL; instancePtr = instancePtr->nextPtr) { TkImgResetDither(instancePtr); -- cgit v0.12 From c4379d2c51d34a6cba21e73692660730930e73f7 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 18 May 2015 18:21:41 +0000 Subject: [dece631375] Prevent overflows in photo image memory allocations. --- generic/tkImgPhoto.c | 48 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 73a06b7..6e34fe4 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -886,6 +886,19 @@ ImgPhotoCmd( break; } dataWidth = listObjc; + /* + * Memory allocation overflow protection. + * May not be able to trigger/ demo / test this. + */ + + if (dataWidth > (UINT_MAX/3) / dataHeight) { + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "photo image dimensions exceed Tcl memory limits", -1)); + Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", + "OVERFLOW", NULL); + break; + } + pixelPtr = ckalloc(dataWidth * dataHeight * 3); block.pixelPtr = pixelPtr; } else if (listObjc != dataWidth) { @@ -2192,6 +2205,10 @@ ImgPhotoSetSize( height = masterPtr->userHeight; } + if (width > INT_MAX / 4) { + /* Pitch overflows int */ + return TCL_ERROR; + } pitch = width * 4; /* @@ -2201,11 +2218,12 @@ ImgPhotoSetSize( if ((width != masterPtr->width) || (height != masterPtr->height) || (masterPtr->pix32 == NULL)) { - /* - * Not a u-long, but should be one. - */ + unsigned newPixSize; - unsigned /*long*/ newPixSize = (unsigned /*long*/) (height * pitch); + if (pitch && height > UINT_MAX / pitch) { + return TCL_ERROR; + } + newPixSize = height * pitch; /* * Some mallocs() really hate allocating zero bytes. [Bug 619544] @@ -3699,6 +3717,10 @@ ImgGetPhoto( if ((greenOffset||blueOffset) && !(optPtr->options & OPT_GRAYSCALE)) { newPixelSize += 2; } + + if (blockPtr->height > (UINT_MAX/newPixelSize)/blockPtr->width) { + return NULL; + } data = attemptckalloc(newPixelSize*blockPtr->width*blockPtr->height); if (data == NULL) { return NULL; @@ -3835,32 +3857,32 @@ ImgStringWrite( Tk_PhotoImageBlock *blockPtr) { int greenOffset, blueOffset; - Tcl_DString data; + Tcl_Obj *data; + Tcl_Obj *line = Tcl_NewObj(); greenOffset = blockPtr->offset[1] - blockPtr->offset[0]; blueOffset = blockPtr->offset[2] - blockPtr->offset[0]; - Tcl_DStringInit(&data); + data = Tcl_NewListObj(blockPtr->height, NULL); if ((blockPtr->width > 0) && (blockPtr->height > 0)) { - char *line = ckalloc((8 * blockPtr->width) + 2); int row, col; for (row=0; rowheight; row++) { unsigned char *pixelPtr = blockPtr->pixelPtr + blockPtr->offset[0] + row * blockPtr->pitch; - char *linePtr = line; for (col=0; colwidth; col++) { - sprintf(linePtr, " #%02x%02x%02x", *pixelPtr, + Tcl_AppendPrintfToObj(line, "%s#%02x%02x%02x", + col ? " " : "", *pixelPtr, pixelPtr[greenOffset], pixelPtr[blueOffset]); pixelPtr += blockPtr->pixelSize; - linePtr += 8; } - Tcl_DStringAppendElement(&data, line+1); + Tcl_ListObjAppendElement(NULL, data, line); + Tcl_SetObjLength(line, 0); } - ckfree(line); } - Tcl_DStringResult(interp, &data); + Tcl_DecrRefCount(line); + Tcl_SetObjResult(interp, data); return TCL_OK; } -- cgit v0.12 From 54196211723b6c139157a3ab50b176f8f1dcd094 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 18 May 2015 18:44:45 +0000 Subject: Repair last commit. --- generic/tkImgPhoto.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 6e34fe4..0c783f1 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -3858,7 +3858,6 @@ ImgStringWrite( { int greenOffset, blueOffset; Tcl_Obj *data; - Tcl_Obj *line = Tcl_NewObj(); greenOffset = blockPtr->offset[1] - blockPtr->offset[0]; blueOffset = blockPtr->offset[2] - blockPtr->offset[0]; @@ -3868,20 +3867,19 @@ ImgStringWrite( int row, col; for (row=0; rowheight; row++) { + Tcl_Obj *line = Tcl_NewListObj(blockPtr->width, NULL); unsigned char *pixelPtr = blockPtr->pixelPtr + blockPtr->offset[0] + row * blockPtr->pitch; for (col=0; colwidth; col++) { - Tcl_AppendPrintfToObj(line, "%s#%02x%02x%02x", - col ? " " : "", *pixelPtr, - pixelPtr[greenOffset], pixelPtr[blueOffset]); + Tcl_ListObjAppendElement(NULL, line, Tcl_ObjPrintf( + "%s#%02x%02x%02x", col ? " " : "", *pixelPtr, + pixelPtr[greenOffset], pixelPtr[blueOffset])); pixelPtr += blockPtr->pixelSize; } Tcl_ListObjAppendElement(NULL, data, line); - Tcl_SetObjLength(line, 0); } } - Tcl_DecrRefCount(line); Tcl_SetObjResult(interp, data); return TCL_OK; } -- cgit v0.12 From 511a4b5d5ef8ff90218dd3aa8c85478bd5f56a36 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 20 May 2015 02:41:26 +0000 Subject: Initialize memory to stop valgrind notices about conditionals dependent on reads from uninit memory. --- generic/tkImgGIF.c | 7 +++++++ generic/tkImgPhoto.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index 27de486..6273c69 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -410,6 +410,7 @@ FileReadGIF( * source and not a file. */ + memset(colorMap, 0, MAXCOLORMAPSIZE*4); memset(gifConfPtr, 0, sizeof(GIFImageConfig)); if (fileName == INLINE_DATA_BINARY || fileName == INLINE_DATA_BASE64) { gifConfPtr->fromData = fileName; @@ -592,6 +593,9 @@ FileReadGIF( if (trashBuffer == NULL) { nBytes = fileWidth * fileHeight * 3; trashBuffer = ckalloc(nBytes); + if (trashBuffer) { + memset(trashBuffer, 0, nBytes); + } } /* @@ -678,6 +682,9 @@ FileReadGIF( block.pitch = block.pixelSize * imageWidth; nBytes = block.pitch * imageHeight; block.pixelPtr = ckalloc(nBytes); + if (block.pixelPtr) { + memset(block.pixelPtr, 0, nBytes); + } if (ReadImage(gifConfPtr, interp, block.pixelPtr, chan, imageWidth, imageHeight, colorMap, srcX, srcY, BitSet(buf[8], INTERLACE), diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index fcb6d2f..7fa894c 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -2075,6 +2075,9 @@ ToggleComplexAlphaIfNeeded( */ mPtr->flags &= ~COMPLEX_ALPHA; + if (c == NULL) { + return 0; + } c += 3; /* Start at first alpha byte. */ for (; c < end; c += 4) { if (*c && *c != 255) { -- cgit v0.12 From 670cc8175d070b56068e54ebf6fd1b69eb31af7d Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 20 May 2015 12:34:32 +0000 Subject: [dece631375] More mem alloc overflow check and init with proper unsigneds. --- generic/tkImgGIF.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index 6273c69..fbfe621 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -393,7 +393,8 @@ FileReadGIF( * image being read. */ { int fileWidth, fileHeight, imageWidth, imageHeight; - int nBytes, index = 0, argc = 0, i, result = TCL_ERROR; + unsigned int nBytes; + int index = 0, argc = 0, i, result = TCL_ERROR; Tcl_Obj **objv; unsigned char buf[100]; unsigned char *trashBuffer = NULL; @@ -426,8 +427,9 @@ FileReadGIF( return TCL_ERROR; } for (i = 1; i < argc; i++) { + int optionIdx; if (Tcl_GetIndexFromObjStruct(interp, objv[i], optionStrings, - sizeof(char *), "option name", 0, &nBytes) != TCL_OK) { + sizeof(char *), "option name", 0, &optionIdx) != TCL_OK) { return TCL_ERROR; } if (i == (argc-1)) { @@ -591,6 +593,9 @@ FileReadGIF( */ if (trashBuffer == NULL) { + if (fileWidth > (UINT_MAX/3)/fileHeight) { + goto error; + } nBytes = fileWidth * fileHeight * 3; trashBuffer = ckalloc(nBytes); if (trashBuffer) { @@ -679,7 +684,13 @@ FileReadGIF( block.offset[1] = 1; block.offset[2] = 2; block.offset[3] = (transparent>=0) ? 3 : 0; + if (imageWidth > INT_MAX/block.pixelSize) { + goto error; + } block.pitch = block.pixelSize * imageWidth; + if (imageHeight > UINT_MAX/block.pitch) { + goto error; + } nBytes = block.pitch * imageHeight; block.pixelPtr = ckalloc(nBytes); if (block.pixelPtr) { -- cgit v0.12 From 402e1bab0bba591119bdef3b7dc049611ee2fc3f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 20 May 2015 14:56:15 +0000 Subject: Partly undo the effect of [46e08e5ab3b742bb], which didn't only update the release date; it changed the autoconf version as well. --- unix/configure | 11633 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 7176 insertions(+), 4457 deletions(-) diff --git a/unix/configure b/unix/configure index 9576fb8..824d3b4 100755 --- a/unix/configure +++ b/unix/configure @@ -1,459 +1,81 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for tk 8.5. -# -# -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -# +# Generated by GNU Autoconf 2.59 for tk 8.5. # +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + $as_unset $as_var fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error +done -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi -as_me=`$as_basename -- "$0" || +# Name of the executable. +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + +# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -461,91 +83,146 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop - s/-\n.*// + s,-$,, + s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno # Exit status is that of the last command. exit } -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null + as_expr=false fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' else - as_ln_s='cp -pR' + as_ln_s='ln -s' fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln else - as_ln_s='cp -pR' + as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null +rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' + as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_test_x='test -x' -as_executable_p=as_fn_executable_p +as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -554,25 +231,38 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -test -n "$DJDIR" || exec 7<&0 &1 +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + # Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` +exec 6>&1 + # # Initializations. # ac_default_prefix=/usr/local -ac_clean_files= ac_config_libobj_dir=. -LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='tk' @@ -580,221 +270,50 @@ PACKAGE_TARNAME='tk' PACKAGE_VERSION='8.5' PACKAGE_STRING='tk 8.5' PACKAGE_BUGREPORT='' -PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include -#ifdef HAVE_SYS_TYPES_H +#if HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SYS_STAT_H +#if HAVE_SYS_STAT_H # include #endif -#ifdef STDC_HEADERS +#if STDC_HEADERS # include # include #else -# ifdef HAVE_STDLIB_H +# if HAVE_STDLIB_H # include # endif #endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H # include #endif -#ifdef HAVE_INTTYPES_H +#if HAVE_INTTYPES_H # include +#else +# if HAVE_STDINT_H +# include +# endif #endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H # include #endif" -ac_subst_vars='LTLIBOBJS -REZ_FLAGS -REZ -APP_RSRC_FILE -LIB_RSRC_FILE -WISH_RSRC_FILE -TK_RSRC_FILE -CFBUNDLELOCALIZATIONS -EXTRA_WISH_LIBS -EXTRA_BUILD_HTML -EXTRA_INSTALL_BINARIES -EXTRA_INSTALL -EXTRA_APP_CC_SWITCHES -EXTRA_CC_SWITCHES -HTML_DIR -PRIVATE_INCLUDE_DIR -LIB_RUNTIME_DIR -TK_LIBRARY -TK_PKG_DIR -TK_WINDOWINGSYSTEM -LOCALES -XLIBSW -XINCLUDES -TCL_STUB_FLAGS -TK_BUILD_LIB_SPEC -LD_LIBRARY_PATH_VAR -TK_SHARED_BUILD -TK_SRC_DIR -TK_BUILD_STUB_LIB_PATH -TK_BUILD_STUB_LIB_SPEC -TK_INCLUDE_SPEC -TK_STUB_LIB_PATH -TK_STUB_LIB_SPEC -TK_STUB_LIB_FLAG -TK_STUB_LIB_FILE -TK_LIB_SPEC -TK_LIB_FLAG -TK_LIB_FILE -TK_YEAR -TK_PATCH_LEVEL -TK_MINOR_VERSION -TK_MAJOR_VERSION -TK_VERSION -UNIX_FONT_OBJS -XFT_LIBS -XFT_CFLAGS -XMKMF -LIBOBJS -LDFLAGS_DEFAULT -CFLAGS_DEFAULT -INSTALL_STUB_LIB -DLL_INSTALL_DIR -INSTALL_LIB -MAKE_STUB_LIB -MAKE_LIB -SHLIB_SUFFIX -SHLIB_CFLAGS -SHLIB_LD_LIBS -TK_SHLIB_LD_EXTRAS -TCL_SHLIB_LD_EXTRAS -SHLIB_LD -STLIB_LD -LD_SEARCH_FLAGS -CC_SEARCH_FLAGS -LDFLAGS_OPTIMIZE -LDFLAGS_DEBUG -CFLAGS_WARNING -CFLAGS_OPTIMIZE -CFLAGS_DEBUG -LDAIX_SRC -PLAT_SRCS -PLAT_OBJS -DL_OBJS -DL_LIBS -TCL_LIBS -AR -RANLIB -TCL_THREADS -EGREP -GREP -CPP -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -MAN_FLAGS -BUILD_TCLSH -TCLSH_PROG -TCL_STUB_LIB_SPEC -TCL_STUB_LIB_FLAG -TCL_STUB_LIB_FILE -TCL_LIB_SPEC -TCL_LIB_FLAG -TCL_LIB_FILE -TCL_SRC_DIR -TCL_BIN_DIR -TCL_PATCH_LEVEL -TCL_VERSION -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCLSH_PROG BUILD_TCLSH MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR ac_ct_AR TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS LDAIX_SRC CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB DLL_INSTALL_DIR INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT LIBOBJS XFT_CFLAGS XFT_LIBS UNIX_FONT_OBJS TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_YEAR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_INCLUDE_SPEC TK_BUILD_STUB_LIB_SPEC TK_BUILD_STUB_LIB_PATH TK_SRC_DIR TK_SHARED_BUILD LD_LIBRARY_PATH_VAR TK_BUILD_LIB_SPEC TCL_STUB_FLAGS XINCLUDES XLIBSW LOCALES TK_WINDOWINGSYSTEM TK_PKG_DIR TK_LIBRARY LIB_RUNTIME_DIR PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_WISH_LIBS CFBUNDLELOCALIZATIONS TK_RSRC_FILE WISH_RSRC_FILE LIB_RSRC_FILE APP_RSRC_FILE REZ REZ_FLAGS LTLIBOBJS' ac_subst_files='' -ac_user_opts=' -enable_option_checking -with_tcl -enable_man_symlinks -enable_man_compression -enable_man_suffix -enable_threads -enable_shared -enable_64bit -enable_64bit_vis -enable_rpath -enable_corefoundation -enable_load -enable_symbols -enable_aqua -with_x -enable_xft -enable_xss -enable_framework -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP -XMKMF' - # Initialize some variables set by options. ac_init_help= ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -817,49 +336,34 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' +datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' +infodir='${prefix}/info' +mandir='${prefix}/man' ac_prev= -ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option + eval "$ac_prev=\$ac_option" ac_prev= continue fi - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -881,59 +385,33 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad) + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) datadir=$ac_optarg ;; - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; esac - eval enable_$ac_useropt=\$ac_optarg ;; + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -960,12 +438,6 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -990,16 +462,13 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -1064,16 +533,6 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -1124,36 +583,26 @@ do ac_init_version=: ;; -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; esac - eval with_$ac_useropt=\$ac_optarg ;; + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -1173,26 +622,27 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac @@ -1200,36 +650,31 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix do - eval ac_val=\$$ac_var - # Remove trailing slashes. + eval ac_val=$`echo $ac_var` case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac - # Be sure to have absolute directory names. +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1243,6 +688,8 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1254,72 +701,74 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then + if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP # # Report the --help message. @@ -1342,17 +791,20 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] +_ACEOF + + cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1362,25 +814,18 @@ for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/tk] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF @@ -1398,7 +843,6 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-man-symlinks use symlinks for the manpages (default: off) @@ -1435,537 +879,160 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory CPP C preprocessor - XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to the package provider. _ACEOF -ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. + ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue + test -d $ac_dir || continue ac_builddir=. -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi case $srcdir in - .) # We are building in place. + .) # No --srcdir option. We are building in place. ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir done fi -test -n "$ac_init_help" && exit $ac_status +test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF tk configure 8.5 -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.59 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit + exit 0 fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by tk $as_me 8.5, which was +generated by GNU Autoconf 2.59. Invocation command line was -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## + $ $0 $@ -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () +_ACEOF { - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` -} # ac_fn_c_try_compile +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval +_ASUNAME -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func - -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_type -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by tk $as_me 8.5, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done } >&5 @@ -1987,6 +1054,7 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= +ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1997,13 +1065,13 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) - as_fn_append ac_configure_args1 " '$ac_arg'" + ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else @@ -2019,115 +1087,104 @@ do -* ) ac_must_keep_next=true ;; esac fi - as_fn_append ac_configure_args " '$ac_arg'" + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " ;; esac done done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + cat <<\_ASBOX +## ---------------- ## ## Cache variables. ## -## ---------------- ##" +## ---------------- ## +_ASBOX echo # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done +{ (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; - esac | - sort -) + esac; +} echo - $as_echo "## ----------------- ## + cat <<\_ASBOX +## ----------------- ## ## Output variables. ## -## ----------------- ##" +## ----------------- ## +_ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + cat <<\_ASBOX +## ----------- ## ## confdefs.h. ## -## ----------- ##" +## ----------- ## +_ASBOX echo - cat confdefs.h + sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status -' 0 + ' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h # Predefined preprocessor variables. @@ -2135,137 +1192,112 @@ cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF + cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF + cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF + cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } + . "$ac_site_file" fi done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -2278,6 +1310,31 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + TK_VERSION=8.5 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=5 @@ -2300,15 +1357,15 @@ LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" # we reset no_tcl in case something fails here no_tcl=true -# Check whether --with-tcl was given. -if test "${with_tcl+set}" = set; then : - withval=$with_tcl; with_tclconfig="${withval}" -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5 -$as_echo_n "checking for Tcl configuration... " >&6; } - if ${ac_cv_c_tclconfig+:} false; then : - $as_echo_n "(cached) " >&6 +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + with_tclconfig="${withval}" +fi; + 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 @@ -2317,15 +1374,17 @@ else case "${with_tclconfig}" in */tclConfig.sh ) if test -f "${with_tclconfig}"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 -$as_echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} + { 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 - as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5 + { { 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 fi @@ -2401,26 +1460,28 @@ fi if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" - as_fn_error $? "Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" "$LINENO" 5 + { { 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}" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 -$as_echo "found ${TCL_BIN_DIR}/tclConfig.sh" >&6; } + echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6 fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 -$as_echo_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... " >&6; } + echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 -$as_echo "loading" >&6; } + echo "$as_me:$LINENO: result: loading" >&5 +echo "${ECHO_T}loading" >&6 . "${TCL_BIN_DIR}/tclConfig.sh" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 -$as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } + echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 fi # eval is required to do the TCL_DBGX substitution @@ -2481,16 +1542,20 @@ $as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } if test "${TCL_VERSION}" != "${TK_VERSION}"; then - as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. + { { echo "$as_me:$LINENO: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." "$LINENO" 5 +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." >&5 +echo "$as_me: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 -$as_echo_n "checking for tclsh... " >&6; } - if ${ac_cv_path_tclsh+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for tclsh" >&5 +echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 + if test "${ac_cv_path_tclsh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else search_path=`echo ${PATH} | sed -e 's/:/ /g'` @@ -2511,22 +1576,22 @@ fi if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG="$ac_cv_path_tclsh" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLSH_PROG" >&5 -$as_echo "$TCLSH_PROG" >&6; } + echo "$as_me:$LINENO: result: $TCLSH_PROG" >&5 +echo "${ECHO_T}$TCLSH_PROG" >&6 else # It is not an error if an installed version of Tcl can't be located. TCLSH_PROG="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: No tclsh found on PATH" >&5 -$as_echo "No tclsh found on PATH" >&6; } + echo "$as_me:$LINENO: result: No tclsh found on PATH" >&5 +echo "${ECHO_T}No tclsh found on PATH" >&6 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclsh in Tcl build directory" >&5 -$as_echo_n "checking for tclsh in Tcl build directory... " >&6; } + echo "$as_me:$LINENO: checking for tclsh in Tcl build directory" >&5 +echo $ECHO_N "checking for tclsh in Tcl build directory... $ECHO_C" >&6 BUILD_TCLSH="${TCL_BIN_DIR}"/tclsh - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_TCLSH" >&5 -$as_echo "$BUILD_TCLSH" >&6; } + echo "$as_me:$LINENO: result: $BUILD_TCLSH" >&5 +echo "${ECHO_T}$BUILD_TCLSH" >&6 @@ -2549,60 +1614,62 @@ TK_SRC_DIR="`cd "$srcdir"/..; pwd`" #------------------------------------------------------------------------ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use symlinks for manpages" >&5 -$as_echo_n "checking whether to use symlinks for manpages... " >&6; } - # Check whether --enable-man-symlinks was given. -if test "${enable_man_symlinks+set}" = set; then : - enableval=$enable_man_symlinks; test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks" + echo "$as_me:$LINENO: checking whether to use symlinks for manpages" >&5 +echo $ECHO_N "checking whether to use symlinks for manpages... $ECHO_C" >&6 + # Check whether --enable-man-symlinks or --disable-man-symlinks was given. +if test "${enable_man_symlinks+set}" = set; then + enableval="$enable_man_symlinks" + test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks" else enableval="no" -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 -$as_echo "$enableval" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to compress the manpages" >&5 -$as_echo_n "checking whether to compress the manpages... " >&6; } - # Check whether --enable-man-compression was given. -if test "${enable_man_compression+set}" = set; then : - enableval=$enable_man_compression; case $enableval in - yes) as_fn_error $? "missing argument to --enable-man-compression" "$LINENO" 5;; +fi; + echo "$as_me:$LINENO: result: $enableval" >&5 +echo "${ECHO_T}$enableval" >&6 + + echo "$as_me:$LINENO: checking whether to compress the manpages" >&5 +echo $ECHO_N "checking whether to compress the manpages... $ECHO_C" >&6 + # Check whether --enable-man-compression or --disable-man-compression was given. +if test "${enable_man_compression+set}" = set; then + enableval="$enable_man_compression" + case $enableval in + yes) { { echo "$as_me:$LINENO: error: missing argument to --enable-man-compression" >&5 +echo "$as_me: error: missing argument to --enable-man-compression" >&2;} + { (exit 1); exit 1; }; };; no) ;; *) MAN_FLAGS="$MAN_FLAGS --compress $enableval";; esac else enableval="no" -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 -$as_echo "$enableval" >&6; } +fi; + echo "$as_me:$LINENO: result: $enableval" >&5 +echo "${ECHO_T}$enableval" >&6 if test "$enableval" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compressed file suffix" >&5 -$as_echo_n "checking for compressed file suffix... " >&6; } + echo "$as_me:$LINENO: checking for compressed file suffix" >&5 +echo $ECHO_N "checking for compressed file suffix... $ECHO_C" >&6 touch TeST $enableval TeST Z=`ls TeST* | sed 's/^....//'` rm -f TeST* MAN_FLAGS="$MAN_FLAGS --extension $Z" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $Z" >&5 -$as_echo "$Z" >&6; } + echo "$as_me:$LINENO: result: $Z" >&5 +echo "${ECHO_T}$Z" >&6 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to add a package name suffix for the manpages" >&5 -$as_echo_n "checking whether to add a package name suffix for the manpages... " >&6; } - # Check whether --enable-man-suffix was given. -if test "${enable_man_suffix+set}" = set; then : - enableval=$enable_man_suffix; case $enableval in + echo "$as_me:$LINENO: checking whether to add a package name suffix for the manpages" >&5 +echo $ECHO_N "checking whether to add a package name suffix for the manpages... $ECHO_C" >&6 + # Check whether --enable-man-suffix or --disable-man-suffix was given. +if test "${enable_man_suffix+set}" = set; then + enableval="$enable_man_suffix" + case $enableval in yes) enableval="tk" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; no) ;; *) MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; esac else enableval="no" -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 -$as_echo "$enableval" >&6; } +fi; + echo "$as_me:$LINENO: result: $enableval" >&5 +echo "${ECHO_T}$enableval" >&6 @@ -2625,10 +1692,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2638,37 +1705,35 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2678,50 +1743,39 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi + CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2731,96 +1785,134 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - - fi fi -if test -z "$CC"; then +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else - ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe + for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2830,41 +1922,39 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl.exe + for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2874,78 +1964,66 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$ac_ct_CC" && break done - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi + CC=$ac_ct_CC fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -2957,108 +2035,112 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext break;; * ) break;; esac done -test "$ac_cv_exeext" = no && ac_cv_exeext= - else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } + ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (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 + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -3066,90 +2148,38 @@ $as_echo "$ac_try_echo"; } >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext break;; * ) break;; esac done else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -3161,46 +2191,45 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi + rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -3214,65 +2243,55 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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_compiler_gnu=yes else - ac_compiler_gnu=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -3283,18 +2302,39 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3310,18 +2350,23 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_c89=no + ac_cv_prog_cc_stdc=no ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include -struct stat; +#include +#include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3344,17 +2389,12 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get + as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ + that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -3369,37 +2409,205 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg + 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_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break +rm -f conftest.err conftest.$ac_objext done -rm -f conftest.$ac_ext +rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_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 + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_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 + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_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 + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3415,15 +2623,15 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3437,7 +2645,11 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include @@ -3446,34 +2658,78 @@ do #endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers + # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then break fi @@ -3485,8 +2741,8 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3496,7 +2752,11 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include @@ -3505,40 +2765,85 @@ do #endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - # Broken: fails on valid input. -continue + ac_cpp_err=yes fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi ac_ext=c @@ -3548,142 +2853,31 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include @@ -3698,23 +2892,51 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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_stdc=yes else - ac_cv_header_stdc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - + $EGREP "memchr" >/dev/null 2>&1; then + : else ac_cv_header_stdc=no fi @@ -3724,14 +2946,18 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - + $EGREP "free" >/dev/null 2>&1; then + : else ac_cv_header_stdc=no fi @@ -3741,13 +2967,16 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes; then : else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -3767,39 +2996,109 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - return 2; - return 0; + exit(2); + exit (0); } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./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 + : else - ac_cv_header_stdc=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+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. */ +$ac_includes_default + +#include <$ac_header> +_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 + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -3807,14 +3106,154 @@ fi done -ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" -if test "x$ac_cv_header_limits_h" = xyes; then : +if test "${ac_cv_header_limits_h+set}" = set; then + echo "$as_me:$LINENO: checking for limits.h" >&5 +echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 +if test "${ac_cv_header_limits_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 +echo "${ECHO_T}$ac_cv_header_limits_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking limits.h usability" >&5 +echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#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_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking limits.h presence" >&5 +echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------- ## +## Report this to the tk lists. ## +## ----------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for limits.h" >&5 +echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 +if test "${ac_cv_header_limits_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_limits_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 +echo "${ECHO_T}$ac_cv_header_limits_h" >&6 + +fi +if test $ac_cv_header_limits_h = yes; then -$as_echo "#define HAVE_LIMITS_H 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIMITS_H 1 +_ACEOF else -$as_echo "#define NO_LIMITS_H 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define NO_LIMITS_H 1 +_ACEOF fi @@ -3825,48 +3264,196 @@ fi # strtoul, or strtod (which it doesn't in some versions of SunOS). #-------------------------------------------------------------------- -ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes; then : +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo "$as_me:$LINENO: checking for stdlib.h" >&5 +echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking stdlib.h usability" >&5 +echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#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_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking stdlib.h presence" >&5 +echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------- ## +## Report this to the tk lists. ## +## ----------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for stdlib.h" >&5 +echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_stdlib_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 + +fi +if test $ac_cv_header_stdlib_h = yes; then tk_ok=1 else tk_ok=0 fi -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtol" >/dev/null 2>&1; then : - + $EGREP "strtol" >/dev/null 2>&1; then + : else tk_ok=0 fi rm -f conftest* -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtoul" >/dev/null 2>&1; then : - + $EGREP "strtoul" >/dev/null 2>&1; then + : else tk_ok=0 fi rm -f conftest* -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtod" >/dev/null 2>&1; then : - + $EGREP "strtod" >/dev/null 2>&1; then + : else tk_ok=0 fi @@ -3874,7 +3461,9 @@ rm -f conftest* if test $tk_ok = 0; then -$as_echo "#define NO_STDLIB_H 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define NO_STDLIB_H 1 +_ACEOF fi @@ -3884,14 +3473,18 @@ fi #------------------------------------------------------------------------ if test -z "$no_pipe" && test -n "$GCC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5 -$as_echo_n "checking if the compiler understands -pipe... " >&6; } -if ${tcl_cv_cc_pipe+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 +echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 +if test "${tcl_cv_cc_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -3902,16 +3495,40 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_cv_cc_pipe=yes else - tcl_cv_cc_pipe=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_pipe=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5 -$as_echo "$tcl_cv_cc_pipe" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 +echo "${ECHO_T}$tcl_cv_cc_pipe" >&6 if test $tcl_cv_cc_pipe = yes; then CFLAGS="$CFLAGS -pipe" fi @@ -3922,13 +3539,13 @@ fi #------------------------------------------------------------------------ - # Check whether --enable-threads was given. -if test "${enable_threads+set}" = set; then : - enableval=$enable_threads; tcl_ok=$enableval + # Check whether --enable-threads or --disable-threads was given. +if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval else tcl_ok=no -fi - +fi; if test "${TCL_THREADS}" = 1; then tcl_threaded_core=1; @@ -3939,56 +3556,92 @@ fi # USE_THREAD_ALLOC tells us to try the special thread-based # allocator that significantly reduces lock contention -$as_echo "#define USE_THREAD_ALLOC 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define USE_THREAD_ALLOC 1 +_ACEOF -$as_echo "#define _REENTRANT 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF if test "`uname -s`" = "SunOS" ; then -$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF fi -$as_echo "#define _THREAD_SAFE 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _THREAD_SAFE 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 -$as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_mutex_init+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 pthread_mutex_init (); int main () { -return pthread_mutex_init (); +pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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_pthread_pthread_mutex_init=yes else - ac_cv_lib_pthread_pthread_mutex_init=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthread_pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 +if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no @@ -4000,43 +3653,71 @@ fi # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5 -$as_echo_n "checking for __pthread_mutex_init in -lpthread... " >&6; } -if ${ac_cv_lib_pthread___pthread_mutex_init+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 +echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 __pthread_mutex_init (); int main () { -return __pthread_mutex_init (); +__pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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_pthread___pthread_mutex_init=yes else - ac_cv_lib_pthread___pthread_mutex_init=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthread___pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 -$as_echo "$ac_cv_lib_pthread___pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 +if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no @@ -4048,43 +3729,71 @@ fi # The space is needed THREADS_LIBS=" -lpthread" else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5 -$as_echo_n "checking for pthread_mutex_init in -lpthreads... " >&6; } -if ${ac_cv_lib_pthreads_pthread_mutex_init+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 +if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 pthread_mutex_init (); int main () { -return pthread_mutex_init (); +pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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_pthreads_pthread_mutex_init=yes else - ac_cv_lib_pthreads_pthread_mutex_init=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthreads_pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 -$as_echo "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 +if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no @@ -4094,86 +3803,142 @@ fi # The space is needed THREADS_LIBS=" -lpthreads" else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5 -$as_echo_n "checking for pthread_mutex_init in -lc... " >&6; } -if ${ac_cv_lib_c_pthread_mutex_init+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 +if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 pthread_mutex_init (); int main () { -return pthread_mutex_init (); +pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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_c_pthread_mutex_init=yes else - ac_cv_lib_c_pthread_mutex_init=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_c_pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5 -$as_echo "$ac_cv_lib_c_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 +if test $ac_cv_lib_c_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5 -$as_echo_n "checking for pthread_mutex_init in -lc_r... " >&6; } -if ${ac_cv_lib_c_r_pthread_mutex_init+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 +if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 pthread_mutex_init (); int main () { -return pthread_mutex_init (); +pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_c_r_pthread_mutex_init=yes +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_c_r_pthread_mutex_init=yes else - ac_cv_lib_c_r_pthread_mutex_init=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_c_r_pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 -$as_echo "$ac_cv_lib_c_r_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 +if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no @@ -4184,8 +3949,8 @@ fi THREADS_LIBS=" -pthread" else TCL_THREADS=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&5 -$as_echo "$as_me: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&2;} + { echo "$as_me:$LINENO: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&5 +echo "$as_me: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&2;} fi fi fi @@ -4196,20 +3961,200 @@ $as_echo "$as_me: WARNING: Don't know how to find pthread lib on your system - y ac_saved_libs=$LIBS LIBS="$LIBS $THREADS_LIBS" - for ac_func in pthread_attr_setstacksize pthread_atfork -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + + +for ac_func in pthread_attr_setstacksize pthread_atfork +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+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. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done - ac_fn_c_check_func "$LINENO" "pthread_attr_get_np" "ac_cv_func_pthread_attr_get_np" -if test "x$ac_cv_func_pthread_attr_get_np" = xyes; then : + echo "$as_me:$LINENO: checking for pthread_attr_get_np" >&5 +echo $ECHO_N "checking for pthread_attr_get_np... $ECHO_C" >&6 +if test "${ac_cv_func_pthread_attr_get_np+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. */ +/* Define pthread_attr_get_np to an innocuous variant, in case declares pthread_attr_get_np. + For example, HP-UX 11i declares gettimeofday. */ +#define pthread_attr_get_np innocuous_pthread_attr_get_np + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char pthread_attr_get_np (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef pthread_attr_get_np + +/* 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 pthread_attr_get_np (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_pthread_attr_get_np) || defined (__stub___pthread_attr_get_np) +choke me +#else +char (*f) () = pthread_attr_get_np; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != pthread_attr_get_np; + ; + 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_func_pthread_attr_get_np=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_pthread_attr_get_np=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_pthread_attr_get_np" >&5 +echo "${ECHO_T}$ac_cv_func_pthread_attr_get_np" >&6 +if test $ac_cv_func_pthread_attr_get_np = yes; then tcl_ok=yes else tcl_ok=no @@ -4217,21 +4162,27 @@ fi if test $tcl_ok = yes ; then -$as_echo "#define HAVE_PTHREAD_ATTR_GET_NP 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_PTHREAD_ATTR_GET_NP 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_attr_get_np declaration" >&5 -$as_echo_n "checking for pthread_attr_get_np declaration... " >&6; } -if ${tcl_cv_grep_pthread_attr_get_np+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for pthread_attr_get_np declaration" >&5 +echo $ECHO_N "checking for pthread_attr_get_np declaration... $ECHO_C" >&6 +if test "${tcl_cv_grep_pthread_attr_get_np+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pthread_attr_get_np" >/dev/null 2>&1; then : + $EGREP "pthread_attr_get_np" >/dev/null 2>&1; then tcl_cv_grep_pthread_attr_get_np=present else tcl_cv_grep_pthread_attr_get_np=missing @@ -4239,16 +4190,107 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_grep_pthread_attr_get_np" >&5 -$as_echo "$tcl_cv_grep_pthread_attr_get_np" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_grep_pthread_attr_get_np" >&5 +echo "${ECHO_T}$tcl_cv_grep_pthread_attr_get_np" >&6 if test $tcl_cv_grep_pthread_attr_get_np = missing ; then -$as_echo "#define ATTRGETNP_NOT_DECLARED 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define ATTRGETNP_NOT_DECLARED 1 +_ACEOF fi else - ac_fn_c_check_func "$LINENO" "pthread_getattr_np" "ac_cv_func_pthread_getattr_np" -if test "x$ac_cv_func_pthread_getattr_np" = xyes; then : + echo "$as_me:$LINENO: checking for pthread_getattr_np" >&5 +echo $ECHO_N "checking for pthread_getattr_np... $ECHO_C" >&6 +if test "${ac_cv_func_pthread_getattr_np+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. */ +/* Define pthread_getattr_np to an innocuous variant, in case declares pthread_getattr_np. + For example, HP-UX 11i declares gettimeofday. */ +#define pthread_getattr_np innocuous_pthread_getattr_np + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char pthread_getattr_np (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef pthread_getattr_np + +/* 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 pthread_getattr_np (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_pthread_getattr_np) || defined (__stub___pthread_getattr_np) +choke me +#else +char (*f) () = pthread_getattr_np; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != pthread_getattr_np; + ; + 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_func_pthread_getattr_np=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_pthread_getattr_np=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_pthread_getattr_np" >&5 +echo "${ECHO_T}$ac_cv_func_pthread_getattr_np" >&6 +if test $ac_cv_func_pthread_getattr_np = yes; then tcl_ok=yes else tcl_ok=no @@ -4256,21 +4298,27 @@ fi if test $tcl_ok = yes ; then -$as_echo "#define HAVE_PTHREAD_GETATTR_NP 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_PTHREAD_GETATTR_NP 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_getattr_np declaration" >&5 -$as_echo_n "checking for pthread_getattr_np declaration... " >&6; } -if ${tcl_cv_grep_pthread_getattr_np+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for pthread_getattr_np declaration" >&5 +echo $ECHO_N "checking for pthread_getattr_np declaration... $ECHO_C" >&6 +if test "${tcl_cv_grep_pthread_getattr_np+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "pthread_getattr_np" >/dev/null 2>&1; then : + $EGREP "pthread_getattr_np" >/dev/null 2>&1; then tcl_cv_grep_pthread_getattr_np=present else tcl_cv_grep_pthread_getattr_np=missing @@ -4278,23 +4326,116 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_grep_pthread_getattr_np" >&5 -$as_echo "$tcl_cv_grep_pthread_getattr_np" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_grep_pthread_getattr_np" >&5 +echo "${ECHO_T}$tcl_cv_grep_pthread_getattr_np" >&6 if test $tcl_cv_grep_pthread_getattr_np = missing ; then -$as_echo "#define GETATTRNP_NOT_DECLARED 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define GETATTRNP_NOT_DECLARED 1 +_ACEOF fi fi fi if test $tcl_ok = no; then # Darwin thread stacksize API - for ac_func in pthread_get_stacksize_np -do : - ac_fn_c_check_func "$LINENO" "pthread_get_stacksize_np" "ac_cv_func_pthread_get_stacksize_np" -if test "x$ac_cv_func_pthread_get_stacksize_np" = xyes; then : + +for ac_func in pthread_get_stacksize_np +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+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. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_GET_STACKSIZE_NP 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -4306,22 +4447,24 @@ done TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for building with threads" >&5 -$as_echo_n "checking for building with threads... " >&6; } + echo "$as_me:$LINENO: checking for building with threads" >&5 +echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 if test "${TCL_THREADS}" = 1; then -$as_echo "#define TCL_THREADS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define TCL_THREADS 1 +_ACEOF if test "${tcl_threaded_core}" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (threaded core)" >&5 -$as_echo "yes (threaded core)" >&6; } + echo "$as_me:$LINENO: result: yes (threaded core)" >&5 +echo "${ECHO_T}yes (threaded core)" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (default)" >&5 -$as_echo "no (default)" >&6; } + echo "$as_me:$LINENO: result: no (default)" >&5 +echo "${ECHO_T}no (default)" >&6 fi @@ -4331,15 +4474,15 @@ $as_echo "no (default)" >&6; } LIBS="$LIBS$THREADS_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5 -$as_echo_n "checking how to build libraries... " >&6; } - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; tcl_ok=$enableval + echo "$as_me:$LINENO: checking how to build libraries" >&5 +echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 + # Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval else tcl_ok=yes -fi - +fi; if test "${enable_shared+set}" = set; then enableval="$enable_shared" @@ -4349,15 +4492,17 @@ fi fi if test "$tcl_ok" = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5 -$as_echo "shared" >&6; } + echo "$as_me:$LINENO: result: shared" >&5 +echo "${ECHO_T}shared" >&6 SHARED_BUILD=1 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5 -$as_echo "static" >&6; } + echo "$as_me:$LINENO: result: static" >&5 +echo "${ECHO_T}static" >&6 SHARED_BUILD=0 -$as_echo "#define STATIC_BUILD 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define STATIC_BUILD 1 +_ACEOF fi @@ -4371,10 +4516,10 @@ $as_echo "#define STATIC_BUILD 1" >>confdefs.h if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -4384,37 +4529,35 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. @@ -4424,38 +4567,28 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi + RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi @@ -4464,47 +4597,52 @@ fi # Step 0.a: Enable 64 bit support? - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5 -$as_echo_n "checking if 64bit support is requested... " >&6; } - # Check whether --enable-64bit was given. -if test "${enable_64bit+set}" = set; then : - enableval=$enable_64bit; do64bit=$enableval + echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 +echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6 + # Check whether --enable-64bit or --disable-64bit was given. +if test "${enable_64bit+set}" = set; then + enableval="$enable_64bit" + do64bit=$enableval else do64bit=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 -$as_echo "$do64bit" >&6; } +fi; + echo "$as_me:$LINENO: result: $do64bit" >&5 +echo "${ECHO_T}$do64bit" >&6 # Step 0.b: Enable Solaris 64 bit VIS support? - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5 -$as_echo_n "checking if 64bit Sparc VIS support is requested... " >&6; } - # Check whether --enable-64bit-vis was given. -if test "${enable_64bit_vis+set}" = set; then : - enableval=$enable_64bit_vis; do64bitVIS=$enableval + echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 +echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 + # Check whether --enable-64bit-vis or --disable-64bit-vis was given. +if test "${enable_64bit_vis+set}" = set; then + enableval="$enable_64bit_vis" + do64bitVIS=$enableval else do64bitVIS=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5 -$as_echo "$do64bitVIS" >&6; } +fi; + echo "$as_me:$LINENO: result: $do64bitVIS" >&5 +echo "${ECHO_T}$do64bitVIS" >&6 # Force 64bit on with VIS - if test "$do64bitVIS" = "yes"; then : + if test "$do64bitVIS" = "yes"; then do64bit=yes fi + # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5 -$as_echo_n "checking if compiler supports visibility \"hidden\"... " >&6; } -if ${tcl_cv_cc_visibility_hidden+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if compiler supports visibility \"hidden\"" >&5 +echo $ECHO_N "checking if compiler supports visibility \"hidden\"... $ECHO_C" >&6 +if test "${tcl_cv_cc_visibility_hidden+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern __attribute__((__visibility__("hidden"))) void f(void); @@ -4517,47 +4655,74 @@ f(); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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 tcl_cv_cc_visibility_hidden=yes else - tcl_cv_cc_visibility_hidden=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_visibility_hidden=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5 -$as_echo "$tcl_cv_cc_visibility_hidden" >&6; } - if test $tcl_cv_cc_visibility_hidden = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_cc_visibility_hidden" >&5 +echo "${ECHO_T}$tcl_cv_cc_visibility_hidden" >&6 + if test $tcl_cv_cc_visibility_hidden = yes; then -$as_echo "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define MODULE_SCOPE extern __attribute__((__visibility__("hidden"))) +_ACEOF fi + # Step 0.d: Disable -rpath support? - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5 -$as_echo_n "checking if rpath support is requested... " >&6; } - # Check whether --enable-rpath was given. -if test "${enable_rpath+set}" = set; then : - enableval=$enable_rpath; doRpath=$enableval + echo "$as_me:$LINENO: checking if rpath support is requested" >&5 +echo $ECHO_N "checking if rpath support is requested... $ECHO_C" >&6 + # Check whether --enable-rpath or --disable-rpath was given. +if test "${enable_rpath+set}" = set; then + enableval="$enable_rpath" + doRpath=$enableval else doRpath=yes -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5 -$as_echo "$doRpath" >&6; } +fi; + echo "$as_me:$LINENO: result: $doRpath" >&5 +echo "${ECHO_T}$doRpath" >&6 # Step 1: set the variable "system" to hold the name and version number # for the system. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking system version" >&5 -$as_echo_n "checking system version... " >&6; } -if ${tcl_cv_sys_version+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking system version" >&5 +echo $ECHO_N "checking system version... $ECHO_C" >&6 +if test "${tcl_cv_sys_version+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -f /usr/lib/NextStep/software_version; then @@ -4565,8 +4730,8 @@ else else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5 -$as_echo "$as_me: WARNING: can't find uname command" >&2;} + { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 +echo "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else # Special check for weird MP-RAS system (uname returns weird @@ -4582,51 +4747,79 @@ $as_echo "$as_me: WARNING: can't find uname command" >&2;} fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5 -$as_echo "$tcl_cv_sys_version" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 +echo "${ECHO_T}$tcl_cv_sys_version" >&6 system=$tcl_cv_sys_version # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 dlopen (); int main () { -return dlopen (); +dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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_dl_dlopen=yes else - ac_cv_lib_dl_dlopen=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then have_dl=yes else have_dl=no @@ -4634,12 +4827,13 @@ fi # Require ranlib early so we can override it in special cases below. - if test x"${SHLIB_VERSION}" = x; then : + if test x"${SHLIB_VERSION}" = x; then SHLIB_VERSION="1.0" fi + # Step 3: set configuration options based on system name and version. do64bit_ok=no @@ -4656,20 +4850,21 @@ fi TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O - if test "$GCC" = yes; then : + if test "$GCC" = yes; then CFLAGS_WARNING="-Wall" else CFLAGS_WARNING="" fi + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. @@ -4679,37 +4874,35 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. @@ -4719,38 +4912,27 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_AR" = x; then - AR="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi + AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi @@ -4762,7 +4944,7 @@ fi LDAIX_SRC="" case $system in AIX-*) - if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then : + if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then # AIX requires the _r compiler when gcc isn't being used case "${CC}" in @@ -4774,10 +4956,11 @@ fi CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'` ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5 -$as_echo "Using $CC for compiling with threads" >&6; } + echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 +echo "${ECHO_T}Using $CC for compiling with threads" >&6 fi + LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" @@ -4790,12 +4973,12 @@ fi LDAIX_SRC='$(UNIX_DIR)/ldAix' # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = yes; then : + if test "$do64bit" = yes; then - if test "$GCC" = yes; then : + if test "$GCC" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 -$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else @@ -4808,15 +4991,17 @@ else fi + fi - if test "`uname -m`" = ia64; then : + + if test "`uname -m`" = ia64; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" - if test "$GCC" = yes; then : + if test "$GCC" = yes; then CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' @@ -4825,11 +5010,12 @@ else CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else - if test "$GCC" = yes; then : + if test "$GCC" = yes; then SHLIB_LD='${CC} -shared -Wl,-bexpall' @@ -4839,12 +5025,14 @@ else LDFLAGS="$LDFLAGS -brtl" fi + SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi + ;; BeOS*) SHLIB_CFLAGS="-fPIC" @@ -4858,43 +5046,71 @@ fi # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5 -$as_echo_n "checking for inet_ntoa in -lbind... " >&6; } -if ${ac_cv_lib_bind_inet_ntoa+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 +echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6 +if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbind $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 inet_ntoa (); int main () { -return inet_ntoa (); +inet_ntoa (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_bind_inet_ntoa=yes +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_bind_inet_ntoa=yes else - ac_cv_lib_bind_inet_ntoa=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_bind_inet_ntoa=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5 -$as_echo "$ac_cv_lib_bind_inet_ntoa" >&6; } -if test "x$ac_cv_lib_bind_inet_ntoa" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6 +if test $ac_cv_lib_bind_inet_ntoa = yes; then LIBS="$LIBS -lbind -lsocket" fi @@ -4929,12 +5145,16 @@ fi TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a' SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$@.a" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cygwin version of gcc" >&5 -$as_echo_n "checking for Cygwin version of gcc... " >&6; } -if ${ac_cv_cygwin+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for Cygwin version of gcc" >&5 +echo $ECHO_N "checking for Cygwin version of gcc... $ECHO_C" >&6 +if test "${ac_cv_cygwin+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __CYGWIN__ @@ -4949,21 +5169,49 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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_cygwin=no else - ac_cv_cygwin=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cygwin=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cygwin" >&5 -$as_echo "$ac_cv_cygwin" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_cygwin" >&5 +echo "${ECHO_T}$ac_cv_cygwin" >&6 if test "$ac_cv_cygwin" = "no"; then - as_fn_error $? "${CC} is not a cygwin compiler." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: ${CC} is not a cygwin compiler." >&5 +echo "$as_me: error: ${CC} is not a cygwin compiler." >&2;} + { (exit 1); exit 1; }; } fi if test "x${TCL_THREADS}" = "x0"; then - as_fn_error $? "CYGWIN compile is only supported with --enable-threads" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: CYGWIN compile is only supported with --enable-threads" >&5 +echo "$as_me: error: CYGWIN compile is only supported with --enable-threads" >&2;} + { (exit 1); exit 1; }; } fi do64bit_ok=yes if test "x${SHARED_BUILD}" = "x1"; then @@ -4993,43 +5241,71 @@ $as_echo "$ac_cv_cygwin" >&6; } SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}' DL_OBJS="tclLoadDl.o" DL_LIBS="-lroot" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5 -$as_echo_n "checking for inet_ntoa in -lnetwork... " >&6; } -if ${ac_cv_lib_network_inet_ntoa+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for inet_ntoa in -lnetwork" >&5 +echo $ECHO_N "checking for inet_ntoa in -lnetwork... $ECHO_C" >&6 +if test "${ac_cv_lib_network_inet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnetwork $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 inet_ntoa (); int main () { -return inet_ntoa (); +inet_ntoa (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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_network_inet_ntoa=yes else - ac_cv_lib_network_inet_ntoa=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_network_inet_ntoa=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5 -$as_echo "$ac_cv_lib_network_inet_ntoa" >&6; } -if test "x$ac_cv_lib_network_inet_ntoa" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_network_inet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_network_inet_ntoa" >&6 +if test $ac_cv_lib_network_inet_ntoa = yes; then LIBS="$LIBS -lnetwork" fi @@ -5037,14 +5313,18 @@ fi HP-UX-*.11.*) # Use updated header definitions where possible -$as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _XOPEN_SOURCE_EXTENDED 1 +_ACEOF -$as_echo "#define _XOPEN_SOURCE 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _XOPEN_SOURCE 1 +_ACEOF LIBS="$LIBS -lxnet" # Use the XOPEN network library - if test "`uname -m`" = ia64; then : + if test "`uname -m`" = ia64; then SHLIB_SUFFIX=".so" @@ -5053,49 +5333,78 @@ else SHLIB_SUFFIX=".sl" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 + + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 shl_load (); int main () { -return shl_load (); +shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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_dld_shl_load=yes else - ac_cv_lib_dld_shl_load=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi - if test "$tcl_ok" = yes; then : + if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" @@ -5107,35 +5416,38 @@ fi LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi - if test "$GCC" = yes; then : + + if test "$GCC" = yes; then SHLIB_LD='${CC} -shared' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi + # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes"; then : + if test "$do64bit" = "yes"; then - if test "$GCC" = yes; then : + if test "$GCC" = yes; then case `${CC} -dumpmachine` in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD='${CC} -shared' - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 -$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} ;; esac @@ -5147,52 +5459,82 @@ else fi -fi ;; + +fi + ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 shl_load (); int main () { -return shl_load (); +shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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_dld_shl_load=yes else - ac_cv_lib_dld_shl_load=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi - if test "$tcl_ok" = yes; then : + if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" @@ -5204,18 +5546,20 @@ fi LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" -fi ;; +fi + ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi + ;; IRIX-6.*) SHLIB_CFLAGS="" @@ -5223,12 +5567,13 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi - if test "$GCC" = yes; then : + + if test "$GCC" = yes; then CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" @@ -5247,6 +5592,7 @@ else LDFLAGS="$LDFLAGS -n32" fi + ;; IRIX64-6.*) SHLIB_CFLAGS="" @@ -5254,20 +5600,21 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi + # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = yes; then : + if test "$do64bit" = yes; then - if test "$GCC" = yes; then : + if test "$GCC" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5 -$as_echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 +echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} else @@ -5278,7 +5625,9 @@ else fi + fi + ;; Linux*|GNU*|NetBSD-Debian) SHLIB_CFLAGS="-fPIC" @@ -5294,25 +5643,31 @@ fi DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "`uname -m`" = "alpha"; then : + if test "`uname -m`" = "alpha"; then CFLAGS="$CFLAGS -mieee" fi - if test $do64bit = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5 -$as_echo_n "checking if compiler accepts -m64 flag... " >&6; } -if ${tcl_cv_cc_m64+:} false; then : - $as_echo_n "(cached) " >&6 + if test $do64bit = yes; then + + echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_m64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -5323,35 +5678,62 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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 tcl_cv_cc_m64=yes else - tcl_cv_cc_m64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_m64=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5 -$as_echo "$tcl_cv_cc_m64" >&6; } - if test $tcl_cv_cc_m64 = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 +echo "${ECHO_T}$tcl_cv_cc_m64" >&6 + if test $tcl_cv_cc_m64 = yes; then CFLAGS="$CFLAGS -m64" do64bit_ok=yes fi + fi + # The combo of gcc + glibc has a bug related to inlining of # functions like strtod(). The -fno-builtin flag should address # this problem but it does not work. The -fno-inline flag is kind # of overkill but it works. Disable inlining only when one of the # files in compat/*.c is being linked in. - if test x"${USE_COMPAT}" != x; then : + if test x"${USE_COMPAT}" != x; then CFLAGS="$CFLAGS -fno-inline" fi + ;; Lynx*) SHLIB_CFLAGS="-fPIC" @@ -5361,11 +5743,12 @@ fi DL_OBJS="tclLoadDl.o" DL_LIBS="-mshared -ldl" LD_FLAGS="-Wl,--export-dynamic" - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi + ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" @@ -5411,10 +5794,11 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' LDFLAGS="-Wl,-export-dynamic" @@ -5431,7 +5815,7 @@ fi CFLAGS_OPTIMIZE="-O2" ;; esac - if test "${TCL_THREADS}" = "1"; then : + if test "${TCL_THREADS}" = "1"; then # On OpenBSD: Compile with -pthread # Don't link with -lpthread @@ -5439,6 +5823,7 @@ fi CFLAGS="$CFLAGS -pthread" fi + # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots @@ -5451,12 +5836,13 @@ fi DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "${TCL_THREADS}" = "1"; then : + if test "${TCL_THREADS}" = "1"; then # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` @@ -5464,6 +5850,7 @@ fi LDFLAGS="$LDFLAGS -pthread" fi + ;; FreeBSD-*) # This configuration from FreeBSD Ports. @@ -5474,18 +5861,20 @@ fi DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi - if test "${TCL_THREADS}" = "1"; then : + + if test "${TCL_THREADS}" = "1"; then # The -pthread needs to go in the LDFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LIBS" fi + case $system in FreeBSD-3.*) # Version numbers are dot-stripped by system policy. @@ -5508,19 +5897,23 @@ fi CFLAGS="`echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" - if test $do64bit = yes; then : + if test $do64bit = yes; then case `arch` in ppc) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5 -$as_echo_n "checking if compiler accepts -arch ppc64 flag... " >&6; } -if ${tcl_cv_cc_arch_ppc64+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_arch_ppc64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -5531,33 +5924,62 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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 tcl_cv_cc_arch_ppc64=yes else - tcl_cv_cc_arch_ppc64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_arch_ppc64=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5 -$as_echo "$tcl_cv_cc_arch_ppc64" >&6; } - if test $tcl_cv_cc_arch_ppc64 = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 +echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6 + if test $tcl_cv_cc_arch_ppc64 = yes; then CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes -fi;; +fi +;; i386) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5 -$as_echo_n "checking if compiler accepts -arch x86_64 flag... " >&6; } -if ${tcl_cv_cc_arch_x86_64+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_arch_x86_64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -5568,48 +5990,79 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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 tcl_cv_cc_arch_x86_64=yes else - tcl_cv_cc_arch_x86_64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_arch_x86_64=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5 -$as_echo "$tcl_cv_cc_arch_x86_64" >&6; } - if test $tcl_cv_cc_arch_x86_64 = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 +echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6 + if test $tcl_cv_cc_arch_x86_64 = yes; then CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes -fi;; +fi +;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 -$as_echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; + { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 +echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; esac else # Check for combined 32-bit and 64-bit fat build if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \ - && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then : + && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then fat_32_64=yes fi + fi + SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}' - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -single_module flag" >&5 -$as_echo_n "checking if ld accepts -single_module flag... " >&6; } -if ${tcl_cv_ld_single_module+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 +echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_single_module+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -5620,41 +6073,71 @@ int i; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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 tcl_cv_ld_single_module=yes else - tcl_cv_ld_single_module=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_single_module=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_single_module" >&5 -$as_echo "$tcl_cv_ld_single_module" >&6; } - if test $tcl_cv_ld_single_module = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 +echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 + if test $tcl_cv_ld_single_module = yes; then SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi + SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" # Don't use -prebind when building for Mac OS X 10.4 or later only: if test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ - "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then : + "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then LDFLAGS="$LDFLAGS -prebind" fi + LDFLAGS="$LDFLAGS -headerpad_max_install_names" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5 -$as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; } -if ${tcl_cv_ld_search_paths_first+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 +echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_search_paths_first+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -5665,58 +6148,88 @@ int i; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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 tcl_cv_ld_search_paths_first=yes else - tcl_cv_ld_search_paths_first=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_search_paths_first=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5 -$as_echo "$tcl_cv_ld_search_paths_first" >&6; } - if test $tcl_cv_ld_search_paths_first = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 +echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 + if test $tcl_cv_ld_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi - if test "$tcl_cv_cc_visibility_hidden" != yes; then : + + if test "$tcl_cv_cc_visibility_hidden" != yes; then -$as_echo "#define MODULE_SCOPE __private_extern__" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define MODULE_SCOPE __private_extern__ +_ACEOF fi + CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" -$as_echo "#define MAC_OSX_TCL 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define MAC_OSX_TCL 1 +_ACEOF PLAT_OBJS='${MAC_OSX_OBJS}' PLAT_SRCS='${MAC_OSX_SRCS}' - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use CoreFoundation" >&5 -$as_echo_n "checking whether to use CoreFoundation... " >&6; } - # Check whether --enable-corefoundation was given. -if test "${enable_corefoundation+set}" = set; then : - enableval=$enable_corefoundation; tcl_corefoundation=$enableval + echo "$as_me:$LINENO: checking whether to use CoreFoundation" >&5 +echo $ECHO_N "checking whether to use CoreFoundation... $ECHO_C" >&6 + # Check whether --enable-corefoundation or --disable-corefoundation was given. +if test "${enable_corefoundation+set}" = set; then + enableval="$enable_corefoundation" + tcl_corefoundation=$enableval else tcl_corefoundation=yes -fi +fi; + echo "$as_me:$LINENO: result: $tcl_corefoundation" >&5 +echo "${ECHO_T}$tcl_corefoundation" >&6 + if test $tcl_corefoundation = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_corefoundation" >&5 -$as_echo "$tcl_corefoundation" >&6; } - if test $tcl_corefoundation = yes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CoreFoundation.framework" >&5 -$as_echo_n "checking for CoreFoundation.framework... " >&6; } -if ${tcl_cv_lib_corefoundation+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for CoreFoundation.framework" >&5 +echo $ECHO_N "checking for CoreFoundation.framework... $ECHO_C" >&6 +if test "${tcl_cv_lib_corefoundation+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_libs=$LIBS - if test "$fat_32_64" = yes; then : + if test "$fat_32_64" = yes; then for v in CFLAGS CPPFLAGS LDFLAGS; do # On Tiger there is no 64-bit CF, so remove 64-bit @@ -5726,8 +6239,13 @@ else eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done fi + LIBS="$LIBS -framework CoreFoundation" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -5738,45 +6256,77 @@ CFBundleRef b = CFBundleGetMainBundle(); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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 tcl_cv_lib_corefoundation=yes else - tcl_cv_lib_corefoundation=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_lib_corefoundation=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test "$fat_32_64" = yes; then : +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$fat_32_64" = yes; then for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi + LIBS=$hold_libs fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation" >&5 -$as_echo "$tcl_cv_lib_corefoundation" >&6; } - if test $tcl_cv_lib_corefoundation = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_lib_corefoundation" >&5 +echo "${ECHO_T}$tcl_cv_lib_corefoundation" >&6 + if test $tcl_cv_lib_corefoundation = yes; then LIBS="$LIBS -framework CoreFoundation" -$as_echo "#define HAVE_COREFOUNDATION 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_COREFOUNDATION 1 +_ACEOF else tcl_corefoundation=no fi - if test "$fat_32_64" = yes -a $tcl_corefoundation = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit CoreFoundation" >&5 -$as_echo_n "checking for 64-bit CoreFoundation... " >&6; } -if ${tcl_cv_lib_corefoundation_64+:} false; then : - $as_echo_n "(cached) " >&6 + if test "$fat_32_64" = yes -a $tcl_corefoundation = yes; then + + echo "$as_me:$LINENO: checking for 64-bit CoreFoundation" >&5 +echo $ECHO_N "checking for 64-bit CoreFoundation... $ECHO_C" >&6 +if test "${tcl_cv_lib_corefoundation_64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -5787,31 +6337,60 @@ CFBundleRef b = CFBundleGetMainBundle(); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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 tcl_cv_lib_corefoundation_64=yes else - tcl_cv_lib_corefoundation_64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_lib_corefoundation_64=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation_64" >&5 -$as_echo "$tcl_cv_lib_corefoundation_64" >&6; } - if test $tcl_cv_lib_corefoundation_64 = no; then : +echo "$as_me:$LINENO: result: $tcl_cv_lib_corefoundation_64" >&5 +echo "${ECHO_T}$tcl_cv_lib_corefoundation_64" >&6 + if test $tcl_cv_lib_corefoundation_64 = no; then -$as_echo "#define NO_COREFOUNDATION_64 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define NO_COREFOUNDATION_64 1 +_ACEOF LDFLAGS="$LDFLAGS -Wl,-no_arch_warnings" fi + fi + fi + ;; NEXTSTEP-*) SHLIB_CFLAGS="" @@ -5827,7 +6406,9 @@ fi SHLIB_LD_LIBS="" CFLAGS_OPTIMIZE="" # Optimizer is buggy -$as_echo "#define _OE_SOCKETS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _OE_SOCKETS 1 +_ACEOF ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) @@ -5845,13 +6426,14 @@ $as_echo "#define _OE_SOCKETS 1" >>confdefs.h OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" - if test "$SHARED_BUILD" = 1; then : + if test "$SHARED_BUILD" = 1; then SHLIB_LD="ld -shared" else SHLIB_LD="ld -non_shared" fi + SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -5862,7 +6444,7 @@ fi OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" - if test "$SHARED_BUILD" = 1; then : + if test "$SHARED_BUILD" = 1; then SHLIB_LD='ld -shared -expect_unresolved "*"' @@ -5871,27 +6453,30 @@ else SHLIB_LD='ld -non_shared -expect_unresolved "*"' fi + SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi - if test "$GCC" = yes; then : + + if test "$GCC" = yes; then CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi + # see pthread_intro(3) for pthread support on osf1, k.furukawa - if test "${TCL_THREADS}" = 1; then : + if test "${TCL_THREADS}" = 1; then CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` - if test "$GCC" = yes; then : + if test "$GCC" = yes; then LIBS="$LIBS -lpthread -lmach -lexc" @@ -5902,7 +6487,9 @@ else fi + fi + ;; QNX-6*) # QNX RTP @@ -5921,7 +6508,7 @@ fi # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. - if test "$GCC" = yes; then : + if test "$GCC" = yes; then SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" @@ -5932,6 +6519,7 @@ else LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi + SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" @@ -5976,17 +6564,21 @@ fi # won't define thread-safe library routines. -$as_echo "#define _REENTRANT 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF -$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF SHLIB_CFLAGS="-KPIC" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - if test "$GCC" = yes; then : + if test "$GCC" = yes; then SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' @@ -5999,32 +6591,37 @@ else LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi + ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. -$as_echo "#define _REENTRANT 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF -$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = yes; then : + if test "$do64bit" = yes; then arch=`isainfo` - if test "$arch" = "sparcv9 sparc"; then : + if test "$arch" = "sparcv9 sparc"; then - if test "$GCC" = yes; then : + if test "$GCC" = yes; then - if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then : + if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 -$as_echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} else @@ -6035,10 +6632,11 @@ else fi + else do64bit_ok=yes - if test "$do64bitVIS" = yes; then : + if test "$do64bitVIS" = yes; then CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" @@ -6049,15 +6647,17 @@ else LDFLAGS_ARCH="-xarch=v9" fi + # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" fi + else - if test "$arch" = "amd64 i386"; then : + if test "$arch" = "amd64 i386"; then - if test "$GCC" = yes; then : + if test "$GCC" = yes; then case $system in SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) @@ -6065,8 +6665,8 @@ else CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 -$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; esac else @@ -6083,32 +6683,169 @@ else fi + else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5 -$as_echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 +echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} fi + fi + fi + #-------------------------------------------------------------------- # On Solaris 5.x i386 with the sunpro compiler we need to link # with sunmath to get floating point rounding control #-------------------------------------------------------------------- - if test "$GCC" = yes; then : + if test "$GCC" = yes; then use_sunmath=no else arch=`isainfo` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use -lsunmath for fp rounding control" >&5 -$as_echo_n "checking whether to use -lsunmath for fp rounding control... " >&6; } - if test "$arch" = "amd64 i386"; then : + echo "$as_me:$LINENO: checking whether to use -lsunmath for fp rounding control" >&5 +echo $ECHO_N "checking whether to use -lsunmath for fp rounding control... $ECHO_C" >&6 + if test "$arch" = "amd64 i386"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 MATH_LIBS="-lsunmath $MATH_LIBS" - ac_fn_c_check_header_mongrel "$LINENO" "sunmath.h" "ac_cv_header_sunmath_h" "$ac_includes_default" -if test "x$ac_cv_header_sunmath_h" = xyes; then : + if test "${ac_cv_header_sunmath_h+set}" = set; then + echo "$as_me:$LINENO: checking for sunmath.h" >&5 +echo $ECHO_N "checking for sunmath.h... $ECHO_C" >&6 +if test "${ac_cv_header_sunmath_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sunmath_h" >&5 +echo "${ECHO_T}$ac_cv_header_sunmath_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking sunmath.h usability" >&5 +echo $ECHO_N "checking sunmath.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#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_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking sunmath.h presence" >&5 +echo $ECHO_N "checking sunmath.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sunmath.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sunmath.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sunmath.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sunmath.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sunmath.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sunmath.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sunmath.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sunmath.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sunmath.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sunmath.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------- ## +## Report this to the tk lists. ## +## ----------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for sunmath.h" >&5 +echo $ECHO_N "checking for sunmath.h... $ECHO_C" >&6 +if test "${ac_cv_header_sunmath_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sunmath_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sunmath_h" >&5 +echo "${ECHO_T}$ac_cv_header_sunmath_h" >&6 fi @@ -6117,24 +6854,26 @@ fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 use_sunmath=no fi + fi + SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - if test "$GCC" = yes; then : + if test "$GCC" = yes; then SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "$do64bit_ok" = yes; then : + if test "$do64bit_ok" = yes; then - if test "$arch" = "sparcv9 sparc"; then : + if test "$arch" = "sparcv9 sparc"; then # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. @@ -6145,22 +6884,26 @@ fi #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" else - if test "$arch" = "amd64 i386"; then : + if test "$arch" = "amd64 i386"; then SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" fi + fi + fi + else - if test "$use_sunmath" = yes; then : + if test "$use_sunmath" = yes; then textmode=textoff else textmode=text fi + case $system in SunOS-5.[1-9][0-9]*) SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";; @@ -6171,6 +6914,7 @@ fi LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi + ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" @@ -6181,15 +6925,19 @@ fi DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld accepts -Bexport flag" >&5 -$as_echo_n "checking for ld accepts -Bexport flag... " >&6; } -if ${tcl_cv_ld_Bexport+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 +echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_Bexport+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -6200,63 +6948,93 @@ int i; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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 tcl_cv_ld_Bexport=yes else - tcl_cv_ld_Bexport=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_Bexport=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_Bexport" >&5 -$as_echo "$tcl_cv_ld_Bexport" >&6; } - if test $tcl_cv_ld_Bexport = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 +echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6 + if test $tcl_cv_ld_Bexport = yes; then LDFLAGS="$LDFLAGS -Wl,-Bexport" fi + CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; esac - if test "$do64bit" = yes -a "$do64bit_ok" = no; then : + if test "$do64bit" = yes -a "$do64bit_ok" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 -$as_echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} + { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 +echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi - if test "$do64bit" = yes -a "$do64bit_ok" = yes; then : + + if test "$do64bit" = yes -a "$do64bit_ok" = yes; then -$as_echo "#define TCL_CFG_DO64BIT 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define TCL_CFG_DO64BIT 1 +_ACEOF fi + # Step 4: disable dynamic loading if requested via a command-line switch. - # Check whether --enable-load was given. -if test "${enable_load+set}" = set; then : - enableval=$enable_load; tcl_ok=$enableval + # Check whether --enable-load or --disable-load was given. +if test "${enable_load+set}" = set; then + enableval="$enable_load" + tcl_ok=$enableval else tcl_ok=yes -fi - - if test "$tcl_ok" = no; then : +fi; + if test "$tcl_ok" = no; then DL_OBJS="" fi - if test "x$DL_OBJS" != x; then : + + if test "x$DL_OBJS" != x; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&5 -$as_echo "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&2;} + { echo "$as_me:$LINENO: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&5 +echo "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&2;} SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" @@ -6268,13 +7046,14 @@ $as_echo "$as_me: WARNING: Can't figure out how to do dynamic loading or shared BUILD_DLTEST="" fi + LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. - if test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes; then : + if test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes; then case $system in AIX-*) ;; @@ -6288,21 +7067,24 @@ fi esac fi - if test "$SHARED_LIB_SUFFIX" = ""; then : + + if test "$SHARED_LIB_SUFFIX" = ""; then SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}' fi - if test "$UNSHARED_LIB_SUFFIX" = ""; then : + + if test "$UNSHARED_LIB_SUFFIX" = ""; then UNSHARED_LIB_SUFFIX='${VERSION}.a' fi + DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)" - if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""; then : + if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""; then LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' - if test "${SHLIB_SUFFIX}" = ".dll"; then : + if test "${SHLIB_SUFFIX}" = ".dll"; then INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" @@ -6313,11 +7095,12 @@ else fi + else LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} - if test "$RANLIB" = ""; then : + if test "$RANLIB" = ""; then MAKE_LIB='$(STLIB_LD) $@ ${OBJS}' INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' @@ -6329,10 +7112,12 @@ else fi + fi + # Stub lib does not depend on shared/static configuration - if test "$RANLIB" = ""; then : + if test "$RANLIB" = ""; then MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}' INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"' @@ -6344,25 +7129,31 @@ else fi + # Define TCL_LIBS now that we know what DL_LIBS is. # The trick here is that we don't want to change the value of TCL_LIBS if # it is already set when tclConfig.sh had been loaded by Tk. - if test "x${TCL_LIBS}" = x; then : + if test "x${TCL_LIBS}" = x; then TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}" fi + # See if the compiler supports casting to a union type. # This is used to stop gcc from printing a compiler # warning when initializing a union member. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5 -$as_echo_n "checking for cast to union support... " >&6; } -if ${tcl_cv_cast_to_union+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for cast to union support" >&5 +echo $ECHO_N "checking for cast to union support... $ECHO_C" >&6 +if test "${tcl_cv_cast_to_union+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -6376,19 +7167,45 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_cv_cast_to_union=yes else - tcl_cv_cast_to_union=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cast_to_union=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5 -$as_echo "$tcl_cv_cast_to_union" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_cast_to_union" >&5 +echo "${ECHO_T}$tcl_cv_cast_to_union" >&6 if test "$tcl_cv_cast_to_union" = "yes"; then -$as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_CAST_TO_UNION 1 +_ACEOF fi @@ -6434,34 +7251,38 @@ _ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5 -$as_echo_n "checking for build with symbols... " >&6; } - # Check whether --enable-symbols was given. -if test "${enable_symbols+set}" = set; then : - enableval=$enable_symbols; tcl_ok=$enableval + echo "$as_me:$LINENO: checking for build with symbols" >&5 +echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 + # Check whether --enable-symbols or --disable-symbols was given. +if test "${enable_symbols+set}" = set; then + enableval="$enable_symbols" + tcl_ok=$enableval else tcl_ok=no -fi - +fi; # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. DBGX="" if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' -$as_echo "#define NDEBUG 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define NDEBUG 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 -$as_echo "#define TCL_CFG_OPTIMIZED 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define TCL_CFG_OPTIMIZED 1 +_ACEOF else CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' if test "$tcl_ok" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5 -$as_echo "yes (standard debugging)" >&6; } + echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 +echo "${ECHO_T}yes (standard debugging)" >&6 fi fi @@ -6469,7 +7290,9 @@ $as_echo "yes (standard debugging)" >&6; } if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then -$as_echo "#define TCL_MEM_DEBUG 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define TCL_MEM_DEBUG 1 +_ACEOF fi @@ -6477,11 +7300,11 @@ $as_echo "#define TCL_MEM_DEBUG 1" >>confdefs.h if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem debugging" >&5 -$as_echo "enabled symbols mem debugging" >&6; } + echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 +echo "${ECHO_T}enabled symbols mem debugging" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5 -$as_echo "enabled $tcl_ok debugging" >&6; } + echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 +echo "${ECHO_T}enabled $tcl_ok debugging" >&6 fi fi @@ -6491,14 +7314,18 @@ $as_echo "enabled $tcl_ok debugging" >&6; } #-------------------------------------------------------------------- - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5 -$as_echo_n "checking for required early compiler flags... " >&6; } + echo "$as_me:$LINENO: checking for required early compiler flags" >&5 +echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 tcl_flags="" - if ${tcl_cv_flag__isoc99_source+:} false; then : - $as_echo_n "(cached) " >&6 + if test "${tcl_cv_flag__isoc99_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -6509,10 +7336,38 @@ char *p = (char *)strtoll; char *q = (char *)strtoull; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_cv_flag__isoc99_source=no else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include @@ -6524,28 +7379,58 @@ char *p = (char *)strtoll; char *q = (char *)strtoull; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_cv_flag__isoc99_source=yes else - tcl_cv_flag__isoc99_source=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__isoc99_source=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then -$as_echo "#define _ISOC99_SOURCE 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _ISOC99_SOURCE 1 +_ACEOF tcl_flags="$tcl_flags _ISOC99_SOURCE" fi - if ${tcl_cv_flag__largefile64_source+:} false; then : - $as_echo_n "(cached) " >&6 + if test "${tcl_cv_flag__largefile64_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -6556,10 +7441,38 @@ struct stat64 buf; int i = stat64("/", &buf); return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_cv_flag__largefile64_source=no else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE64_SOURCE 1 #include @@ -6571,28 +7484,58 @@ struct stat64 buf; int i = stat64("/", &buf); return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_cv_flag__largefile64_source=yes else - tcl_cv_flag__largefile64_source=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__largefile64_source=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then -$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _LARGEFILE64_SOURCE 1 +_ACEOF tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" fi - if ${tcl_cv_flag__largefile_source64+:} false; then : - $as_echo_n "(cached) " >&6 + if test "${tcl_cv_flag__largefile_source64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -6603,10 +7546,38 @@ char *p = (char *)open64; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_cv_flag__largefile_source64=no else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE_SOURCE64 1 #include @@ -6618,42 +7589,72 @@ char *p = (char *)open64; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_cv_flag__largefile_source64=yes else - tcl_cv_flag__largefile_source64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__largefile_source64=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then -$as_echo "#define _LARGEFILE_SOURCE64 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _LARGEFILE_SOURCE64 1 +_ACEOF tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" fi if test "x${tcl_flags}" = "x" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5 -$as_echo "${tcl_flags}" >&6; } + echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 +echo "${ECHO_T}${tcl_flags}" >&6 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit integer type" >&5 -$as_echo_n "checking for 64-bit integer type... " >&6; } - if ${tcl_cv_type_64bit+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 +echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 + if test "${tcl_cv_type_64bit+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -6664,16 +7665,44 @@ __int64 value = (__int64) 0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_type_64bit=__int64 else - tcl_type_64bit="long long" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_type_64bit="long long" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -6686,35 +7715,66 @@ switch (0) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_cv_type_64bit=${tcl_type_64bit} +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then -$as_echo "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define TCL_WIDE_INT_IS_LONG 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using long" >&5 -$as_echo "using long" >&6; } + echo "$as_me:$LINENO: result: using long" >&5 +echo "${ECHO_T}using long" >&6 else cat >>confdefs.h <<_ACEOF #define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} _ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_cv_type_64bit}" >&5 -$as_echo "${tcl_cv_type_64bit}" >&6; } + echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 +echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 # Now check for auxiliary declarations - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5 -$as_echo_n "checking for struct dirent64... " >&6; } -if ${tcl_cv_struct_dirent64+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for struct dirent64" >&5 +echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 +if test "${tcl_cv_struct_dirent64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include @@ -6726,28 +7786,58 @@ struct dirent64 p; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_cv_struct_dirent64=yes else - tcl_cv_struct_dirent64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_struct_dirent64=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5 -$as_echo "$tcl_cv_struct_dirent64" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 +echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6 if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then -$as_echo "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_DIRENT64 1 +_ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5 -$as_echo_n "checking for struct stat64... " >&6; } -if ${tcl_cv_struct_stat64+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for struct stat64" >&5 +echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 +if test "${tcl_cv_struct_stat64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -6759,40 +7849,161 @@ struct stat64 p; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_cv_struct_stat64=yes else - tcl_cv_struct_stat64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_struct_stat64=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5 -$as_echo "$tcl_cv_struct_stat64" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 +echo "${ECHO_T}$tcl_cv_struct_stat64" >&6 if test "x${tcl_cv_struct_stat64}" = "xyes" ; then -$as_echo "#define HAVE_STRUCT_STAT64 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_STAT64 1 +_ACEOF fi - for ac_func in open64 lseek64 -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + + +for ac_func in open64 lseek64 +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+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. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + 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 + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5 -$as_echo_n "checking for off64_t... " >&6; } - if ${tcl_cv_type_off64_t+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for off64_t" >&5 +echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 + if test "${tcl_cv_type_off64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -6804,25 +8015,51 @@ off64_t offset; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_cv_type_off64_t=yes else - tcl_cv_type_off64_t=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_type_off64_t=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then -$as_echo "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_TYPE_OFF64_T 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi @@ -6831,229 +8068,235 @@ $as_echo "no" >&6; } # Check endianness because we can optimize some operations #-------------------------------------------------------------------- - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - # Check for potential -arch flags. It is not universal unless - # there are at least two -arch flags with different values. - ac_arch= - ac_prev= - for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do - if test -n "$ac_prev"; then - case $ac_word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then - ac_arch=$ac_word - else - ac_cv_c_bigendian=universal - break - fi - ;; - esac - ac_prev= - elif test "x$ac_word" = "x-arch"; then - ac_prev=arch - fi - done -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include - #include +#include int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 # It does; now see whether it defined to BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include - #include +#include int main () { #if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif + not big endian +#endif ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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_c_bigendian=yes else - ac_cv_c_bigendian=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -int -main () -{ -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif +ac_cv_c_bigendian=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - ; - return 0; -} +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { -#ifndef _BIG_ENDIAN - not big endian - #endif - + _ascii (); _ebcdic (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then : - # Try to guess by grepping values from an object file. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default int main () { - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - - ; - return 0; + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./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_c_bigendian=no else - ac_cv_c_bigendian=yes + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h -;; #( - no) - ;; #( - universal) - -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) - ;; #( - *) - as_fn_error $? "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac #------------------------------------------------------------------------ @@ -7068,10 +8311,10 @@ if test "$TCL_EXEC_PREFIX" != "$exec_prefix"; then fi if test "$TCL_PREFIX" != "$prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: + { echo "$as_me:$LINENO: WARNING: Different --prefix selected for Tk and Tcl! [package require Tk] may not work correctly in tclsh." >&5 -$as_echo "$as_me: WARNING: +echo "$as_me: WARNING: Different --prefix selected for Tk and Tcl! [package require Tk] may not work correctly in tclsh." >&2;} fi @@ -7086,13 +8329,17 @@ fi # special flag. #-------------------------------------------------------------------- -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fd_set in sys/types" >&5 -$as_echo_n "checking for fd_set in sys/types... " >&6; } -if ${tcl_cv_type_fd_set+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for fd_set in sys/types" >&5 +echo $ECHO_N "checking for fd_set in sys/types... $ECHO_C" >&6 +if test "${tcl_cv_type_fd_set+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -7103,30 +8350,58 @@ fd_set readMask, writeMask; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_cv_type_fd_set=yes else - tcl_cv_type_fd_set=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_type_fd_set=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_type_fd_set" >&5 -$as_echo "$tcl_cv_type_fd_set" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_type_fd_set" >&5 +echo "${ECHO_T}$tcl_cv_type_fd_set" >&6 tk_ok=$tcl_cv_type_fd_set if test $tk_ok = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fd_mask in sys/select" >&5 -$as_echo_n "checking for fd_mask in sys/select... " >&6; } -if ${tcl_cv_grep_fd_mask+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for fd_mask in sys/select" >&5 +echo $ECHO_N "checking for fd_mask in sys/select... $ECHO_C" >&6 +if test "${tcl_cv_grep_fd_mask+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "fd_mask" >/dev/null 2>&1; then : + $EGREP "fd_mask" >/dev/null 2>&1; then tcl_cv_grep_fd_mask=present else tcl_cv_grep_fd_mask=missing @@ -7134,18 +8409,22 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_grep_fd_mask" >&5 -$as_echo "$tcl_cv_grep_fd_mask" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_grep_fd_mask" >&5 +echo "${ECHO_T}$tcl_cv_grep_fd_mask" >&6 if test $tcl_cv_grep_fd_mask = present; then -$as_echo "#define HAVE_SYS_SELECT_H 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_SYS_SELECT_H 1 +_ACEOF tk_ok=yes fi fi if test $tk_ok = no; then -$as_echo "#define NO_FD_SET 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define NO_FD_SET 1 +_ACEOF fi @@ -7153,24 +8432,166 @@ fi # Find out all about time handling differences. #------------------------------------------------------------------------------ + for ac_header in sys/time.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_time_h" = xyes; then : +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_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_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------- ## +## Report this to the tk lists. ## +## ----------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_TIME_H 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include @@ -7185,18 +8606,44 @@ return 0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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_time=yes else - ac_cv_header_time=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_time=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF fi @@ -7209,27 +8656,120 @@ fi #-------------------------------------------------------------------- - ac_fn_c_check_func "$LINENO" "strtod" "ac_cv_func_strtod" -if test "x$ac_cv_func_strtod" = xyes; then : - tcl_strtod=1 -else - tcl_strtod=0 -fi - - if test "$tcl_strtod" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris2.4/Tru64 strtod bugs" >&5 -$as_echo_n "checking for Solaris2.4/Tru64 strtod bugs... " >&6; } -if ${tcl_cv_strtod_buggy+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then : - tcl_cv_strtod_buggy=buggy + echo "$as_me:$LINENO: checking for strtod" >&5 +echo $ECHO_N "checking for strtod... $ECHO_C" >&6 +if test "${ac_cv_func_strtod+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define strtod to an innocuous variant, in case declares strtod. + For example, HP-UX 11i declares gettimeofday. */ +#define strtod innocuous_strtod - extern double strtod(); +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char strtod (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef strtod + +/* 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 strtod (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_strtod) || defined (__stub___strtod) +choke me +#else +char (*f) () = strtod; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != strtod; + ; + 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_func_strtod=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_strtod=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_strtod" >&5 +echo "${ECHO_T}$ac_cv_func_strtod" >&6 +if test $ac_cv_func_strtod = yes; then + tcl_strtod=1 +else + tcl_strtod=0 +fi + + if test "$tcl_strtod" = 1; then + echo "$as_me:$LINENO: checking for Solaris2.4/Tru64 strtod bugs" >&5 +echo $ECHO_N "checking for Solaris2.4/Tru64 strtod bugs... $ECHO_C" >&6 +if test "${tcl_cv_strtod_buggy+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + if test "$cross_compiling" = yes; then + tcl_cv_strtod_buggy=buggy +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + extern double strtod(); int main() { char *infString="Inf", *nanString="NaN", *spaceString=" "; char *term; @@ -7249,28 +8789,45 @@ else exit(0); } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./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 tcl_cv_strtod_buggy=ok else - tcl_cv_strtod_buggy=buggy + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +tcl_cv_strtod_buggy=buggy fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_strtod_buggy" >&5 -$as_echo "$tcl_cv_strtod_buggy" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_strtod_buggy" >&5 +echo "${ECHO_T}$tcl_cv_strtod_buggy" >&6 if test "$tcl_cv_strtod_buggy" = buggy; then - case " $LIBOBJS " in + case $LIBOBJS in + "fixstrtod.$ac_objext" | \ + *" fixstrtod.$ac_objext" | \ + "fixstrtod.$ac_objext "* | \ *" fixstrtod.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS fixstrtod.$ac_objext" - ;; + *) LIBOBJS="$LIBOBJS fixstrtod.$ac_objext" ;; esac USE_COMPAT=1 -$as_echo "#define strtod fixstrtod" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define strtod fixstrtod +_ACEOF fi fi @@ -7281,9 +8838,64 @@ $as_echo "#define strtod fixstrtod" >>confdefs.h # they don't exist. #-------------------------------------------------------------------- -ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" -if test "x$ac_cv_type_mode_t" = xyes; then : +echo "$as_me:$LINENO: checking for mode_t" >&5 +echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 +if test "${ac_cv_type_mode_t+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. */ +$ac_includes_default +int +main () +{ +if ((mode_t *) 0) + return 0; +if (sizeof (mode_t)) + return 0; + ; + return 0; +} +_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_type_mode_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_mode_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 +echo "${ECHO_T}$ac_cv_type_mode_t" >&6 +if test $ac_cv_type_mode_t = yes; then + : else cat >>confdefs.h <<_ACEOF @@ -7292,9 +8904,64 @@ _ACEOF fi -ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = xyes; then : +echo "$as_me:$LINENO: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 +if test "${ac_cv_type_pid_t+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. */ +$ac_includes_default +int +main () +{ +if ((pid_t *) 0) + return 0; +if (sizeof (pid_t)) + return 0; + ; + return 0; +} +_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_type_pid_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_pid_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6 +if test $ac_cv_type_pid_t = yes; then + : else cat >>confdefs.h <<_ACEOF @@ -7303,29 +8970,88 @@ _ACEOF fi -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+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. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_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_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_size_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : else cat >>confdefs.h <<_ACEOF -#define size_t unsigned int +#define size_t unsigned _ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -$as_echo_n "checking for uid_t in sys/types.h... " >&6; } -if ${ac_cv_type_uid_t+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 +if test "${ac_cv_type_uid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1; then : + $EGREP "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no @@ -7333,59 +9059,147 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -$as_echo "$ac_cv_type_uid_t" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +echo "${ECHO_T}$ac_cv_type_uid_t" >&6 if test $ac_cv_type_uid_t = no; then -$as_echo "#define uid_t int" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define uid_t int +_ACEOF -$as_echo "#define gid_t int" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define gid_t int +_ACEOF fi -ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default" -if test "x$ac_cv_type_intptr_t" = xyes; then : +echo "$as_me:$LINENO: checking for intptr_t" >&5 +echo $ECHO_N "checking for intptr_t... $ECHO_C" >&6 +if test "${ac_cv_type_intptr_t+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. */ +$ac_includes_default +int +main () +{ +if ((intptr_t *) 0) + return 0; +if (sizeof (intptr_t)) + return 0; + ; + return 0; +} +_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_type_intptr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_intptr_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_intptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_intptr_t" >&6 +if test $ac_cv_type_intptr_t = yes; then -$as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_INTPTR_T 1 +_ACEOF else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pointer-size signed integer type" >&5 -$as_echo_n "checking for pointer-size signed integer type... " >&6; } -if ${tcl_cv_intptr_t+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for pointer-size signed integer type" >&5 +echo $ECHO_N "checking for pointer-size signed integer type... $ECHO_C" >&6 +if test "${tcl_cv_intptr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else for tcl_cv_intptr_t in "int" "long" "long long" none; do if test "$tcl_cv_intptr_t" != none; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($tcl_cv_intptr_t))]; -test_array [0] = 0; -return test_array [0]; +test_array [0] = 0 ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_ok=yes else - tcl_ok=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_ok=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext test "$tcl_ok" = yes && break; fi done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_intptr_t" >&5 -$as_echo "$tcl_cv_intptr_t" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_intptr_t" >&5 +echo "${ECHO_T}$tcl_cv_intptr_t" >&6 if test "$tcl_cv_intptr_t" != none; then cat >>confdefs.h <<_ACEOF @@ -7396,48 +9210,132 @@ _ACEOF fi -ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" -if test "x$ac_cv_type_uintptr_t" = xyes; then : +echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 +if test "${ac_cv_type_uintptr_t+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. */ +$ac_includes_default +int +main () +{ +if ((uintptr_t *) 0) + return 0; +if (sizeof (uintptr_t)) + return 0; + ; + return 0; +} +_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_type_uintptr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uintptr_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 +if test $ac_cv_type_uintptr_t = yes; then -$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_UINTPTR_T 1 +_ACEOF else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pointer-size unsigned integer type" >&5 -$as_echo_n "checking for pointer-size unsigned integer type... " >&6; } -if ${tcl_cv_uintptr_t+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for pointer-size unsigned integer type" >&5 +echo $ECHO_N "checking for pointer-size unsigned integer type... $ECHO_C" >&6 +if test "${tcl_cv_uintptr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else for tcl_cv_uintptr_t in "unsigned int" "unsigned long" "unsigned long long" \ none; do if test "$tcl_cv_uintptr_t" != none; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($tcl_cv_uintptr_t))]; -test_array [0] = 0; -return test_array [0]; +test_array [0] = 0 ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_ok=yes else - tcl_ok=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_ok=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext test "$tcl_ok" = yes && break; fi done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_uintptr_t" >&5 -$as_echo "$tcl_cv_uintptr_t" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_uintptr_t" >&5 +echo "${ECHO_T}$tcl_cv_uintptr_t" >&6 if test "$tcl_cv_uintptr_t" != none; then cat >>confdefs.h <<_ACEOF @@ -7453,13 +9351,17 @@ fi # In OS/390 struct pwd has no pw_gecos field #------------------------------------------- -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pw_gecos in struct pwd" >&5 -$as_echo_n "checking pw_gecos in struct pwd... " >&6; } -if ${tcl_cv_pwd_pw_gecos+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking pw_gecos in struct pwd" >&5 +echo $ECHO_N "checking pw_gecos in struct pwd... $ECHO_C" >&6 +if test "${tcl_cv_pwd_pw_gecos+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -7470,18 +9372,44 @@ struct passwd pwd; pwd.pw_gecos; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_cv_pwd_pw_gecos=yes else - tcl_cv_pwd_pw_gecos=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_pwd_pw_gecos=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_pwd_pw_gecos" >&5 -$as_echo "$tcl_cv_pwd_pw_gecos" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_pwd_pw_gecos" >&5 +echo "${ECHO_T}$tcl_cv_pwd_pw_gecos" >&6 if test $tcl_cv_pwd_pw_gecos = yes; then -$as_echo "#define HAVE_PW_GECOS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_PW_GECOS 1 +_ACEOF fi @@ -7490,41 +9418,41 @@ fi #-------------------------------------------------------------------- if test "`uname -s`" = "Darwin" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use Aqua" >&5 -$as_echo_n "checking whether to use Aqua... " >&6; } - # Check whether --enable-aqua was given. -if test "${enable_aqua+set}" = set; then : - enableval=$enable_aqua; tk_aqua=$enableval + echo "$as_me:$LINENO: checking whether to use Aqua" >&5 +echo $ECHO_N "checking whether to use Aqua... $ECHO_C" >&6 + # Check whether --enable-aqua or --disable-aqua was given. +if test "${enable_aqua+set}" = set; then + enableval="$enable_aqua" + tk_aqua=$enableval else tk_aqua=no -fi - +fi; if test $tk_aqua = yes -o $tk_aqua = cocoa; then tk_aqua=yes if test $tcl_corefoundation = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Aqua can only be used when CoreFoundation is available" >&5 -$as_echo "$as_me: WARNING: Aqua can only be used when CoreFoundation is available" >&2;} + { echo "$as_me:$LINENO: WARNING: Aqua can only be used when CoreFoundation is available" >&5 +echo "$as_me: WARNING: Aqua can only be used when CoreFoundation is available" >&2;} tk_aqua=no fi if test ! -d /System/Library/Frameworks/Cocoa.framework; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Aqua can only be used when Cocoa is available" >&5 -$as_echo "$as_me: WARNING: Aqua can only be used when Cocoa is available" >&2;} + { echo "$as_me:$LINENO: WARNING: Aqua can only be used when Cocoa is available" >&5 +echo "$as_me: WARNING: Aqua can only be used when Cocoa is available" >&2;} tk_aqua=no fi if test "`uname -r | awk -F. '{print $1}'`" -lt 9; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Aqua requires Mac OS X 10.5 or later" >&5 -$as_echo "$as_me: WARNING: Aqua requires Mac OS X 10.5 or later" >&2;} + { echo "$as_me:$LINENO: WARNING: Aqua requires Mac OS X 10.5 or later" >&5 +echo "$as_me: WARNING: Aqua requires Mac OS X 10.5 or later" >&2;} tk_aqua=no fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tk_aqua" >&5 -$as_echo "$tk_aqua" >&6; } + echo "$as_me:$LINENO: result: $tk_aqua" >&5 +echo "${ECHO_T}$tk_aqua" >&6 if test "$fat_32_64" = yes; then if test $tk_aqua = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit X11" >&5 -$as_echo_n "checking for 64-bit X11... " >&6; } -if ${tcl_cv_lib_x11_64+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for 64-bit X11" >&5 +echo $ECHO_N "checking for 64-bit X11... $ECHO_C" >&6 +if test "${tcl_cv_lib_x11_64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else for v in CFLAGS CPPFLAGS LDFLAGS; do @@ -7532,7 +9460,11 @@ else done CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -7543,25 +9475,49 @@ XrmInitialize(); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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 tcl_cv_lib_x11_64=yes else - tcl_cv_lib_x11_64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_lib_x11_64=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_x11_64" >&5 -$as_echo "$tcl_cv_lib_x11_64" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_lib_x11_64" >&5 +echo "${ECHO_T}$tcl_cv_lib_x11_64" >&6 fi # remove 64-bit arch flags from CFLAGS et al. for combined 32 & 64 bit # fat builds if configuration does not support 64-bit. if test "$tcl_cv_lib_x11_64" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Removing 64-bit architectures from compiler & linker flags" >&5 -$as_echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;} + { echo "$as_me:$LINENO: Removing 64-bit architectures from compiler & linker flags" >&5 +echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;} for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done @@ -7569,15 +9525,19 @@ $as_echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >& fi if test $tk_aqua = no; then # check if weak linking whole libraries is possible. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -weak-l flag" >&5 -$as_echo_n "checking if ld accepts -weak-l flag... " >&6; } -if ${tcl_cv_ld_weak_l+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if ld accepts -weak-l flag" >&5 +echo $ECHO_N "checking if ld accepts -weak-l flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_weak_l+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-weak-lm" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -7588,24 +9548,186 @@ double f = sin(1.0); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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 tcl_cv_ld_weak_l=yes else - tcl_cv_ld_weak_l=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_weak_l=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_weak_l" >&5 -$as_echo "$tcl_cv_ld_weak_l" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_ld_weak_l" >&5 +echo "${ECHO_T}$tcl_cv_ld_weak_l" >&6 fi - for ac_header in AvailabilityMacros.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "AvailabilityMacros.h" "ac_cv_header_AvailabilityMacros_h" "$ac_includes_default" -if test "x$ac_cv_header_AvailabilityMacros_h" = xyes; then : + +for ac_header in AvailabilityMacros.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_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_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------- ## +## Report this to the tk lists. ## +## ----------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_AVAILABILITYMACROS_H 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -7613,14 +9735,18 @@ fi done if test "$ac_cv_header_AvailabilityMacros_h" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if weak import is available" >&5 -$as_echo_n "checking if weak import is available... " >&6; } -if ${tcl_cv_cc_weak_import+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if weak import is available" >&5 +echo $ECHO_N "checking if weak import is available... $ECHO_C" >&6 +if test "${tcl_cv_cc_weak_import+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ @@ -7640,30 +9766,60 @@ rand(); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - tcl_cv_cc_weak_import=yes +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 + tcl_cv_cc_weak_import=yes else - tcl_cv_cc_weak_import=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_weak_import=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_weak_import" >&5 -$as_echo "$tcl_cv_cc_weak_import" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_cc_weak_import" >&5 +echo "${ECHO_T}$tcl_cv_cc_weak_import" >&6 if test $tcl_cv_cc_weak_import = yes; then -$as_echo "#define HAVE_WEAK_IMPORT 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_WEAK_IMPORT 1 +_ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Darwin SUSv3 extensions are available" >&5 -$as_echo_n "checking if Darwin SUSv3 extensions are available... " >&6; } -if ${tcl_cv_cc_darwin_c_source+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if Darwin SUSv3 extensions are available" >&5 +echo $ECHO_N "checking if Darwin SUSv3 extensions are available... $ECHO_C" >&6 +if test "${tcl_cv_cc_darwin_c_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ @@ -7684,19 +9840,45 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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 tcl_cv_cc_darwin_c_source=yes else - tcl_cv_cc_darwin_c_source=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_darwin_c_source=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_darwin_c_source" >&5 -$as_echo "$tcl_cv_cc_darwin_c_source" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_cc_darwin_c_source" >&5 +echo "${ECHO_T}$tcl_cv_cc_darwin_c_source" >&6 if test $tcl_cv_cc_darwin_c_source = yes; then -$as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _DARWIN_C_SOURCE 1 +_ACEOF fi fi @@ -7706,14 +9888,18 @@ fi if test $tk_aqua = yes; then -$as_echo "#define MAC_OSX_TK 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define MAC_OSX_TK 1 +_ACEOF LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit" EXTRA_CC_SWITCHES='-std=gnu99 -x objective-c' TK_WINDOWINGSYSTEM=AQUA if test -n "${enable_symbols}" -a "${enable_symbols}" != no; then -$as_echo "#define TK_MAC_DEBUG 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define TK_MAC_DEBUG 1 +_ACEOF fi else @@ -7727,47 +9913,44 @@ else #-------------------------------------------------------------------- - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 -$as_echo_n "checking for X... " >&6; } + echo "$as_me:$LINENO: checking for X" >&5 +echo $ECHO_N "checking for X... $ECHO_C" >&6 -# Check whether --with-x was given. -if test "${with_x+set}" = set; then : - withval=$with_x; -fi +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" +fi; # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else - case $x_includes,$x_libraries in #( - *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( - *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : - $as_echo_n "(cached) " >&6 + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else + if test "${ac_cv_have_x+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no -rm -f -r conftest.dir +rm -fr conftest.dir if mkdir conftest.dir; then cd conftest.dir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat >Imakefile <<'_ACEOF' -incroot: - @echo incroot='${INCROOT}' -usrlibdir: - @echo usrlibdir='${USRLIBDIR}' -libdir: - @echo libdir='${LIBDIR}' -_ACEOF - if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. - for ac_var in incroot usrlibdir libdir; do - eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" - done +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +_ACEOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl dylib la dll; do - if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && - test -f "$ac_im_libdir/libX11.$ac_extension"; then + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then ac_im_usrlibdir=$ac_im_libdir; break fi done @@ -7775,41 +9958,37 @@ _ACEOF # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in - /usr/include) ac_x_includes= ;; + /usr/include) ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in - /usr/lib | /usr/lib64 | /lib | /lib64) ;; + /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. - rm -f -r conftest.dir + rm -fr conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include -/usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 -/usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include -/usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 -/usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 @@ -7831,14 +10010,38 @@ ac_x_header_dirs=' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # We can compile using X headers with no special include directory. ac_x_includes= else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir @@ -7846,7 +10049,7 @@ else fi done fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then @@ -7855,7 +10058,11 @@ if test "$ac_x_libraries" = no; then # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -7866,73 +10073,117 @@ XrmInitialize () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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 LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else - LIBS=$ac_save_LIBS -for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +LIBS=$ac_save_LIBS +for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! - for ac_extension in a so sl dylib la dll; do - if test -r "$ac_dir/libX11.$ac_extension"; then + for ac_extension in a so sl; do + if test -r $ac_dir/libXt.$ac_extension; then ac_x_libraries=$ac_dir break 2 fi done done fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no -case $ac_x_includes,$ac_x_libraries in #( - no,* | *,no | *\'*) - # Didn't find X, or a directory has "'" in its name. - ac_cv_have_x="have_x=no";; #( - *) - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$ac_x_includes'\ - ac_x_libraries='$ac_x_libraries'" -esac +if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi -;; #( - *) have_x=yes;; - esac +fi + + fi eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 -$as_echo "$have_x" >&6; } + echo "$as_me:$LINENO: result: $have_x" >&5 +echo "${ECHO_T}$have_x" >&6 no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$x_includes'\ - ac_x_libraries='$x_libraries'" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 -$as_echo "libraries $x_libraries, headers $x_includes" >&6; } + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 fi not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + not_really_there="yes" fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext else if test ! -r $x_includes/X11/Xlib.h; then not_really_there="yes" @@ -7940,25 +10191,49 @@ rm -f conftest.err conftest.i conftest.$ac_ext fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 header files" >&5 -$as_echo_n "checking for X11 header files... " >&6; } + echo "$as_me:$LINENO: checking for X11 header files" >&5 +echo $ECHO_N "checking for X11 header files... $ECHO_C" >&6 found_xincludes="no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then found_xincludes="yes" else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + found_xincludes="no" fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext if test "$found_xincludes" = "no"; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Xlib.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5 -$as_echo "$i" >&6; } + echo "$as_me:$LINENO: result: $i" >&5 +echo "${ECHO_T}$i" >&6 XINCLUDES=" -I$i" found_xincludes="yes" break @@ -7972,19 +10247,19 @@ $as_echo "$i" >&6; } fi fi if test "$found_xincludes" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: couldn't find any!" >&5 -$as_echo "couldn't find any!" >&6; } + echo "$as_me:$LINENO: result: couldn't find any!" >&5 +echo "${ECHO_T}couldn't find any!" >&6 fi if test "$no_x" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 libraries" >&5 -$as_echo_n "checking for X11 libraries... " >&6; } + echo "$as_me:$LINENO: checking for X11 libraries" >&5 +echo $ECHO_N "checking for X11 libraries... $ECHO_C" >&6 XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5 -$as_echo "$i" >&6; } + echo "$as_me:$LINENO: result: $i" >&5 +echo "${ECHO_T}$i" >&6 XLIBSW="-L$i -lX11" x_libraries="$i" break @@ -7998,50 +10273,78 @@ $as_echo "$i" >&6; } fi fi if test "$XLIBSW" = nope ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XCreateWindow in -lXwindow" >&5 -$as_echo_n "checking for XCreateWindow in -lXwindow... " >&6; } -if ${ac_cv_lib_Xwindow_XCreateWindow+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for XCreateWindow in -lXwindow" >&5 +echo $ECHO_N "checking for XCreateWindow in -lXwindow... $ECHO_C" >&6 +if test "${ac_cv_lib_Xwindow_XCreateWindow+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXwindow $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 XCreateWindow (); int main () { -return XCreateWindow (); +XCreateWindow (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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_Xwindow_XCreateWindow=yes else - ac_cv_lib_Xwindow_XCreateWindow=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xwindow_XCreateWindow=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xwindow_XCreateWindow" >&5 -$as_echo "$ac_cv_lib_Xwindow_XCreateWindow" >&6; } -if test "x$ac_cv_lib_Xwindow_XCreateWindow" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_Xwindow_XCreateWindow" >&5 +echo "${ECHO_T}$ac_cv_lib_Xwindow_XCreateWindow" >&6 +if test $ac_cv_lib_Xwindow_XCreateWindow = yes; then XLIBSW=-lXwindow fi fi if test "$XLIBSW" = nope ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find any! Using -lX11." >&5 -$as_echo "could not find any! Using -lX11." >&6; } + echo "$as_me:$LINENO: result: could not find any! Using -lX11." >&5 +echo "${ECHO_T}could not find any! Using -lX11." >&6 XLIBSW=-lX11 fi @@ -8090,37 +10393,65 @@ fi #-------------------------------------------------------------------- if test $tk_aqua = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXbsd" >&5 -$as_echo_n "checking for main in -lXbsd... " >&6; } -if ${ac_cv_lib_Xbsd_main+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for main in -lXbsd" >&5 +echo $ECHO_N "checking for main in -lXbsd... $ECHO_C" >&6 +if test "${ac_cv_lib_Xbsd_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXbsd $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { -return main (); +main (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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_Xbsd_main=yes else - ac_cv_lib_Xbsd_main=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xbsd_main=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xbsd_main" >&5 -$as_echo "$ac_cv_lib_Xbsd_main" >&6; } -if test "x$ac_cv_lib_Xbsd_main" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_Xbsd_main" >&5 +echo "${ECHO_T}$ac_cv_lib_Xbsd_main" >&6 +if test $ac_cv_lib_Xbsd_main = yes; then LIBS="$LIBS -lXbsd" fi @@ -8138,13 +10469,17 @@ fi #-------------------------------------------------------------------- if test -d /usr/include/mit -a $tk_aqua = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MIT X libraries" >&5 -$as_echo_n "checking MIT X libraries... " >&6; } + echo "$as_me:$LINENO: checking MIT X libraries" >&5 +echo $ECHO_N "checking MIT X libraries... $ECHO_C" >&6 tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS -I/usr/include/mit" tk_oldLibs=$LIBS LIBS="$LIBS -lX11-mit" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include @@ -8159,19 +10494,43 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 XLIBSW="-lX11-mit" XINCLUDES="-I/usr/include/mit" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$tk_oldCFlags LIBS=$tk_oldLibs fi @@ -8181,20 +10540,20 @@ fi #-------------------------------------------------------------------- if test $tk_aqua = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use xft" >&5 -$as_echo_n "checking whether to use xft... " >&6; } - # Check whether --enable-xft was given. -if test "${enable_xft+set}" = set; then : - enableval=$enable_xft; enable_xft=$enableval + 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 - +fi; XFT_CFLAGS="" XFT_LIBS="" if test "$enable_xft" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_xft" >&5 -$as_echo "$enable_xft" >&6; } + 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" @@ -8204,17 +10563,63 @@ $as_echo "$enable_xft" >&6; } 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 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_xft" >&5 -$as_echo "$found_xft" >&6; } + 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" - ac_fn_c_check_header_compile "$LINENO" "X11/Xft/Xft.h" "ac_cv_header_X11_Xft_Xft_h" "#include -" -if test "x$ac_cv_header_X11_Xft_Xft_h" = xyes; then : + 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 @@ -8230,43 +10635,72 @@ fi CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" tk_oldLibs=$LIBS LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XftFontOpen in -lXft" >&5 -$as_echo_n "checking for XftFontOpen in -lXft... " >&6; } -if ${ac_cv_lib_Xft_XftFontOpen+:} false; then : - $as_echo_n "(cached) " >&6 + +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 confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 () { -return XftFontOpen (); +XftFontOpen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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 - ac_cv_lib_Xft_XftFontOpen=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xft_XftFontOpen=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xft_XftFontOpen" >&5 -$as_echo "$ac_cv_lib_Xft_XftFontOpen" >&6; } -if test "x$ac_cv_lib_Xft_XftFontOpen" = xyes; then : +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 @@ -8287,43 +10721,71 @@ fi CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" tk_oldLibs=$LIBS LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW -lfontconfig" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FcFontSort in -lfontconfig" >&5 -$as_echo_n "checking for FcFontSort in -lfontconfig... " >&6; } -if ${ac_cv_lib_fontconfig_FcFontSort+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for FcFontSort in -lfontconfig" >&5 +echo $ECHO_N "checking for FcFontSort in -lfontconfig... $ECHO_C" >&6 +if test "${ac_cv_lib_fontconfig_FcFontSort+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfontconfig $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 FcFontSort (); int main () { -return FcFontSort (); +FcFontSort (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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_fontconfig_FcFontSort=yes else - ac_cv_lib_fontconfig_FcFontSort=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_fontconfig_FcFontSort=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fontconfig_FcFontSort" >&5 -$as_echo "$ac_cv_lib_fontconfig_FcFontSort" >&6; } -if test "x$ac_cv_lib_fontconfig_FcFontSort" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_fontconfig_FcFontSort" >&5 +echo "${ECHO_T}$ac_cv_lib_fontconfig_FcFontSort" >&6 +if test $ac_cv_lib_fontconfig_FcFontSort = yes; then XFT_LIBS="$XFT_LIBS -lfontconfig" @@ -8334,8 +10796,8 @@ fi fi if test "$found_xft" = "no" ; then if test "$enable_xft" = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't find xft configuration, or xft is unusable" >&5 -$as_echo "$as_me: WARNING: Can't find xft configuration, or xft is unusable" >&2;} + { 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="" @@ -8347,7 +10809,9 @@ $as_echo "$as_me: WARNING: Can't find xft configuration, or xft is unusable" >&2 if test $enable_xft = "yes" ; then UNIX_FONT_OBJS=tkUnixRFont.o -$as_echo "#define HAVE_XFT 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_XFT 1 +_ACEOF else UNIX_FONT_OBJS=tkUnixFont.o @@ -8366,9 +10830,55 @@ if test $tk_aqua = no; then tk_oldLibs=$LIBS CFLAGS="$CFLAGS $XINCLUDES" LIBS="$LIBS $XLIBSW" - ac_fn_c_check_header_compile "$LINENO" "X11/XKBlib.h" "ac_cv_header_X11_XKBlib_h" "#include -" -if test "x$ac_cv_header_X11_XKBlib_h" = xyes; then : + 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 @@ -8380,43 +10890,71 @@ fi if test $xkblib_header_found = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XkbKeycodeToKeysym in -lX11" >&5 -$as_echo_n "checking for XkbKeycodeToKeysym in -lX11... " >&6; } -if ${ac_cv_lib_X11_XkbKeycodeToKeysym+:} false; then : - $as_echo_n "(cached) " >&6 + 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 () { -return XkbKeycodeToKeysym (); +XkbKeycodeToKeysym (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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 - ac_cv_lib_X11_XkbKeycodeToKeysym=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_X11_XkbKeycodeToKeysym=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XkbKeycodeToKeysym" >&5 -$as_echo "$ac_cv_lib_X11_XkbKeycodeToKeysym" >&6; } -if test "x$ac_cv_lib_X11_XkbKeycodeToKeysym" = xyes; then : +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 @@ -8431,7 +10969,9 @@ fi fi if test $xkbkeycodetokeysym_found = "yes" ; then -$as_echo "#define HAVE_XKBKEYCODETOKEYSYM 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_XKBKEYCODETOKEYSYM 1 +_ACEOF fi CFLAGS=$tk_oldCFlags @@ -8454,115 +10994,306 @@ if test $tk_aqua = no; then LIBS="$tk_oldLibs $XLIBSW" xss_header_found=no xss_lib_found=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to try to use XScreenSaver" >&5 -$as_echo_n "checking whether to try to use XScreenSaver... " >&6; } - # Check whether --enable-xss was given. -if test "${enable_xss+set}" = set; then : - enableval=$enable_xss; enable_xss=$enableval + echo "$as_me:$LINENO: checking whether to try to use XScreenSaver" >&5 +echo $ECHO_N "checking whether to try to use XScreenSaver... $ECHO_C" >&6 + # Check whether --enable-xss or --disable-xss was given. +if test "${enable_xss+set}" = set; then + enableval="$enable_xss" + enable_xss=$enableval else enable_xss=yes -fi - +fi; if test "$enable_xss" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_xss" >&5 -$as_echo "$enable_xss" >&6; } + echo "$as_me:$LINENO: result: $enable_xss" >&5 +echo "${ECHO_T}$enable_xss" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_xss" >&5 -$as_echo "$enable_xss" >&6; } - ac_fn_c_check_header_compile "$LINENO" "X11/extensions/scrnsaver.h" "ac_cv_header_X11_extensions_scrnsaver_h" "#include -" -if test "x$ac_cv_header_X11_extensions_scrnsaver_h" = xyes; then : + echo "$as_me:$LINENO: result: $enable_xss" >&5 +echo "${ECHO_T}$enable_xss" >&6 + echo "$as_me:$LINENO: checking for X11/extensions/scrnsaver.h" >&5 +echo $ECHO_N "checking for X11/extensions/scrnsaver.h... $ECHO_C" >&6 +if test "${ac_cv_header_X11_extensions_scrnsaver_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_extensions_scrnsaver_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_X11_extensions_scrnsaver_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_scrnsaver_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_extensions_scrnsaver_h" >&6 +if test $ac_cv_header_X11_extensions_scrnsaver_h = yes; then xss_header_found=yes fi - ac_fn_c_check_func "$LINENO" "XScreenSaverQueryInfo" "ac_cv_func_XScreenSaverQueryInfo" -if test "x$ac_cv_func_XScreenSaverQueryInfo" = xyes; then : + echo "$as_me:$LINENO: checking for XScreenSaverQueryInfo" >&5 +echo $ECHO_N "checking for XScreenSaverQueryInfo... $ECHO_C" >&6 +if test "${ac_cv_func_XScreenSaverQueryInfo+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. */ +/* Define XScreenSaverQueryInfo to an innocuous variant, in case declares XScreenSaverQueryInfo. + For example, HP-UX 11i declares gettimeofday. */ +#define XScreenSaverQueryInfo innocuous_XScreenSaverQueryInfo + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char XScreenSaverQueryInfo (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef XScreenSaverQueryInfo + +/* 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 XScreenSaverQueryInfo (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_XScreenSaverQueryInfo) || defined (__stub___XScreenSaverQueryInfo) +choke me +#else +char (*f) () = XScreenSaverQueryInfo; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != XScreenSaverQueryInfo; + ; + 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_func_XScreenSaverQueryInfo=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_func_XScreenSaverQueryInfo=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_XScreenSaverQueryInfo" >&5 +echo "${ECHO_T}$ac_cv_func_XScreenSaverQueryInfo" >&6 +if test $ac_cv_func_XScreenSaverQueryInfo = yes; then + : else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XScreenSaverQueryInfo in -lXext" >&5 -$as_echo_n "checking for XScreenSaverQueryInfo in -lXext... " >&6; } -if ${ac_cv_lib_Xext_XScreenSaverQueryInfo+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for XScreenSaverQueryInfo in -lXext" >&5 +echo $ECHO_N "checking for XScreenSaverQueryInfo in -lXext... $ECHO_C" >&6 +if test "${ac_cv_lib_Xext_XScreenSaverQueryInfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 XScreenSaverQueryInfo (); int main () { -return XScreenSaverQueryInfo (); +XScreenSaverQueryInfo (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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_Xext_XScreenSaverQueryInfo=yes else - ac_cv_lib_Xext_XScreenSaverQueryInfo=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xext_XScreenSaverQueryInfo=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XScreenSaverQueryInfo" >&5 -$as_echo "$ac_cv_lib_Xext_XScreenSaverQueryInfo" >&6; } -if test "x$ac_cv_lib_Xext_XScreenSaverQueryInfo" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XScreenSaverQueryInfo" >&5 +echo "${ECHO_T}$ac_cv_lib_Xext_XScreenSaverQueryInfo" >&6 +if test $ac_cv_lib_Xext_XScreenSaverQueryInfo = yes; then XLIBSW="$XLIBSW -lXext" xss_lib_found=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XScreenSaverQueryInfo in -lXss" >&5 -$as_echo_n "checking for XScreenSaverQueryInfo in -lXss... " >&6; } -if ${ac_cv_lib_Xss_XScreenSaverQueryInfo+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for XScreenSaverQueryInfo in -lXss" >&5 +echo $ECHO_N "checking for XScreenSaverQueryInfo in -lXss... $ECHO_C" >&6 +if test "${ac_cv_lib_Xss_XScreenSaverQueryInfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXss -lXext $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* 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 XScreenSaverQueryInfo (); int main () { -return XScreenSaverQueryInfo (); +XScreenSaverQueryInfo (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +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_Xss_XScreenSaverQueryInfo=yes else - ac_cv_lib_Xss_XScreenSaverQueryInfo=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xss_XScreenSaverQueryInfo=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xss_XScreenSaverQueryInfo" >&5 -$as_echo "$ac_cv_lib_Xss_XScreenSaverQueryInfo" >&6; } -if test "x$ac_cv_lib_Xss_XScreenSaverQueryInfo" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_Xss_XScreenSaverQueryInfo" >&5 +echo "${ECHO_T}$ac_cv_lib_Xss_XScreenSaverQueryInfo" >&6 +if test $ac_cv_lib_Xss_XScreenSaverQueryInfo = yes; then if test "$tcl_cv_ld_weak_l" = yes; then # On Darwin, weak link libXss if possible, @@ -8584,7 +11315,9 @@ fi fi if test $enable_xss = yes -a $xss_lib_found = yes -a $xss_header_found = yes; then -$as_echo "#define HAVE_XSS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_XSS 1 +_ACEOF fi CFLAGS=$tk_oldCFlags @@ -8596,36 +11329,66 @@ fi # #define for __CHAR_UNSIGNED__. #-------------------------------------------------------------------- -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 -$as_echo_n "checking whether char is unsigned... " >&6; } -if ${ac_cv_c_char_unsigned+:} false; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking whether char is unsigned" >&5 +echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6 +if test "${ac_cv_c_char_unsigned+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((char) -1) < 0)]; -test_array [0] = 0; -return test_array [0]; +test_array [0] = 0 ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +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_c_char_unsigned=no else - ac_cv_c_char_unsigned=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_char_unsigned=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 -$as_echo "$ac_cv_c_char_unsigned" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 +echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6 if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then - $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define __CHAR_UNSIGNED__ 1 +_ACEOF fi @@ -8664,38 +11427,38 @@ WISH_RSRC_FILE='wish$(VERSION).rsrc' if test "`uname -s`" = "Darwin" ; then if test "`uname -s`" = "Darwin" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to package libraries" >&5 -$as_echo_n "checking how to package libraries... " >&6; } - # Check whether --enable-framework was given. -if test "${enable_framework+set}" = set; then : - enableval=$enable_framework; enable_framework=$enableval + echo "$as_me:$LINENO: checking how to package libraries" >&5 +echo $ECHO_N "checking how to package libraries... $ECHO_C" >&6 + # Check whether --enable-framework or --disable-framework was given. +if test "${enable_framework+set}" = set; then + enableval="$enable_framework" + enable_framework=$enableval else enable_framework=no -fi - +fi; if test $enable_framework = yes; then if test $SHARED_BUILD = 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be built if --enable-shared is yes" >&5 -$as_echo "$as_me: WARNING: Frameworks can only be built if --enable-shared is yes" >&2;} + { echo "$as_me:$LINENO: WARNING: Frameworks can only be built if --enable-shared is yes" >&5 +echo "$as_me: WARNING: Frameworks can only be built if --enable-shared is yes" >&2;} enable_framework=no fi if test $tcl_corefoundation = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be used when CoreFoundation is available" >&5 -$as_echo "$as_me: WARNING: Frameworks can only be used when CoreFoundation is available" >&2;} + { echo "$as_me:$LINENO: WARNING: Frameworks can only be used when CoreFoundation is available" >&5 +echo "$as_me: WARNING: Frameworks can only be used when CoreFoundation is available" >&2;} enable_framework=no fi fi if test $enable_framework = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: framework" >&5 -$as_echo "framework" >&6; } + echo "$as_me:$LINENO: result: framework" >&5 +echo "${ECHO_T}framework" >&6 FRAMEWORK_BUILD=1 else if test $SHARED_BUILD = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared library" >&5 -$as_echo "shared library" >&6; } + echo "$as_me:$LINENO: result: shared library" >&5 +echo "${ECHO_T}shared library" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: static library" >&5 -$as_echo "static library" >&6; } + echo "$as_me:$LINENO: result: static library" >&5 +echo "${ECHO_T}static library" >&6 fi FRAMEWORK_BUILD=0 fi @@ -8707,7 +11470,7 @@ $as_echo "static library" >&6; } TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tk-Info.plist' EXTRA_WISH_LIBS='-sectcreate __TEXT __info_plist Wish-Info.plist' EXTRA_APP_CC_SWITCHES="${EXTRA_APP_CC_SWITCHES}"' -mdynamic-no-pic' - ac_config_files="$ac_config_files Tk-Info.plist:../macosx/Tk-Info.plist.in Wish-Info.plist:../macosx/Wish-Info.plist.in" + ac_config_files="$ac_config_files Tk-Info.plist:../macosx/Tk-Info.plist.in Wish-Info.plist:../macosx/Wish-Info.plist.in" for l in ${LOCALES}; do CFBUNDLELOCALIZATIONS="${CFBUNDLELOCALIZATIONS}$l"; done TK_YEAR="`date +%Y`" @@ -8715,11 +11478,13 @@ fi if test "$FRAMEWORK_BUILD" = "1" ; then -$as_echo "#define TK_FRAMEWORK 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define TK_FRAMEWORK 1 +_ACEOF # Construct a fake local framework structure to make linking with # '-framework Tk' and running of tktest work - ac_config_commands="$ac_config_commands Tk.framework" + ac_config_commands="$ac_config_commands Tk.framework" LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH" if test "${libdir}" = '${exec_prefix}/lib'; then @@ -8857,7 +11622,7 @@ TK_SHARED_BUILD=${SHARED_BUILD} -ac_config_files="$ac_config_files Makefile:../unix/Makefile.in tkConfig.sh:../unix/tkConfig.sh.in tk.pc:../unix/tk.pc.in" + ac_config_files="$ac_config_files Makefile:../unix/Makefile.in tkConfig.sh:../unix/tkConfig.sh.in tk.pc:../unix/tk.pc.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -8877,70 +11642,39 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. +# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - +{ (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( + ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; - esac | - sort -) | + esac; +} | sed ' - /^ac_cv_env_/b end t clear - :clear + : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + echo "not updating unwritable cache $cache_file" fi fi rm -f confcache @@ -8949,55 +11683,63 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that -# take arguments), then branch to the quote section. Otherwise, +# take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. -ac_script=' -:mline -/\\$/{ - N - s,\\\n,, - b mline -} +cat >confdef2opt.sed <<\_ACEOF t clear -:clear -s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote -s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote -b any -:quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g -s/\$/$$/g -H -:any -${ - g - s/^\n// - s/\n/ /g - p -} -' -DEFS=`sed -n "$ac_script" confdefs.h` +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= -U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -9006,15 +11748,12 @@ LTLIBOBJS=$ac_ltlibobjs CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 +: ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -9024,253 +11763,81 @@ cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 debug=false ac_cs_recheck=false ac_cs_silent=false - SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - +done -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi -as_me=`$as_basename -- "$0" || +# Name of the executable. +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + +# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -9278,111 +11845,148 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - as_ln_s='cp -pR' + PATH_SEPARATOR=: fi -else - as_ln_s='cp -pR' + rm -f conf$$.sh fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done - case $as_dir in #( - -*) as_dir=./$as_dir;; + ;; esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file -} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' + as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p +as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -9391,20 +11995,31 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to + +# Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + This file was extended by tk $as_me 8.5, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -9412,41 +12027,43 @@ generated by GNU Autoconf 2.69. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 _ACEOF -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_commands="$ac_config_commands" +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi -_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. +\`$as_me' instantiates files from templates according to the +current configuration. -Usage: $0 [OPTION]... [TAG]... +Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages + -V, --version print version number, then exit + -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE Configuration files: $config_files @@ -9454,78 +12071,83 @@ $config_files Configuration commands: $config_commands -Report bugs to the package provider." - +Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" + +cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ tk config.status 8.5 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -test -n "\$AWK" || AWK=awk +srcdir=$srcdir _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; - *) + -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; esac case $ac_option in # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; - --he | --h | --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; + *) ac_config_targets="$ac_config_targets $1" ;; esac shift @@ -9539,54 +12161,42 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF # -# INIT-COMMANDS +# INIT-COMMANDS section. # + VERSION=${TK_VERSION} && tk_aqua=${tk_aqua} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Handling of arguments. + +cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do - case $ac_config_target in - "Tk-Info.plist") CONFIG_FILES="$CONFIG_FILES Tk-Info.plist:../macosx/Tk-Info.plist.in" ;; - "Wish-Info.plist") CONFIG_FILES="$CONFIG_FILES Wish-Info.plist:../macosx/Wish-Info.plist.in" ;; - "Tk.framework") CONFIG_COMMANDS="$CONFIG_COMMANDS Tk.framework" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:../unix/Makefile.in" ;; - "tkConfig.sh") CONFIG_FILES="$CONFIG_FILES tkConfig.sh:../unix/tkConfig.sh.in" ;; - "tk.pc") CONFIG_FILES="$CONFIG_FILES tk.pc:../unix/tk.pc.in" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + case "$ac_config_target" in + # Handling of arguments. + "Tk-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Tk-Info.plist:../macosx/Tk-Info.plist.in" ;; + "Wish-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Wish-Info.plist:../macosx/Wish-Info.plist.in" ;; + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile:../unix/Makefile.in" ;; + "tkConfig.sh" ) CONFIG_FILES="$CONFIG_FILES tkConfig.sh:../unix/tkConfig.sh.in" ;; + "tk.pc" ) CONFIG_FILES="$CONFIG_FILES tk.pc:../unix/tk.pc.in" ;; + "Tk.framework" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Tk.framework" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; esac done - # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -9597,409 +12207,523 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, +# simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# Create a temporary directory, and hook for its removal unless debugging. $debug || { - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 } + # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" } || { - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || { - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' &2 + { (exit 1); exit 1; } } -' >>$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" +cat >>$CONFIG_STATUS <<_ACEOF +# +# CONFIG_FILES section. +# -eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@TCL_VERSION@,$TCL_VERSION,;t t +s,@TCL_PATCH_LEVEL@,$TCL_PATCH_LEVEL,;t t +s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t +s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t +s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t +s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t +s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t +s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t +s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t +s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t +s,@TCLSH_PROG@,$TCLSH_PROG,;t t +s,@BUILD_TCLSH@,$BUILD_TCLSH,;t t +s,@MAN_FLAGS@,$MAN_FLAGS,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@TCL_THREADS@,$TCL_THREADS,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@AR@,$AR,;t t +s,@ac_ct_AR@,$ac_ct_AR,;t t +s,@TCL_LIBS@,$TCL_LIBS,;t t +s,@DL_LIBS@,$DL_LIBS,;t t +s,@DL_OBJS@,$DL_OBJS,;t t +s,@PLAT_OBJS@,$PLAT_OBJS,;t t +s,@PLAT_SRCS@,$PLAT_SRCS,;t t +s,@LDAIX_SRC@,$LDAIX_SRC,;t t +s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t +s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t +s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t +s,@LDFLAGS_DEBUG@,$LDFLAGS_DEBUG,;t t +s,@LDFLAGS_OPTIMIZE@,$LDFLAGS_OPTIMIZE,;t t +s,@CC_SEARCH_FLAGS@,$CC_SEARCH_FLAGS,;t t +s,@LD_SEARCH_FLAGS@,$LD_SEARCH_FLAGS,;t t +s,@STLIB_LD@,$STLIB_LD,;t t +s,@SHLIB_LD@,$SHLIB_LD,;t t +s,@TCL_SHLIB_LD_EXTRAS@,$TCL_SHLIB_LD_EXTRAS,;t t +s,@TK_SHLIB_LD_EXTRAS@,$TK_SHLIB_LD_EXTRAS,;t t +s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t +s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t +s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t +s,@MAKE_LIB@,$MAKE_LIB,;t t +s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t +s,@INSTALL_LIB@,$INSTALL_LIB,;t t +s,@DLL_INSTALL_DIR@,$DLL_INSTALL_DIR,;t t +s,@INSTALL_STUB_LIB@,$INSTALL_STUB_LIB,;t t +s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t +s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@XFT_CFLAGS@,$XFT_CFLAGS,;t t +s,@XFT_LIBS@,$XFT_LIBS,;t t +s,@UNIX_FONT_OBJS@,$UNIX_FONT_OBJS,;t t +s,@TK_VERSION@,$TK_VERSION,;t t +s,@TK_MAJOR_VERSION@,$TK_MAJOR_VERSION,;t t +s,@TK_MINOR_VERSION@,$TK_MINOR_VERSION,;t t +s,@TK_PATCH_LEVEL@,$TK_PATCH_LEVEL,;t t +s,@TK_YEAR@,$TK_YEAR,;t t +s,@TK_LIB_FILE@,$TK_LIB_FILE,;t t +s,@TK_LIB_FLAG@,$TK_LIB_FLAG,;t t +s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t +s,@TK_STUB_LIB_FILE@,$TK_STUB_LIB_FILE,;t t +s,@TK_STUB_LIB_FLAG@,$TK_STUB_LIB_FLAG,;t t +s,@TK_STUB_LIB_SPEC@,$TK_STUB_LIB_SPEC,;t t +s,@TK_STUB_LIB_PATH@,$TK_STUB_LIB_PATH,;t t +s,@TK_INCLUDE_SPEC@,$TK_INCLUDE_SPEC,;t t +s,@TK_BUILD_STUB_LIB_SPEC@,$TK_BUILD_STUB_LIB_SPEC,;t t +s,@TK_BUILD_STUB_LIB_PATH@,$TK_BUILD_STUB_LIB_PATH,;t t +s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t +s,@TK_SHARED_BUILD@,$TK_SHARED_BUILD,;t t +s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t +s,@TK_BUILD_LIB_SPEC@,$TK_BUILD_LIB_SPEC,;t t +s,@TCL_STUB_FLAGS@,$TCL_STUB_FLAGS,;t t +s,@XINCLUDES@,$XINCLUDES,;t t +s,@XLIBSW@,$XLIBSW,;t t +s,@LOCALES@,$LOCALES,;t t +s,@TK_WINDOWINGSYSTEM@,$TK_WINDOWINGSYSTEM,;t t +s,@TK_PKG_DIR@,$TK_PKG_DIR,;t t +s,@TK_LIBRARY@,$TK_LIBRARY,;t t +s,@LIB_RUNTIME_DIR@,$LIB_RUNTIME_DIR,;t t +s,@PRIVATE_INCLUDE_DIR@,$PRIVATE_INCLUDE_DIR,;t t +s,@HTML_DIR@,$HTML_DIR,;t t +s,@EXTRA_CC_SWITCHES@,$EXTRA_CC_SWITCHES,;t t +s,@EXTRA_APP_CC_SWITCHES@,$EXTRA_APP_CC_SWITCHES,;t t +s,@EXTRA_INSTALL@,$EXTRA_INSTALL,;t t +s,@EXTRA_INSTALL_BINARIES@,$EXTRA_INSTALL_BINARIES,;t t +s,@EXTRA_BUILD_HTML@,$EXTRA_BUILD_HTML,;t t +s,@EXTRA_WISH_LIBS@,$EXTRA_WISH_LIBS,;t t +s,@CFBUNDLELOCALIZATIONS@,$CFBUNDLELOCALIZATIONS,;t t +s,@TK_RSRC_FILE@,$TK_RSRC_FILE,;t t +s,@WISH_RSRC_FILE@,$WISH_RSRC_FILE,;t t +s,@LIB_RSRC_FILE@,$LIB_RSRC_FILE,;t t +s,@APP_RSRC_FILE@,$APP_RSRC_FILE,;t t +s,@REZ@,$REZ,;t t +s,@REZ_FLAGS@,$REZ_FLAGS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - ac_dir=`$as_dirname -- "$ac_file" || + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi case $srcdir in - .) # We are building in place. + .) # No --srcdir option. We are building in place. ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac - case $ac_mode in - :F) - # - # CONFIG_FILE - # -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } _ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. - case $ac_file$ac_mode in - "Tk.framework":C) n=Tk && +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + Tk.framework ) n=Tk && f=$n.framework && v=Versions/$VERSION && rm -rf $f && mkdir -p $f/$v/Resources && ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v && @@ -10007,18 +12731,17 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} if test $tk_aqua = yes; then ln -s ../../../../$n.rsrc $f/$v/Resources; fi && unset n f v ;; - esac -done # for ac_tag +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -as_fn_exit 0 +{ (exit 0); exit 0; } _ACEOF +chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -10038,11 +12761,7 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + $ac_cs_success || { (exit 1); exit 1; } fi -- cgit v0.12 From b88c04907a34f7ca20777929634bcc40370d95ee Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 20 May 2015 15:17:10 +0000 Subject: [29044ba23f] Remove RANLIB as part of library installation. At best it's redundant to the RANLIB already done as part of library build. At worst, it conflicts with needs of cross-compiling. Thanks Erik Leunissen. --- unix/Makefile.in | 4 ---- unix/configure | 6 ++---- unix/tcl.m4 | 6 ++---- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 0736055..331722c 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -709,10 +709,6 @@ install-strip: INSTALL_PROGRAM="$(INSTALL_PROGRAM) ${INSTALL_STRIP_PROGRAM}" \ INSTALL_LIBRARY="$(INSTALL_LIBRARY) ${INSTALL_STRIP_LIBRARY}" -# Note: before running ranlib below, must cd to target directory because -# some ranlibs write to current directory, and this might not always be -# possible (e.g. if installing as root). - install-binaries: $(TK_STUB_LIB_FILE) $(TK_LIB_FILE) ${WISH_EXE} @for i in "$(LIB_INSTALL_DIR)" "$(BIN_INSTALL_DIR)" \ "$(PKG_INSTALL_DIR)" "$(CONFIG_INSTALL_DIR)" ; \ diff --git a/unix/configure b/unix/configure index c10a247..7934d9e 100755 --- a/unix/configure +++ b/unix/configure @@ -6695,15 +6695,14 @@ else if test "$RANLIB" = ""; then MAKE_LIB='$(STLIB_LD) $@ ${OBJS}' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' else MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)" ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(LIB_FILE))' fi + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' fi @@ -6712,15 +6711,14 @@ fi if test "$RANLIB" = ""; then MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}' - INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"' else MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@' - INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)" ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(STUB_LIB_FILE))' fi + INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"' # Define TCL_LIBS now that we know what DL_LIBS is. # The trick here is that we don't want to change the value of TCL_LIBS if diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 1a56932..a6cb41b 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -2060,21 +2060,19 @@ dnl # preprocessing tests use only CPPFLAGS. AS_IF([test "$RANLIB" = ""], [ MAKE_LIB='$(STLIB_LD) [$]@ ${OBJS}' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' ], [ MAKE_LIB='${STLIB_LD} [$]@ ${OBJS} ; ${RANLIB} [$]@' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)" ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(LIB_FILE))' ]) + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' ]) # Stub lib does not depend on shared/static configuration AS_IF([test "$RANLIB" = ""], [ MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS}' - INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"' ], [ MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS} ; ${RANLIB} [$]@' - INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)" ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(STUB_LIB_FILE))' ]) + INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"' # Define TCL_LIBS now that we know what DL_LIBS is. # The trick here is that we don't want to change the value of TCL_LIBS if -- cgit v0.12 From d1c48d32205766e74234558200f846f04f04c2ae Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 24 May 2015 11:52:21 +0000 Subject: Fixed bug [53f8fc9c2f] - geometry management of panedwindow panes is incorrect with -stretch --- generic/tkPanedWindow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index cf3611f..3ae473a 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -2546,7 +2546,7 @@ MoveSash( slavePtr->paneWidth = slavePtr->width = slavePtr->sashx - sashOffset - slavePtr->x - (2 * slavePtr->padx); } else { - slavePtr->paneWidth = slavePtr->height = slavePtr->sashy + slavePtr->paneHeight = slavePtr->height = slavePtr->sashy - sashOffset - slavePtr->y - (2 * slavePtr->pady); } } -- cgit v0.12 From 30e249e0591e48bc1c72c7668ed59dcc7b8df2f8 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 24 May 2015 13:10:45 +0000 Subject: Limit sash proxy maximum coordinates to the size of the panedwindow it belongs to --- generic/tkPanedWindow.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 3ae473a..e07fc51 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -2764,6 +2764,7 @@ PanedWindowProxyCommand( PROXY_COORD, PROXY_FORGET, PROXY_PLACE }; int index, x, y, sashWidth, sashHeight; + int internalBW, pwWidth, pwHeight; Tcl_Obj *coords[2]; if (objc < 3) { @@ -2813,11 +2814,16 @@ PanedWindowProxyCommand( return TCL_ERROR; } + internalBW = Tk_InternalBorderWidth(pwPtr->tkwin); if (pwPtr->orient == ORIENT_HORIZONTAL) { if (x < 0) { x = 0; } - y = Tk_InternalBorderWidth(pwPtr->tkwin); + pwWidth = Tk_Width(pwPtr->tkwin) - (2 * internalBW); + if (x > pwWidth) { + x = pwWidth; + } + y = Tk_InternalBorderWidth(pwPtr->tkwin); sashWidth = pwPtr->sashWidth; sashHeight = Tk_Height(pwPtr->tkwin) - (2 * Tk_InternalBorderWidth(pwPtr->tkwin)); @@ -2825,6 +2831,10 @@ PanedWindowProxyCommand( if (y < 0) { y = 0; } + pwHeight = Tk_Height(pwPtr->tkwin) - (2 * internalBW); + if (y > pwHeight) { + y = pwHeight; + } x = Tk_InternalBorderWidth(pwPtr->tkwin); sashHeight = pwPtr->sashWidth; sashWidth = Tk_Width(pwPtr->tkwin) - -- cgit v0.12 From c61c12b4b2317fbb1cd2fbc294078d661c2a333c Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 24 May 2015 23:11:56 +0000 Subject: More correct error handling when calling paneconfigure with a non existing window --- generic/tkPanedWindow.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 3ae473a..c79be25 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -678,6 +678,15 @@ PanedWindowWidgetObjCmd( if (objc <= 4) { tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), pwPtr->tkwin); + if (tkwin == NULL) { + /* + * Just a plain old bad window; Tk_NameToWindow filled in an + * error message for us. + */ + + result = TCL_ERROR; + break; + } for (i = 0; i < pwPtr->numSlaves; i++) { if (pwPtr->slaves[i]->tkwin == tkwin) { resultObj = Tk_GetOptionInfo(interp, -- cgit v0.12 From 32058aca4beb9db6cdde22c184e509193a756267 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 25 May 2015 22:17:20 +0000 Subject: Fix [2a02881e4c23634022d0ae40a14383d9baad9eb9|2a02881e4c]: Colors added/changed in 8.6 not documented in man page --- doc/colors.n | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/colors.n b/doc/colors.n index ee44f7b..9081b27 100644 --- a/doc/colors.n +++ b/doc/colors.n @@ -29,6 +29,7 @@ AntiqueWhite1 255 239 219 AntiqueWhite2 238 223 204 AntiqueWhite3 205 192 176 AntiqueWhite4 139 131 120 +agua 0 255 255 aquamarine 127 255 212 aquamarine1 127 255 212 aquamarine2 118 238 198 @@ -93,6 +94,7 @@ cornsilk1 255 248 220 cornsilk2 238 232 205 cornsilk3 205 200 177 cornsilk4 139 136 120 +crymson 220 20 60 cyan 0 255 255 cyan1 0 255 255 cyan2 0 238 238 @@ -191,6 +193,7 @@ floral white 255 250 240 FloralWhite 255 250 240 forest green 34 139 34 ForestGreen 34 139 34 +fuchsia 255 0 255 gainsboro 220 220 220 ghost white 248 248 255 GhostWhite 248 248 255 @@ -204,7 +207,7 @@ goldenrod1 255 193 37 goldenrod2 238 180 34 goldenrod3 205 155 29 goldenrod4 139 105 20 -gray 190 190 190 +gray 128 128 128 gray0 0 0 0 gray1 3 3 3 gray2 5 5 5 @@ -306,14 +309,14 @@ gray97 247 247 247 gray98 250 250 250 gray99 252 252 252 gray100 255 255 255 -green 0 255 0 +green 0 128 0 green yellow 173 255 47 green1 0 255 0 green2 0 238 0 green3 0 205 0 green4 0 139 0 GreenYellow 173 255 47 -grey 190 190 190 +grey 128 128 128 grey0 0 0 0 grey1 3 3 3 grey2 5 5 5 @@ -432,6 +435,7 @@ IndianRed1 255 106 106 IndianRed2 238 99 99 IndianRed3 205 85 85 IndianRed4 139 58 58 +indigo 75 0 130 ivory 255 255 240 ivory1 255 255 240 ivory2 238 238 224 @@ -523,6 +527,7 @@ LightYellow1 255 255 224 LightYellow2 238 238 209 LightYellow3 205 205 180 LightYellow4 139 139 122 +lime 0 255 0 lime green 50 205 50 LimeGreen 50 205 50 linen 250 240 230 @@ -531,7 +536,7 @@ magenta1 255 0 255 magenta2 238 0 238 magenta3 205 0 205 magenta4 139 0 139 -maroon 176 48 96 +maroon 128 0 0 maroon1 255 52 179 maroon2 238 48 167 maroon3 205 41 144 @@ -584,6 +589,7 @@ navy blue 0 0 128 NavyBlue 0 0 128 old lace 253 245 230 OldLace 253 245 230 +olive 128 128 0 olive drab 107 142 35 OliveDrab 107 142 35 OliveDrab1 192 255 62 @@ -647,7 +653,7 @@ plum3 205 150 205 plum4 139 102 139 powder blue 176 224 230 PowderBlue 176 224 230 -purple 160 32 240 +purple 128 0 128 purple1 155 48 255 purple2 145 44 238 purple3 125 38 205 @@ -694,6 +700,7 @@ sienna1 255 130 71 sienna2 238 121 66 sienna3 205 104 57 sienna4 139 71 38 +silver 192 192 192 sky blue 135 206 235 SkyBlue 135 206 235 SkyBlue1 135 206 255 @@ -736,6 +743,7 @@ tan1 255 165 79 tan2 238 154 73 tan3 205 133 63 tan4 139 90 43 +teal 0 128 128 thistle 216 191 216 thistle1 255 225 255 thistle2 238 210 238 -- cgit v0.12 From a05d1fea7d8d233f5b557a5645d5a996cc33a0b2 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 26 May 2015 12:35:23 +0000 Subject: Fix [1641721]: tk_getOpenFile shows symlinks to directories twice. --- library/tkfbox.tcl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index e145805..fd0f6d7 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -1896,6 +1896,10 @@ proc ::tk::dialog::file::GlobFiltered {dir type {overrideFilter 0}} { if {$f eq "." || $f eq ".."} { continue } + # See ticket [1641721], $f might be a link pointing to a dir + if {$type != "d" && [file isdir [file join $dir $f]]} { + continue + } lappend result $f } } -- cgit v0.12 From 3613295edb80ce3590a961b0806e87e5ed128998 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 26 May 2015 21:13:01 +0000 Subject: Don't draw the sash associated to the last visible pane --- generic/tkPanedWindow.c | 52 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 3ae473a..85ab8b0 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -203,6 +203,8 @@ static void PanedWindowReqProc(ClientData clientData, static void ArrangePanes(ClientData clientData); static void Unlink(Slave *slavePtr); static Slave * GetPane(PanedWindow *pwPtr, Tk_Window tkwin); +static void GetFirstLastVisiblePane(PanedWindow *pwPtr, + int *firstPtr, int *lastPtr); static void SlaveStructureProc(ClientData clientData, XEvent *eventPtr); static int PanedWindowSashCommand(PanedWindow *pwPtr, @@ -1406,6 +1408,7 @@ DisplayPanedWindow( Tk_Window tkwin = pwPtr->tkwin; int i, sashWidth, sashHeight; const int horizontal = (pwPtr->orient == ORIENT_HORIZONTAL); + int first, last; pwPtr->flags &= ~REDRAW_PENDING; if ((pwPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { @@ -1452,9 +1455,10 @@ DisplayPanedWindow( * Draw the sashes. */ + GetFirstLastVisiblePane(pwPtr, &first, &last); for (i = 0; i < pwPtr->numSlaves - 1; i++) { slavePtr = pwPtr->slaves[i]; - if (slavePtr->hide) { + if (slavePtr->hide || i == last) { continue; } if (sashWidth > 0 && sashHeight > 0) { @@ -1699,17 +1703,10 @@ ArrangePanes( Tcl_Preserve((ClientData) pwPtr); /* - * Find index of last visible pane. + * Find index of first and last visible panes. */ - for (i = 0, last = 0, first = -1; i < pwPtr->numSlaves; i++) { - if (pwPtr->slaves[i]->hide == 0) { - if (first < 0) { - first = i; - } - last = i; - } - } + GetFirstLastVisiblePane(pwPtr, &first, &last); /* * First pass; compute sizes @@ -2047,6 +2044,41 @@ GetPane( } /* + *---------------------------------------------------------------------- + * + * GetFirstLastVisiblePane -- + * + * Given panedwindow, find the index of the first and last visible panes + * of that paned window. + * + * Results: + * Index of the first and last visible panes. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static void +GetFirstLastVisiblePane( + PanedWindow *pwPtr, /* Pointer to the paned window info. */ + int *firstPtr, /* Returned index for first. */ + int *lastPtr) /* Returned index for last. */ +{ + int i; + + for (i = 0, *lastPtr = 0, *firstPtr = -1; i < pwPtr->numSlaves; i++) { + if (pwPtr->slaves[i]->hide == 0) { + if (*firstPtr < 0) { + *firstPtr = i; + } + *lastPtr = i; + } + } +} + +/* *-------------------------------------------------------------- * * SlaveStructureProc -- -- cgit v0.12 From 7b4136b73645cfb56dd152f437cb75b3e8ef5bd1 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 28 May 2015 19:10:00 +0000 Subject: Documented explicitely that geometry requests from mapped slaves (panes) are ignored by the panedwindow widget --- doc/panedwindow.n | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/panedwindow.n b/doc/panedwindow.n index a686ce1..53a7238 100644 --- a/doc/panedwindow.n +++ b/doc/panedwindow.n @@ -283,6 +283,15 @@ adjusted. When a pane is resized from outside (e.g. it is packed to expand and fill, and the containing toplevel is resized), space is added to the final (rightmost or bottommost) pane in the window. +.PP +Unlike slave windows managed by e.g. pack or grid, the panes managed by a +panedwindow do not change width or height to accomodate changes in the +requested widths or heights of the panes, once these have become mapped. +Therefore it may be advisable, particularly when creating layouts +interactively, to not add a pane to the panedwindow widget until after the +geometry requests of that pane has been finalized (i.e., all components of +the pane inserted, all options affecting geometry set to their proper +values, etc.). .SH "SEE ALSO" ttk::panedwindow(n) .SH KEYWORDS -- cgit v0.12 From 4f4e282b4f51861b64a0a16d75542c74faa7b846 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 30 May 2015 09:30:07 +0000 Subject: Propagated UnmapNotify events of a panedwindow to its children --- generic/tkPanedWindow.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 3ae473a..d61fae3 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -1324,6 +1324,7 @@ PanedWindowEventProc( XEvent *eventPtr) /* Information about event. */ { PanedWindow *pwPtr = (PanedWindow *) clientData; + int i; if (eventPtr->type == Expose) { if (pwPtr->tkwin != NULL && !(pwPtr->flags & REDRAW_PENDING)) { @@ -1338,6 +1339,10 @@ PanedWindowEventProc( } } else if (eventPtr->type == DestroyNotify) { DestroyPanedWindow(pwPtr); + } else if (eventPtr->type == UnmapNotify) { + for (i = 0; i < pwPtr->numSlaves; i++) { + Tk_UnmapWindow(pwPtr->slaves[i]->tkwin); + } } } -- cgit v0.12 From ff3a1605b62a81c8e926998dfcbd85451831b8d7 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 30 May 2015 13:33:21 +0000 Subject: Added test for bug [1292219fff] regarding UnmapNotify event --- tests/panedwindow.test | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/panedwindow.test b/tests/panedwindow.test index c7d84b8..582aad4 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -2460,6 +2460,17 @@ test panedwindow-26.1 {DestroyPanedWindow} { } set result {} } {} +test panedwindow-26.2 {DestroyPanedWindow, UnmapNotify event is propagated to slaves} { + panedwindow .pw + .pw add [button .pw.b] + pack .pw + update + set result [winfo ismapped .pw.b] + pack forget .pw + update + lappend result [winfo ismapped .pw.b] + lappend result [winfo ismapped .pw] +} {1 0 0} test panedwindow-27.1 {PanedWindowIdentifyCoords} { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -- cgit v0.12 From 786753b1391714947b613763539305c03affa7d6 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 30 May 2015 13:48:13 +0000 Subject: Propagated MapNotify events of a panedwindow to its children --- generic/tkPanedWindow.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index d61fae3..b2fd92b 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -1343,6 +1343,10 @@ PanedWindowEventProc( for (i = 0; i < pwPtr->numSlaves; i++) { Tk_UnmapWindow(pwPtr->slaves[i]->tkwin); } + } else if (eventPtr->type == MapNotify) { + for (i = 0; i < pwPtr->numSlaves; i++) { + Tk_MapWindow(pwPtr->slaves[i]->tkwin); + } } } -- cgit v0.12 From 06cad2c9acc51cefa77a0935d52fde5b3d79691e Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 30 May 2015 14:02:36 +0000 Subject: Completed test for bug [1292219fff], regarding MapNotify event this time --- tests/panedwindow.test | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/panedwindow.test b/tests/panedwindow.test index 582aad4..724b40d 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -2460,7 +2460,7 @@ test panedwindow-26.1 {DestroyPanedWindow} { } set result {} } {} -test panedwindow-26.2 {DestroyPanedWindow, UnmapNotify event is propagated to slaves} { +test panedwindow-26.2 {UnmapNotify and MapNotify events are propagated to slaves} { panedwindow .pw .pw add [button .pw.b] pack .pw @@ -2470,7 +2470,13 @@ test panedwindow-26.2 {DestroyPanedWindow, UnmapNotify event is propagated to sl update lappend result [winfo ismapped .pw.b] lappend result [winfo ismapped .pw] -} {1 0 0} + pack .pw + update + lappend result [winfo ismapped .pw] + lappend result [winfo ismapped .pw.b] + destroy .pw .pw.b + set result +} {1 0 0 1 1} test panedwindow-27.1 {PanedWindowIdentifyCoords} { panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -- cgit v0.12 From 2cfb129d2ac0d12e1b633e822bb904953b2635fb Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 30 May 2015 18:06:27 +0000 Subject: Fixed typo in comment --- unix/tkUnixWm.c | 2 +- win/tkWinWm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index d230b9f..904065b 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -3647,7 +3647,7 @@ WmWaitMapProc( * This function is invoked by a widget when it wishes to set a grid * coordinate system that controls the size of a top-level window. It * provides a C interface equivalent to the "wm grid" command and is - * usually asscoiated with the -setgrid option. + * usually associated with the -setgrid option. * * Results: * None. diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 9ea4957..2c3b0e4 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -5697,7 +5697,7 @@ WmWaitVisibilityOrMapProc( * This function is invoked by a widget when it wishes to set a grid * coordinate system that controls the size of a top-level window. It * provides a C interface equivalent to the "wm grid" command and is - * usually asscoiated with the -setgrid option. + * usually associated with the -setgrid option. * * Results: * None. -- cgit v0.12 From 9cb6db3c5911d701d13fbe2bed6f21d7cabae4b0 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 1 Jun 2015 19:10:13 +0000 Subject: Test panedwindow-25.2 uses tcltest 2 format --- tests/panedwindow.test | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/panedwindow.test b/tests/panedwindow.test index 7c7e138..4bc59a8 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -5087,7 +5087,9 @@ test panedwindow-25.1 {DestroyPanedWindow} -setup { } set result {} } -result {} -test panedwindow-26.2 {UnmapNotify and MapNotify events are propagated to slaves} { +test panedwindow-25.2 {UnmapNotify and MapNotify events are propagated to slaves} -setup { + deleteWindows +} -body { panedwindow .pw .pw add [button .pw.b] pack .pw @@ -5103,7 +5105,9 @@ test panedwindow-26.2 {UnmapNotify and MapNotify events are propagated to slaves lappend result [winfo ismapped .pw.b] destroy .pw .pw.b set result -} {1 0 0 1 1} +} -cleanup { + deleteWindows +} -result {1 0 0 1 1} test panedwindow-26.1 {PanedWindowIdentifyCoords} -setup { -- cgit v0.12 From c4c4c32187400aba8b703658be7142609df84689 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 1 Jun 2015 19:32:34 +0000 Subject: Complementary fix for bug [3592454fff] - Don't identify the sash associated to the last visible pane --- generic/tkPanedWindow.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index d2da227..6a3766b 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -3020,6 +3020,7 @@ PanedWindowIdentifyCoords( Tcl_Obj *list; int i, sashHeight, sashWidth, thisx, thisy; int found, isHandle, lpad, rpad, tpad, bpad; + int first, last; list = Tcl_NewObj(); if (pwPtr->orient == ORIENT_HORIZONTAL) { @@ -3060,10 +3061,11 @@ PanedWindowIdentifyCoords( lpad = rpad = 0; } + GetFirstLastVisiblePane(pwPtr, &first, &last); isHandle = 0; found = -1; for (i = 0; i < pwPtr->numSlaves - 1; i++) { - if (pwPtr->slaves[i]->hide) { + if (pwPtr->slaves[i]->hide || i == last) { continue; } thisx = pwPtr->slaves[i]->sashx; -- cgit v0.12 From d7d27ab9c7fae50fe57122d07270c58170f6d40e Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 1 Jun 2015 19:44:48 +0000 Subject: Complementary fix for bug [3592454fff] - Don't identify the sash associated to the last visible pane --- generic/tkPanedWindow.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 85ab8b0..fd103b4 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -2992,6 +2992,7 @@ PanedWindowIdentifyCoords( Tcl_Obj *list; int i, sashHeight, sashWidth, thisx, thisy; int found, isHandle, lpad, rpad, tpad, bpad; + int first, last; list = Tcl_NewObj(); if (pwPtr->orient == ORIENT_HORIZONTAL) { @@ -3032,10 +3033,11 @@ PanedWindowIdentifyCoords( lpad = rpad = 0; } + GetFirstLastVisiblePane(pwPtr, &first, &last); isHandle = 0; found = -1; for (i = 0; i < pwPtr->numSlaves - 1; i++) { - if (pwPtr->slaves[i]->hide) { + if (pwPtr->slaves[i]->hide || i == last) { continue; } thisx = pwPtr->slaves[i]->sashx; -- cgit v0.12 From a585861ebc284c8467d46e834bbf9f5a177364a6 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 1 Jun 2015 20:19:20 +0000 Subject: Fixed broken trunk caused by "signed/unsigned mismatch" compiler error on Windows, introduced by [4fe3c06b97] and [07622d5618] --- generic/tkImgGIF.c | 4 ++-- generic/tkImgPhoto.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index fbfe621..1c28b54 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -593,7 +593,7 @@ FileReadGIF( */ if (trashBuffer == NULL) { - if (fileWidth > (UINT_MAX/3)/fileHeight) { + if (fileWidth > (int)((UINT_MAX/3)/fileHeight)) { goto error; } nBytes = fileWidth * fileHeight * 3; @@ -688,7 +688,7 @@ FileReadGIF( goto error; } block.pitch = block.pixelSize * imageWidth; - if (imageHeight > UINT_MAX/block.pitch) { + if (imageHeight > (int)(UINT_MAX/block.pitch)) { goto error; } nBytes = block.pitch * imageHeight; diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 7fa894c..3e03f3d 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -891,7 +891,7 @@ ImgPhotoCmd( * May not be able to trigger/ demo / test this. */ - if (dataWidth > (UINT_MAX/3) / dataHeight) { + if (dataWidth > (int)((UINT_MAX/3) / dataHeight)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "photo image dimensions exceed Tcl memory limits", -1)); Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", @@ -2223,7 +2223,7 @@ ImgPhotoSetSize( || (masterPtr->pix32 == NULL)) { unsigned newPixSize; - if (pitch && height > UINT_MAX / pitch) { + if (pitch && height > (int)(UINT_MAX / pitch)) { return TCL_ERROR; } newPixSize = height * pitch; @@ -3721,7 +3721,7 @@ ImgGetPhoto( newPixelSize += 2; } - if (blockPtr->height > (UINT_MAX/newPixelSize)/blockPtr->width) { + if (blockPtr->height > (int)((UINT_MAX/newPixelSize)/blockPtr->width)) { return NULL; } data = attemptckalloc(newPixelSize*blockPtr->width*blockPtr->height); -- cgit v0.12 From db72cf3cd352c43ddcb5abcb300f60aea2df558f Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 5 Jun 2015 04:01:10 +0000 Subject: Add missing bold effect to documentation for [canvas -splinesteps]. --- doc/canvas.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/canvas.n b/doc/canvas.n index bc29cc3..ae139db 100644 --- a/doc/canvas.n +++ b/doc/canvas.n @@ -1573,7 +1573,7 @@ times) so that it also becomes a knot point. \fB\-splinesteps \fInumber\fR Specifies the degree of smoothness desired for curves: each spline will be approximated with \fInumber\fR line segments. This -option is ignored unless the \fB\-smooth\fR option is true or \fBraw\fR. +option is ignored unless the \fB\-smooth\fR option is \fBtrue\fR or \fBraw\fR. .SS "OVAL ITEMS" .PP Items of type \fBoval\fR appear as circular or oval regions on -- cgit v0.12 From 4d1a9f685c22275463128aabb1142f5c97bee2e5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 25 Jun 2015 09:22:18 +0000 Subject: Fix [2a02881e4c] for 8.5 too: Colors added in 8.5 not documented in man page --- doc/colors.n | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/colors.n b/doc/colors.n index 6e73390..46c35aa 100644 --- a/doc/colors.n +++ b/doc/colors.n @@ -27,6 +27,7 @@ AntiqueWhite1 255 239 219 AntiqueWhite2 238 223 204 AntiqueWhite3 205 192 176 AntiqueWhite4 139 131 120 +agua 0 255 255 aquamarine 127 255 212 aquamarine1 127 255 212 aquamarine2 118 238 198 @@ -91,6 +92,7 @@ cornsilk1 255 248 220 cornsilk2 238 232 205 cornsilk3 205 200 177 cornsilk4 139 136 120 +crymson 220 20 60 cyan 0 255 255 cyan1 0 255 255 cyan2 0 238 238 @@ -189,6 +191,7 @@ floral white 255 250 240 FloralWhite 255 250 240 forest green 34 139 34 ForestGreen 34 139 34 +fuchsia 255 0 255 gainsboro 220 220 220 ghost white 248 248 255 GhostWhite 248 248 255 @@ -430,6 +433,7 @@ IndianRed1 255 106 106 IndianRed2 238 99 99 IndianRed3 205 85 85 IndianRed4 139 58 58 +indigo 75 0 130 ivory 255 255 240 ivory1 255 255 240 ivory2 238 238 224 @@ -521,6 +525,7 @@ LightYellow1 255 255 224 LightYellow2 238 238 209 LightYellow3 205 205 180 LightYellow4 139 139 122 +lime 0 255 0 lime green 50 205 50 LimeGreen 50 205 50 linen 250 240 230 @@ -582,6 +587,7 @@ navy blue 0 0 128 NavyBlue 0 0 128 old lace 253 245 230 OldLace 253 245 230 +olive 128 128 0 olive drab 107 142 35 OliveDrab 107 142 35 OliveDrab1 192 255 62 @@ -692,6 +698,7 @@ sienna1 255 130 71 sienna2 238 121 66 sienna3 205 104 57 sienna4 139 71 38 +silver 192 192 192 sky blue 135 206 235 SkyBlue 135 206 235 SkyBlue1 135 206 255 @@ -734,6 +741,7 @@ tan1 255 165 79 tan2 238 154 73 tan3 205 133 63 tan4 139 90 43 +teal 0 128 128 thistle 216 191 216 thistle1 255 225 255 thistle2 238 210 238 @@ -944,3 +952,6 @@ GrayText WindowText options(n), Tk_GetColor(3) .SH KEYWORDS color, option +'\" Local Variables: +'\" mode: nroff +'\" End: -- cgit v0.12 From 69cded06b737884b3c2f111d3a3a40db146bcef1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 25 Jun 2015 09:29:27 +0000 Subject: Fix bug in "make dist" when system-encoding is UTF-8: eolFix will then translate some windows-specific files to UTF-8 too. Solution: commit those files with CRLF line-ending, which eliminates the need for eolFix altgether. See als: [495120] for the reason why eolFix was introduced in the first place. No longer needed with fossil. --- .fossil-settings/crnl-glob | 6 + .fossil-settings/encoding-glob | 6 + ChangeLog | 2 +- macosx/Wish.xcode/project.pbxproj | 2 - macosx/Wish.xcodeproj/project.pbxproj | 2 - unix/Makefile.in | 5 - win/buildall.vc.bat | 214 ++-- win/makefile.bc | 1070 ++++++++--------- win/makefile.vc | 2056 ++++++++++++++++----------------- win/mkd.bat | 24 +- win/rc/tk_base.rc | 12 +- win/rc/wish.rc | 2 +- win/rmd.bat | 40 +- win/rules.vc | 1432 +++++++++++------------ win/tkConfig.sh.in | 2 +- 15 files changed, 2439 insertions(+), 2436 deletions(-) create mode 100644 .fossil-settings/encoding-glob diff --git a/.fossil-settings/crnl-glob b/.fossil-settings/crnl-glob index e69de29..7175730 100644 --- a/.fossil-settings/crnl-glob +++ b/.fossil-settings/crnl-glob @@ -0,0 +1,6 @@ +win/buildall.vc.bat +win/makefile.bc +win/makefile.vc +win/mkd.bat +win/rmd.bat +win/rules.vc diff --git a/.fossil-settings/encoding-glob b/.fossil-settings/encoding-glob new file mode 100644 index 0000000..7175730 --- /dev/null +++ b/.fossil-settings/encoding-glob @@ -0,0 +1,6 @@ +win/buildall.vc.bat +win/makefile.bc +win/makefile.vc +win/mkd.bat +win/rmd.bat +win/rules.vc diff --git a/ChangeLog b/ChangeLog index 2f67e74..90ec655 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,7 +31,7 @@ a better first place to look now. * library/ttk/progress.tcl: Bug [c597acdab3]: Call [$pb step] in tail position in ttk::progressbar::Autoincrement, so that the widget is in a consistent state when any write traces on - the linked -variable are fired. + the linked -variable are fired. 2013-07-02 Jan Nijtmans diff --git a/macosx/Wish.xcode/project.pbxproj b/macosx/Wish.xcode/project.pbxproj index ef0fc31..02a197e 100644 --- a/macosx/Wish.xcode/project.pbxproj +++ b/macosx/Wish.xcode/project.pbxproj @@ -1920,7 +1920,6 @@ F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = checkLibraryDoc.tcl; sourceTree = ""; }; F96D43D208F272B8004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; F96D43D308F272B8004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; - F96D442208F272B8004A47F5 /* eolFix.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = eolFix.tcl; sourceTree = ""; }; F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fix_tommath_h.tcl; sourceTree = ""; }; F96D442508F272B8004A47F5 /* genStubs.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = genStubs.tcl; sourceTree = ""; }; F96D442708F272B8004A47F5 /* index.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = index.tcl; sourceTree = ""; }; @@ -3715,7 +3714,6 @@ F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */, F96D43D208F272B8004A47F5 /* configure */, F96D43D308F272B8004A47F5 /* configure.in */, - F96D442208F272B8004A47F5 /* eolFix.tcl */, F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */, F96D442508F272B8004A47F5 /* genStubs.tcl */, F96D442708F272B8004A47F5 /* index.tcl */, diff --git a/macosx/Wish.xcodeproj/project.pbxproj b/macosx/Wish.xcodeproj/project.pbxproj index 5c7f667..0fd1bea 100644 --- a/macosx/Wish.xcodeproj/project.pbxproj +++ b/macosx/Wish.xcodeproj/project.pbxproj @@ -1920,7 +1920,6 @@ F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = checkLibraryDoc.tcl; sourceTree = ""; }; F96D43D208F272B8004A47F5 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; F96D43D308F272B8004A47F5 /* configure.in */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = configure.in; sourceTree = ""; }; - F96D442208F272B8004A47F5 /* eolFix.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = eolFix.tcl; sourceTree = ""; }; F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = fix_tommath_h.tcl; sourceTree = ""; }; F96D442508F272B8004A47F5 /* genStubs.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = genStubs.tcl; sourceTree = ""; }; F96D442708F272B8004A47F5 /* index.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = index.tcl; sourceTree = ""; }; @@ -3715,7 +3714,6 @@ F96D43D108F272B8004A47F5 /* checkLibraryDoc.tcl */, F96D43D208F272B8004A47F5 /* configure */, F96D43D308F272B8004A47F5 /* configure.in */, - F96D442208F272B8004A47F5 /* eolFix.tcl */, F96D442408F272B8004A47F5 /* fix_tommath_h.tcl */, F96D442508F272B8004A47F5 /* genStubs.tcl */, F96D442708F272B8004A47F5 /* index.tcl */, diff --git a/unix/Makefile.in b/unix/Makefile.in index d869528..83e6667 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1541,18 +1541,13 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(M $(TOP_DIR)/win/aclocal.m4 $(TOP_DIR)/win/tcl.m4 \ $(DISTDIR)/win cp -p $(TOP_DIR)/win/*.[ch] $(TOP_DIR)/win/*.bat $(DISTDIR)/win - $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/*.bat cp -p $(TOP_DIR)/win/makefile.* $(DISTDIR)/win - $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/makefile.* cp -p $(TOP_DIR)/win/rules.vc $(DISTDIR)/win - $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/rules.vc cp -p $(TOP_DIR)/win/README $(DISTDIR)/win cp -p $(TOP_DIR)/license.terms $(DISTDIR)/win mkdir $(DISTDIR)/win/rc cp -p $(TOP_DIR)/win/wish.exe.manifest.in $(DISTDIR)/win/ cp -p $(TOP_DIR)/win/rc/*.{rc,cur,ico,bmp} $(DISTDIR)/win/rc - $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/rc/*.rc - $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/wish.exe.manifest.in mkdir $(DISTDIR)/macosx cp -p $(MAC_OSX_DIR)/GNUmakefile $(MAC_OSX_DIR)/README \ $(MAC_OSX_DIR)/*.icns $(MAC_OSX_DIR)/*.tiff \ diff --git a/win/buildall.vc.bat b/win/buildall.vc.bat index 0bd2888..9cdf0d9 100755 --- a/win/buildall.vc.bat +++ b/win/buildall.vc.bat @@ -1,107 +1,107 @@ -@echo off - -:: This is an example batchfile for building everything. Please -:: edit this (or make your own) for your needs and wants using -:: the instructions for calling makefile.vc found in makefile.vc - -set SYMBOLS= - -:OPTIONS -if "%1" == "/?" goto help -if /i "%1" == "/help" goto help -if %1.==symbols. goto SYMBOLS -if %1.==debug. goto SYMBOLS -goto OPTIONS_DONE - -:SYMBOLS - set SYMBOLS=symbols - shift - goto OPTIONS - -:OPTIONS_DONE - -:: reset errorlevel -cd > nul - -:: You might have installed your developer studio to add itself to the -:: path or have already run vcvars32.bat. Testing these envars proves -:: cl.exe and friends are in your path. -:: -if defined VCINSTALLDIR (goto :startBuilding) -if defined MSDEVDIR (goto :startBuilding) -if defined MSVCDIR (goto :startBuilding) -if defined MSSDK (goto :startBuilding) -if defined WINDOWSSDKDIR (goto :startBuilding) - -:: We need to run the development environment batch script that comes -:: with developer studio (v4,5,6,7,etc...) All have it. This path -:: might not be correct. You should call it yourself prior to running -:: this batchfile. -:: -call "C:\Program Files\Microsoft Developer Studio\vc98\bin\vcvars32.bat" -if errorlevel 1 (goto no_vcvars) - -:startBuilding - -echo. -echo Sit back and have a cup of coffee while this grinds through ;) -echo You asked for *everything*, remember? -echo. -title Building Tk, please wait... - - -:: makefile.vc uses this for its default anyways, but show its use here -:: just to be explicit and convey understanding to the user. Setting -:: the INSTALLDIR envar prior to running this batchfile affects all builds. -:: -if "%INSTALLDIR%" == "" set INSTALLDIR=C:\Program Files\Tcl - - -:: Where is the Tcl source directory? -:: You can set the TCLDIR environment variable to your Tcl HEAD checkout -if "%TCLDIR%" == "" set TCLDIR=..\..\tcl - -:: Build the normal stuff along with the help file. -:: -set OPTS=threads -if not %SYMBOLS%.==. set OPTS=symbols,threads -nmake -nologo -f makefile.vc release OPTS=%OPTS% %1 -if errorlevel 1 goto error - -:: Build the static core and shell. -:: -set OPTS=static,msvcrt,threads -if not %SYMBOLS%.==. set OPTS=symbols,static,msvcrt,threads -nmake -nologo -f makefile.vc shell OPTS=%OPTS% %1 -if errorlevel 1 goto error - -set OPTS= -set SYMBOLS= -goto end - -:error -echo *** BOOM! *** -goto end - -:no_vcvars -echo vcvars32.bat was not run prior to this batchfile, nor are the MS tools in your path. -goto out - -:help -title buildall.vc.bat help message -echo usage: -echo %0 : builds Tk for all build types (do this first) -echo %0 install : installs all the release builds (do this second) -echo %0 symbols : builds Tk for all debugging build types -echo %0 symbols install : install all the debug builds -echo. -goto out - -:end -title Building Tk, please wait... DONE! -echo DONE! -goto out - -:out -pause -title Command Prompt +@echo off + +:: This is an example batchfile for building everything. Please +:: edit this (or make your own) for your needs and wants using +:: the instructions for calling makefile.vc found in makefile.vc + +set SYMBOLS= + +:OPTIONS +if "%1" == "/?" goto help +if /i "%1" == "/help" goto help +if %1.==symbols. goto SYMBOLS +if %1.==debug. goto SYMBOLS +goto OPTIONS_DONE + +:SYMBOLS + set SYMBOLS=symbols + shift + goto OPTIONS + +:OPTIONS_DONE + +:: reset errorlevel +cd > nul + +:: You might have installed your developer studio to add itself to the +:: path or have already run vcvars32.bat. Testing these envars proves +:: cl.exe and friends are in your path. +:: +if defined VCINSTALLDIR (goto :startBuilding) +if defined MSDEVDIR (goto :startBuilding) +if defined MSVCDIR (goto :startBuilding) +if defined MSSDK (goto :startBuilding) +if defined WINDOWSSDKDIR (goto :startBuilding) + +:: We need to run the development environment batch script that comes +:: with developer studio (v4,5,6,7,etc...) All have it. This path +:: might not be correct. You should call it yourself prior to running +:: this batchfile. +:: +call "C:\Program Files\Microsoft Developer Studio\vc98\bin\vcvars32.bat" +if errorlevel 1 (goto no_vcvars) + +:startBuilding + +echo. +echo Sit back and have a cup of coffee while this grinds through ;) +echo You asked for *everything*, remember? +echo. +title Building Tk, please wait... + + +:: makefile.vc uses this for its default anyways, but show its use here +:: just to be explicit and convey understanding to the user. Setting +:: the INSTALLDIR envar prior to running this batchfile affects all builds. +:: +if "%INSTALLDIR%" == "" set INSTALLDIR=C:\Program Files\Tcl + + +:: Where is the Tcl source directory? +:: You can set the TCLDIR environment variable to your Tcl HEAD checkout +if "%TCLDIR%" == "" set TCLDIR=..\..\tcl + +:: Build the normal stuff along with the help file. +:: +set OPTS=threads +if not %SYMBOLS%.==. set OPTS=symbols,threads +nmake -nologo -f makefile.vc release OPTS=%OPTS% %1 +if errorlevel 1 goto error + +:: Build the static core and shell. +:: +set OPTS=static,msvcrt,threads +if not %SYMBOLS%.==. set OPTS=symbols,static,msvcrt,threads +nmake -nologo -f makefile.vc shell OPTS=%OPTS% %1 +if errorlevel 1 goto error + +set OPTS= +set SYMBOLS= +goto end + +:error +echo *** BOOM! *** +goto end + +:no_vcvars +echo vcvars32.bat was not run prior to this batchfile, nor are the MS tools in your path. +goto out + +:help +title buildall.vc.bat help message +echo usage: +echo %0 : builds Tk for all build types (do this first) +echo %0 install : installs all the release builds (do this second) +echo %0 symbols : builds Tk for all debugging build types +echo %0 symbols install : install all the debug builds +echo. +goto out + +:end +title Building Tk, please wait... DONE! +echo DONE! +goto out + +:out +pause +title Command Prompt diff --git a/win/makefile.bc b/win/makefile.bc index 295ed23..5a22c95 100644 --- a/win/makefile.bc +++ b/win/makefile.bc @@ -1,535 +1,535 @@ -# -# Makefile for Borland C++ 5.5 (or C++ Builder 5), adapted from the makefile -# for Visual C++ that came with tk 8.3.3 -# -# Some "not so obvious" details in this makefile are preceded by a comment -# "maintenance hint", which tries to explain what's going on. Better to -# leave those in place. -# Helmut Giese, July 2002 -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# Copyright (c) 1995-1997 Sun Microsystems, Inc. -# Copyright (c) 1998-2000 Ajuba Solutions. - -# Does not depend on the presence of any environment variables in -# order to compile tcl; all needed information is derived from -# location of the compiler directories. - -# -# Project directories -# -# ROOT = top of source tree -# -# TMPDIR = location where .obj files should be stored during build -# -# TOOLS32 = location of Borland development tools. -# -# TCLDIR = location of top of Tcl source hierarchy -# - -ROOT = .. -TCLDIR = ..\..\tcl8.4 -INSTALLDIR = D:\tmp\tcl - -# If you have C++ Builder 5 or the free Borland C++ 5.5 compiler -# adapt the following paths as appropriate for your system -TOOLS32 = d:\cbld5 -TOOLS32_rc = d:\cbld5 -#TOOLS32 = c:\bc55 -#TOOLS32_rc = c:\bc55 - -cc32 = "$(TOOLS32)\bin\bcc32.exe" -link32 = "$(TOOLS32)\bin\ilink32.exe" -lib32 = "$(TOOLS32)\bin\tlib.exe" -rc32 = "$(TOOLS32_rc)\bin\brcc32.exe" -include32 = -I"$(TOOLS32)\include;$(TOOLS32)\include\mfc" -libpath32 = -L"$(TOOLS32)\lib" - -# Uncomment the following line to compile with thread support -#THREADDEFINES = -DTCL_THREADS=1 - -# Allow definition of NDEBUG via command line -# Set NODEBUG to 0 to compile with symbols -!if !defined(NODEBUG) -NODEBUG = 1 -!endif - -# uncomment the following two lines to compile with TCL_MEM_DEBUG -#DEBUGDEFINES =-DTCL_MEM_DEBUG - -###################################################################### -# Do not modify below this line -###################################################################### - -TCLNAMEPREFIX = tcl -TKNAMEPREFIX = tk -WISHNAMEPREFIX = wish -VERSION = 84 -DOTVERSION = 8.4 - -TCLSTUBPREFIX = $(TCLNAMEPREFIX)stub -TKSTUBPREFIX = $(TKNAMEPREFIX)stub - - -BINROOT = . -!IF "$(NODEBUG)" == "1" -TMPDIRNAME = Release -DBGX = -!ELSE -TMPDIRNAME = Debug -DBGX = -#DBGX = d -!ENDIF -TMPDIR = $(BINROOT)\$(TMPDIRNAME) -OUTDIRNAME = $(TMPDIRNAME) -OUTDIR = $(TMPDIR) - -TCLLIB = $(TCLNAMEPREFIX)$(VERSION)$(DBGX).lib -TCLPLUGINLIB = $(TCLNAMEPREFIX)$(VERSION)p.lib -TCLSTUBLIB = $(TCLSTUBPREFIX)$(VERSION)$(DBGX).lib -TKDLLNAME = $(TKNAMEPREFIX)$(VERSION)$(DBGX).dll -TKDLL = $(OUTDIR)\$(TKDLLNAME) -TKLIB = $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)$(DBGX).lib -TKSTUBLIBNAME = $(TKSTUBPREFIX)$(VERSION)$(DBGX).lib -TKSTUBLIB = $(OUTDIR)\$(TKSTUBLIBNAME) -TKPLUGINDLLNAME = $(TKNAMEPREFIX)$(VERSION)p$(DBG).dll -TKPLUGINDLL = $(OUTDIR)\$(TKPLUGINDLLNAME) -TKPLUGINLIB = $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)p$(DBGX).lib - -WISH = $(OUTDIR)\$(WISHNAMEPREFIX)$(VERSION)$(DBGX).exe -WISHC = $(OUTDIR)\$(WISHNAMEPREFIX)c$(VERSION)$(DBGX).exe -WISHP = $(OUTDIR)\$(WISHNAMEPREFIX)p$(VERSION)$(DBGX).exe -TKTEST = $(OUTDIR)\$(TKNAMEPREFIX)test.exe -CAT32 = $(TMPDIR)\cat32.exe - -BIN_INSTALL_DIR = $(INSTALLDIR)\bin -INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include -LIB_INSTALL_DIR = $(INSTALLDIR)\lib -SCRIPT_INSTALL_DIR = $(LIB_INSTALL_DIR)\tk$(DOTVERSION) - -WISHOBJS = \ - $(TMPDIR)\winMain.obj - -TKTESTOBJS = \ - $(TMPDIR)\tkTest.obj \ - $(TMPDIR)\tkSquare.obj \ - $(TMPDIR)\testMain.obj \ - $(TMPDIR)\tkOldTest.obj \ - $(TMPDIR)\tkWinTest.obj \ - $(TCLLIBDIR)\tclThreadTest.obj - -XLIBOBJS = \ - $(TMPDIR)\xcolors.obj \ - $(TMPDIR)\xdraw.obj \ - $(TMPDIR)\xgc.obj \ - $(TMPDIR)\ximage.obj \ - $(TMPDIR)\xutil.obj - -TKOBJS = \ - $(TMPDIR)\tkConsole.obj \ - $(TMPDIR)\tkUnixMenubu.obj \ - $(TMPDIR)\tkUnixScale.obj \ - $(XLIBOBJS) \ - $(TMPDIR)\tkWin3d.obj \ - $(TMPDIR)\tkWin32Dll.obj \ - $(TMPDIR)\tkWinButton.obj \ - $(TMPDIR)\tkWinClipboard.obj \ - $(TMPDIR)\tkWinColor.obj \ - $(TMPDIR)\tkWinConfig.obj \ - $(TMPDIR)\tkWinCursor.obj \ - $(TMPDIR)\tkWinDialog.obj \ - $(TMPDIR)\tkWinDraw.obj \ - $(TMPDIR)\tkWinEmbed.obj \ - $(TMPDIR)\tkWinFont.obj \ - $(TMPDIR)\tkWinImage.obj \ - $(TMPDIR)\tkWinInit.obj \ - $(TMPDIR)\tkWinKey.obj \ - $(TMPDIR)\tkWinMenu.obj \ - $(TMPDIR)\tkWinPixmap.obj \ - $(TMPDIR)\tkWinPointer.obj \ - $(TMPDIR)\tkWinRegion.obj \ - $(TMPDIR)\tkWinScrlbr.obj \ - $(TMPDIR)\tkWinSend.obj \ - $(TMPDIR)\tkWinWindow.obj \ - $(TMPDIR)\tkWinWm.obj \ - $(TMPDIR)\tkWinX.obj \ - $(TMPDIR)\stubs.obj \ - $(TMPDIR)\tk3d.obj \ - $(TMPDIR)\tkArgv.obj \ - $(TMPDIR)\tkAtom.obj \ - $(TMPDIR)\tkBind.obj \ - $(TMPDIR)\tkBitmap.obj \ - $(TMPDIR)\tkButton.obj \ - $(TMPDIR)\tkCanvArc.obj \ - $(TMPDIR)\tkCanvBmap.obj \ - $(TMPDIR)\tkCanvImg.obj \ - $(TMPDIR)\tkCanvLine.obj \ - $(TMPDIR)\tkCanvPoly.obj \ - $(TMPDIR)\tkCanvPs.obj \ - $(TMPDIR)\tkCanvText.obj \ - $(TMPDIR)\tkCanvUtil.obj \ - $(TMPDIR)\tkCanvWind.obj \ - $(TMPDIR)\tkCanvas.obj \ - $(TMPDIR)\tkClipboard.obj \ - $(TMPDIR)\tkCmds.obj \ - $(TMPDIR)\tkColor.obj \ - $(TMPDIR)\tkConfig.obj \ - $(TMPDIR)\tkCursor.obj \ - $(TMPDIR)\tkEntry.obj \ - $(TMPDIR)\tkError.obj \ - $(TMPDIR)\tkEvent.obj \ - $(TMPDIR)\tkFileFilter.obj \ - $(TMPDIR)\tkFocus.obj \ - $(TMPDIR)\tkFont.obj \ - $(TMPDIR)\tkFrame.obj \ - $(TMPDIR)\tkGC.obj \ - $(TMPDIR)\tkGeometry.obj \ - $(TMPDIR)\tkGet.obj \ - $(TMPDIR)\tkGrab.obj \ - $(TMPDIR)\tkGrid.obj \ - $(TMPDIR)\tkImage.obj \ - $(TMPDIR)\tkImgBmap.obj \ - $(TMPDIR)\tkImgGIF.obj \ - $(TMPDIR)\tkImgPPM.obj \ - $(TMPDIR)\tkImgPhoto.obj \ - $(TMPDIR)\tkImgUtil.obj \ - $(TMPDIR)\tkListbox.obj \ - $(TMPDIR)\tkMacWinMenu.obj \ - $(TMPDIR)\tkMain.obj \ - $(TMPDIR)\tkMenu.obj \ - $(TMPDIR)\tkMenubutton.obj \ - $(TMPDIR)\tkMenuDraw.obj \ - $(TMPDIR)\tkMessage.obj \ - $(TMP_DIR)\tkPanedWindow.obj \ - $(TMPDIR)\tkObj.obj \ - $(TMPDIR)\tkOldConfig.obj \ - $(TMPDIR)\tkOption.obj \ - $(TMPDIR)\tkPack.obj \ - $(TMPDIR)\tkPlace.obj \ - $(TMPDIR)\tkPointer.obj \ - $(TMPDIR)\tkRectOval.obj \ - $(TMPDIR)\tkScale.obj \ - $(TMPDIR)\tkScrollbar.obj \ - $(TMPDIR)\tkSelect.obj \ - $(TMPDIR)\tkText.obj \ - $(TMPDIR)\tkTextBTree.obj \ - $(TMPDIR)\tkTextDisp.obj \ - $(TMPDIR)\tkTextImage.obj \ - $(TMPDIR)\tkTextIndex.obj \ - $(TMPDIR)\tkTextMark.obj \ - $(TMPDIR)\tkTextTag.obj \ - $(TMPDIR)\tkTextWind.obj \ - $(TMPDIR)\tkTrig.obj \ - $(TMPDIR)\tkUtil.obj \ - $(TMPDIR)\tkVisual.obj \ - $(TMPDIR)\tkStubInit.obj \ - $(TMPDIR)\tkWindow.obj - -# Maintenance hint: Please have multiple members of TKSTUBOBJS be separated -# by exactly one ' ' (see below the rule for making TKSTUBLIB) -TKSTUBOBJS = $(TMPDIR)\tkStubLib.obj - -WINDIR = $(ROOT)\win -GENERICDIR = $(ROOT)\generic -XLIBDIR = $(ROOT)\xlib -BITMAPDIR = $(ROOT)\bitmaps -TCLLIBDIR = $(TCLDIR)\win\$(OUTDIRNAME) -RCDIR = $(WINDIR)\rc - -TK_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) -I$(BITMAPDIR) -I$(XLIBDIR) \ - -I$(TCLDIR)\generic -I$(TCLDIR)\win - -TK_DEFINES = -D__WIN32__ $(DEBUGDEFINES) $(THREADDEFINES) SUPPORT_CONFIG_EMBEDDED - -###################################################################### -# Compile flags -###################################################################### - -!IF "$(NODEBUG)" == "1" -# these macros cause maximum optimization and no symbols -cdebug = -v- -vi- -O2 -D_DEBUG -!ELSE -# these macros enable debugging -cdebug = -k -Od -r- -v -vi- -y -!ENDIF - -SYSDEFINES = _MT;NO_STRICT;_NO_VCL - -# declarations common to all compiler options -cbase = -3 -a4 -c -g0 -tWM -Ve -Vx -X- -WARNINGS = -w-rch -w-pch -w-par -w-dup -w-pro -w-dpu - -ccons = -tWC - -CFLAGS = $(cdebug) $(cbase) $(WARNINGS) -D$(SYSDEFINES) - -CON_CFLAGS = $(CFLAGS) $(TK_DEFINES) $(include32) $(ccons) -WISH_CFLAGS = $(CFLAGS) $(include32) $(TK_INCLUDES) $(TK_DEFINES) -TK_CFLAGS = $(CFLAGS) $(include32) $(TK_INCLUDES) $(TK_DEFINES) \ - -DUSE_TCL_STUBS - -###################################################################### -# Link flags -###################################################################### - -!IF "$(NODEBUG)" == "1" -ldebug = -!ELSE -ldebug = -v -!ENDIF - -# declarations common to all linker options -LNFLAGS = -D"" -Gn -I$(TMPDIR) -x $(ldebug) $(libpath32) -# -Gi: create lib file (is -Gl in doc) -# -aa: Windows app, -ap: Windows console app -LNFLAGS_DLL = -ap -Gi -Tpd -LNFLAGS_CONS = -ap -Tpe -LNFLAGS_GUI = -aa -Tpe - -LNLIBS = import32 cw32mt - - -###################################################################### -# Project specific targets -###################################################################### - -all: setup $(WISH) $(CAT32) -install: install-binaries install-libraries -plugin: setup $(TKPLUGINDLL) $(WISHP) -tktest: setup $(TKTEST) $(CAT32) - -# Maintenance hint: We want to set environment variables before calling tktest. -# If we do this in the form of normal commands, they will not persist up to -# the call of tktest. Therfore we put all commands wanted into a batch file. -# The normal way of using 'echo >x.bat' and 'echo >>x.bat' does not work here -# because we cannot write '... > tktest.txt' this way. Hence this advanced -# form of loop hopping: -# - Have MAKE produce a temporary file with the content we want. -# - Use it as input to the COPY command to produce a batch file. -# - Run the batch file and be happy. -# -test: setup $(TKTEST) $(TKLIB) $(CAT32) - copy &&! - set TCL_LIBRARY=$(TCLDIR)/library - set PATH=$(TCLDIR)\win\$(TMPDIRNAME);$(PATH) - $(TKTEST) $(ROOT)/tests/all.tcl > tktest.txt -! _test.bat - _test.bat -# del _test.bat - -runtest: setup $(TKTEST) $(TKLIB) $(CAT32) - echo set TCL_LIBRARY=$(TCLDIR)/library > _test2.bat - echo set PATH=$(TCLDIR)\win\$(TMPDIRNAME);$(PATH) >> _test2.bat - echo $(TKTEST) >> _test2.bat - _test2.bat -# del _test2.bat - -console-wish : all $(WISHC) - -stubs: - $(TCLDIR)\win\$(TMPDIRNAME)\tclsh$(VERSION)$(DBGX) \ - $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \ - $(GENERICDIR)\tk.decls $(GENERICDIR)\tkInt.decls - -setup: - @mkd $(TMPDIR) - @mkd $(OUTDIR) - -install-binaries: - @mkd "$(BIN_INSTALL_DIR)" - copy $(TKDLL) "$(BIN_INSTALL_DIR)" - copy $(WISH) "$(BIN_INSTALL_DIR)" - @mkd "$(LIB_INSTALL_DIR)" - copy $(TKLIB) "$(LIB_INSTALL_DIR)" - -install-libraries: - @mkd "$(INCLUDE_INSTALL_DIR)" - @mkd "$(INCLUDE_INSTALL_DIR)\X11" - copy "$(GENERICDIR)\tk.h" "$(INCLUDE_INSTALL_DIR)" - copy "$(GENERICDIR)\tkDecls.h" "$(INCLUDE_INSTALL_DIR)" - copy "$(GENERICDIR)\tkPlatDecls.h" "$(INCLUDE_INSTALL_DIR)" - copy "$(GENERICDIR)\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)" - xcopy "$(XLIBDIR)\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11" - @mkd "$(SCRIPT_INSTALL_DIR)" - @mkd "$(SCRIPT_INSTALL_DIR)\images" - @mkd "$(SCRIPT_INSTALL_DIR)\demos" - @mkd "$(SCRIPT_INSTALL_DIR)\demos\images" - @mkd "$(SCRIPT_INSTALL_DIR)\msgs" - xcopy "$(ROOT)\library" "$(SCRIPT_INSTALL_DIR)" - xcopy "$(ROOT)\library\images" "$(SCRIPT_INSTALL_DIR)\images" - xcopy "$(ROOT)\library\demos" "$(SCRIPT_INSTALL_DIR)\demos" - xcopy "$(ROOT)\library\demos\images" "$(SCRIPT_INSTALL_DIR)\demos\images" - xcopy "$(ROOT)\library\msgs" "$(SCRIPT_INSTALL_DIR)\msgs" - -$(TKLIB): $(TKDLL) $(TKSTUBLIB) - -# Maintenance hint: The macro puts a '+-' before the first member of -# TKSTUBOBJS, than replaces any ' ' with ' +-' - together putting '+-' in -# front of any member of TKSTUBOBJS (provided, they are separated in their -# defintion by just one space). -# -# The first time you *make* this target, you will get a warning -# tkStubLib not found in library -# This is (probably) because of the '-' option, telling TLIB to remove -# 'tkStubLib' when it does not yet exist. Forcing a re-make when it already -# exists avoids this warning. -# -$(TKSTUBLIB): $(TKSTUBOBJS) - $(lib32) $@ +-$(TKSTUBOBJS: = +-) - -# $(lib32) $@ @&&! -#+-$(TKSTUBOBJS: = &^ -#+-) -#! - -$(TKDLL): $(TKOBJS) $(TMPDIR)\tk.res - $(link32) $(ldebug) $(LNFLAGS) $(LNFLAGS_DLL) $(TOOLS32)\lib\c0d32 @&&! - $(TKOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLSTUBLIB),, $(TMPDIR)\tk.res -! - -$(TKPLUGINLIB): $(TKPLUGINDLL) - -#$(TKPLUGINDLL): $(TKOBJS) $(TMPDIR)\tk.res -# $(link32) $(ldebug) $(dlllflags) \ -# -out:$@ $(TMPDIR)\tk.res $(TCLLIBDIR)\$(TCLPLUGINLIB) \ -# $(guilibsdll) @<< -# $(TKOBJS) -#<< - -$(WISH): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res - $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_GUI) $(TOOLS32)\lib\c0x32 @&&! - $(WISHOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res -! - -$(WISHC): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res - $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_CONS) $(TOOLS32)\lib\c0x32 @&&! - $(WISHOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res -! - -$(WISHP): $(WISHOBJS) $(TKPLUGINLIB) $(TMPDIR)\wish.res - $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \ - $(guilibsdll) $(TCLLIBDIR)\$(TCLPLUGINLIB) \ - $(TKPLUGINLIB) $(WISHOBJS) - -$(TKTEST): $(TKTESTOBJS) $(TKLIB) $(TMPDIR)\wish.res - $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_GUI) $(TOOLS32)\lib\c0x32 @&&! - $(TKTESTOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res -! -# $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \ -# $(guilibsdll) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB) $(TKTESTOBJS) - -#$(CAT32): $(TCLDIR)\win\cat.c -# $(cc32) $(CON_CFLAGS) -o$(TMPDIR)\cat.obj $? -# $(link32) $(conlflags) -out:$@ -stack:16384 $(TMPDIR)\cat.obj $(conlibs) - -$(CAT32): $(TCLDIR)\win\cat.c - $(cc32) $(CONS_CFLAGS) -o$(TMPDIR)\cat.obj $? - $(link32) $(ldebug) $(LNFLAGS) $(LNFLAGS_CONS) $(TOOLS32)\lib\c0x32 \ - $(TMPDIR)\cat.obj, $@, -x, $(LNLIBS),, - -# -# Regenerate the stubs files. -# - -genstubs: - tclsh$(VERSION) $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \ - $(GENERICDIR)\tk.decls $(GENERICDIR)\tkInt.decls - -# -# Special case object file targets -# - -$(TMPDIR)\testMain.obj: $(WINDIR)\winMain.c - $(cc32) $(WISH_CFLAGS) -DTK_TEST -o$@ $? - -$(TMPDIR)\tkTest.obj: $(GENERICDIR)\tkTest.c - $(cc32) $(WISH_CFLAGS) -o$@ $? - -$(TMPDIR)\tkOldTest.obj: $(GENERICDIR)\tkOldTest.c - $(cc32) $(WISH_CFLAGS) -o$@ $? - -$(TMPDIR)\tkWinTest.obj: $(WINDIR)\tkWinTest.c - $(cc32) $(WISH_CFLAGS) -o$@ $? - -$(TMPDIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c - $(cc32) $(WISH_CFLAGS) -o$@ $? - -$(TMPDIR)\winMain.obj: $(WINDIR)\winMain.c - $(cc32) $(WISH_CFLAGS) -o$@ $? - -$(TMPDIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c - $(cc32) $(TK_CFLAGS) -DSTATIC_BUILD -o$@ $? - -# -# Implicit rules -# - -{$(XLIBDIR)}.c{$(TMPDIR)}.obj: - $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< - -{$(GENERICDIR)}.c{$(TMPDIR)}.obj: - $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< - -{$(WINDIR)}.c{$(TMPDIR)}.obj: - $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< - -{$(ROOT)\unix}.c{$(TMPDIR)}.obj: - $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< - -{$(RCDIR)}.rc{$(TMPDIR)}.res: - $(rc32) -I"$(GENERICDIR)" -I"$(TOOLS32)\include" -I"$(TCLDIR)\generic" \ - -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< - -clean: - -@del $(OUTDIR)\*.exp - -@del $(OUTDIR)\*.lib - -@del $(OUTDIR)\*.dll - -@del $(OUTDIR)\*.exe - -@del $(OUTDIR)\*.pdb - -@del $(TMPDIR)\*.pch - -@del $(TMPDIR)\*.obj - -@del $(TMPDIR)\*.res - -@del $(TMPDIR)\*.exe - -@rmd $(OUTDIR) - -@rmd $(TMPDIR) - -# dependencies - -$(TMPDIR)\tk.res: \ - $(RCDIR)\buttons.bmp \ - $(RCDIR)\cursor*.cur \ - $(RCDIR)\tk.ico - -$(GENERICDIR)/default.h: $(WINDIR)/tkWinDefault.h -$(GENERICDIR)/tkButton.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkCanvas.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkEntry.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkFrame.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkListbox.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkMenubutton.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkMessage.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkScale.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkScrollbar.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkText.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/default.h -$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/default.h - -$(GENERICDIR)/tkText.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextBTree.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextImage.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextMark.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/tkText.h -$(GENERICDIR)/tkTextWind.c: $(GENERICDIR)/tkText.h - -$(GENERICDIR)/tkMacWinMenu.c: $(GENERICDIR)/tkMenu.h -$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/tkMenu.h -$(GENERICDIR)/tkMenuDraw.c: $(GENERICDIR)/tkMenu.h -$(WINDIR)/tkWinMenu.c: $(GENERICDIR)/tkMenu.h - - +# +# Makefile for Borland C++ 5.5 (or C++ Builder 5), adapted from the makefile +# for Visual C++ that came with tk 8.3.3 +# +# Some "not so obvious" details in this makefile are preceded by a comment +# "maintenance hint", which tries to explain what's going on. Better to +# leave those in place. +# Helmut Giese, July 2002 +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# Copyright (c) 1995-1997 Sun Microsystems, Inc. +# Copyright (c) 1998-2000 Ajuba Solutions. + +# Does not depend on the presence of any environment variables in +# order to compile tcl; all needed information is derived from +# location of the compiler directories. + +# +# Project directories +# +# ROOT = top of source tree +# +# TMPDIR = location where .obj files should be stored during build +# +# TOOLS32 = location of Borland development tools. +# +# TCLDIR = location of top of Tcl source hierarchy +# + +ROOT = .. +TCLDIR = ..\..\tcl8.4 +INSTALLDIR = D:\tmp\tcl + +# If you have C++ Builder 5 or the free Borland C++ 5.5 compiler +# adapt the following paths as appropriate for your system +TOOLS32 = d:\cbld5 +TOOLS32_rc = d:\cbld5 +#TOOLS32 = c:\bc55 +#TOOLS32_rc = c:\bc55 + +cc32 = "$(TOOLS32)\bin\bcc32.exe" +link32 = "$(TOOLS32)\bin\ilink32.exe" +lib32 = "$(TOOLS32)\bin\tlib.exe" +rc32 = "$(TOOLS32_rc)\bin\brcc32.exe" +include32 = -I"$(TOOLS32)\include;$(TOOLS32)\include\mfc" +libpath32 = -L"$(TOOLS32)\lib" + +# Uncomment the following line to compile with thread support +#THREADDEFINES = -DTCL_THREADS=1 + +# Allow definition of NDEBUG via command line +# Set NODEBUG to 0 to compile with symbols +!if !defined(NODEBUG) +NODEBUG = 1 +!endif + +# uncomment the following two lines to compile with TCL_MEM_DEBUG +#DEBUGDEFINES =-DTCL_MEM_DEBUG + +###################################################################### +# Do not modify below this line +###################################################################### + +TCLNAMEPREFIX = tcl +TKNAMEPREFIX = tk +WISHNAMEPREFIX = wish +VERSION = 84 +DOTVERSION = 8.4 + +TCLSTUBPREFIX = $(TCLNAMEPREFIX)stub +TKSTUBPREFIX = $(TKNAMEPREFIX)stub + + +BINROOT = . +!IF "$(NODEBUG)" == "1" +TMPDIRNAME = Release +DBGX = +!ELSE +TMPDIRNAME = Debug +DBGX = +#DBGX = d +!ENDIF +TMPDIR = $(BINROOT)\$(TMPDIRNAME) +OUTDIRNAME = $(TMPDIRNAME) +OUTDIR = $(TMPDIR) + +TCLLIB = $(TCLNAMEPREFIX)$(VERSION)$(DBGX).lib +TCLPLUGINLIB = $(TCLNAMEPREFIX)$(VERSION)p.lib +TCLSTUBLIB = $(TCLSTUBPREFIX)$(VERSION)$(DBGX).lib +TKDLLNAME = $(TKNAMEPREFIX)$(VERSION)$(DBGX).dll +TKDLL = $(OUTDIR)\$(TKDLLNAME) +TKLIB = $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)$(DBGX).lib +TKSTUBLIBNAME = $(TKSTUBPREFIX)$(VERSION)$(DBGX).lib +TKSTUBLIB = $(OUTDIR)\$(TKSTUBLIBNAME) +TKPLUGINDLLNAME = $(TKNAMEPREFIX)$(VERSION)p$(DBG).dll +TKPLUGINDLL = $(OUTDIR)\$(TKPLUGINDLLNAME) +TKPLUGINLIB = $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)p$(DBGX).lib + +WISH = $(OUTDIR)\$(WISHNAMEPREFIX)$(VERSION)$(DBGX).exe +WISHC = $(OUTDIR)\$(WISHNAMEPREFIX)c$(VERSION)$(DBGX).exe +WISHP = $(OUTDIR)\$(WISHNAMEPREFIX)p$(VERSION)$(DBGX).exe +TKTEST = $(OUTDIR)\$(TKNAMEPREFIX)test.exe +CAT32 = $(TMPDIR)\cat32.exe + +BIN_INSTALL_DIR = $(INSTALLDIR)\bin +INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include +LIB_INSTALL_DIR = $(INSTALLDIR)\lib +SCRIPT_INSTALL_DIR = $(LIB_INSTALL_DIR)\tk$(DOTVERSION) + +WISHOBJS = \ + $(TMPDIR)\winMain.obj + +TKTESTOBJS = \ + $(TMPDIR)\tkTest.obj \ + $(TMPDIR)\tkSquare.obj \ + $(TMPDIR)\testMain.obj \ + $(TMPDIR)\tkOldTest.obj \ + $(TMPDIR)\tkWinTest.obj \ + $(TCLLIBDIR)\tclThreadTest.obj + +XLIBOBJS = \ + $(TMPDIR)\xcolors.obj \ + $(TMPDIR)\xdraw.obj \ + $(TMPDIR)\xgc.obj \ + $(TMPDIR)\ximage.obj \ + $(TMPDIR)\xutil.obj + +TKOBJS = \ + $(TMPDIR)\tkConsole.obj \ + $(TMPDIR)\tkUnixMenubu.obj \ + $(TMPDIR)\tkUnixScale.obj \ + $(XLIBOBJS) \ + $(TMPDIR)\tkWin3d.obj \ + $(TMPDIR)\tkWin32Dll.obj \ + $(TMPDIR)\tkWinButton.obj \ + $(TMPDIR)\tkWinClipboard.obj \ + $(TMPDIR)\tkWinColor.obj \ + $(TMPDIR)\tkWinConfig.obj \ + $(TMPDIR)\tkWinCursor.obj \ + $(TMPDIR)\tkWinDialog.obj \ + $(TMPDIR)\tkWinDraw.obj \ + $(TMPDIR)\tkWinEmbed.obj \ + $(TMPDIR)\tkWinFont.obj \ + $(TMPDIR)\tkWinImage.obj \ + $(TMPDIR)\tkWinInit.obj \ + $(TMPDIR)\tkWinKey.obj \ + $(TMPDIR)\tkWinMenu.obj \ + $(TMPDIR)\tkWinPixmap.obj \ + $(TMPDIR)\tkWinPointer.obj \ + $(TMPDIR)\tkWinRegion.obj \ + $(TMPDIR)\tkWinScrlbr.obj \ + $(TMPDIR)\tkWinSend.obj \ + $(TMPDIR)\tkWinWindow.obj \ + $(TMPDIR)\tkWinWm.obj \ + $(TMPDIR)\tkWinX.obj \ + $(TMPDIR)\stubs.obj \ + $(TMPDIR)\tk3d.obj \ + $(TMPDIR)\tkArgv.obj \ + $(TMPDIR)\tkAtom.obj \ + $(TMPDIR)\tkBind.obj \ + $(TMPDIR)\tkBitmap.obj \ + $(TMPDIR)\tkButton.obj \ + $(TMPDIR)\tkCanvArc.obj \ + $(TMPDIR)\tkCanvBmap.obj \ + $(TMPDIR)\tkCanvImg.obj \ + $(TMPDIR)\tkCanvLine.obj \ + $(TMPDIR)\tkCanvPoly.obj \ + $(TMPDIR)\tkCanvPs.obj \ + $(TMPDIR)\tkCanvText.obj \ + $(TMPDIR)\tkCanvUtil.obj \ + $(TMPDIR)\tkCanvWind.obj \ + $(TMPDIR)\tkCanvas.obj \ + $(TMPDIR)\tkClipboard.obj \ + $(TMPDIR)\tkCmds.obj \ + $(TMPDIR)\tkColor.obj \ + $(TMPDIR)\tkConfig.obj \ + $(TMPDIR)\tkCursor.obj \ + $(TMPDIR)\tkEntry.obj \ + $(TMPDIR)\tkError.obj \ + $(TMPDIR)\tkEvent.obj \ + $(TMPDIR)\tkFileFilter.obj \ + $(TMPDIR)\tkFocus.obj \ + $(TMPDIR)\tkFont.obj \ + $(TMPDIR)\tkFrame.obj \ + $(TMPDIR)\tkGC.obj \ + $(TMPDIR)\tkGeometry.obj \ + $(TMPDIR)\tkGet.obj \ + $(TMPDIR)\tkGrab.obj \ + $(TMPDIR)\tkGrid.obj \ + $(TMPDIR)\tkImage.obj \ + $(TMPDIR)\tkImgBmap.obj \ + $(TMPDIR)\tkImgGIF.obj \ + $(TMPDIR)\tkImgPPM.obj \ + $(TMPDIR)\tkImgPhoto.obj \ + $(TMPDIR)\tkImgUtil.obj \ + $(TMPDIR)\tkListbox.obj \ + $(TMPDIR)\tkMacWinMenu.obj \ + $(TMPDIR)\tkMain.obj \ + $(TMPDIR)\tkMenu.obj \ + $(TMPDIR)\tkMenubutton.obj \ + $(TMPDIR)\tkMenuDraw.obj \ + $(TMPDIR)\tkMessage.obj \ + $(TMP_DIR)\tkPanedWindow.obj \ + $(TMPDIR)\tkObj.obj \ + $(TMPDIR)\tkOldConfig.obj \ + $(TMPDIR)\tkOption.obj \ + $(TMPDIR)\tkPack.obj \ + $(TMPDIR)\tkPlace.obj \ + $(TMPDIR)\tkPointer.obj \ + $(TMPDIR)\tkRectOval.obj \ + $(TMPDIR)\tkScale.obj \ + $(TMPDIR)\tkScrollbar.obj \ + $(TMPDIR)\tkSelect.obj \ + $(TMPDIR)\tkText.obj \ + $(TMPDIR)\tkTextBTree.obj \ + $(TMPDIR)\tkTextDisp.obj \ + $(TMPDIR)\tkTextImage.obj \ + $(TMPDIR)\tkTextIndex.obj \ + $(TMPDIR)\tkTextMark.obj \ + $(TMPDIR)\tkTextTag.obj \ + $(TMPDIR)\tkTextWind.obj \ + $(TMPDIR)\tkTrig.obj \ + $(TMPDIR)\tkUtil.obj \ + $(TMPDIR)\tkVisual.obj \ + $(TMPDIR)\tkStubInit.obj \ + $(TMPDIR)\tkWindow.obj + +# Maintenance hint: Please have multiple members of TKSTUBOBJS be separated +# by exactly one ' ' (see below the rule for making TKSTUBLIB) +TKSTUBOBJS = $(TMPDIR)\tkStubLib.obj + +WINDIR = $(ROOT)\win +GENERICDIR = $(ROOT)\generic +XLIBDIR = $(ROOT)\xlib +BITMAPDIR = $(ROOT)\bitmaps +TCLLIBDIR = $(TCLDIR)\win\$(OUTDIRNAME) +RCDIR = $(WINDIR)\rc + +TK_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) -I$(BITMAPDIR) -I$(XLIBDIR) \ + -I$(TCLDIR)\generic -I$(TCLDIR)\win + +TK_DEFINES = -D__WIN32__ $(DEBUGDEFINES) $(THREADDEFINES) SUPPORT_CONFIG_EMBEDDED + +###################################################################### +# Compile flags +###################################################################### + +!IF "$(NODEBUG)" == "1" +# these macros cause maximum optimization and no symbols +cdebug = -v- -vi- -O2 -D_DEBUG +!ELSE +# these macros enable debugging +cdebug = -k -Od -r- -v -vi- -y +!ENDIF + +SYSDEFINES = _MT;NO_STRICT;_NO_VCL + +# declarations common to all compiler options +cbase = -3 -a4 -c -g0 -tWM -Ve -Vx -X- +WARNINGS = -w-rch -w-pch -w-par -w-dup -w-pro -w-dpu + +ccons = -tWC + +CFLAGS = $(cdebug) $(cbase) $(WARNINGS) -D$(SYSDEFINES) + +CON_CFLAGS = $(CFLAGS) $(TK_DEFINES) $(include32) $(ccons) +WISH_CFLAGS = $(CFLAGS) $(include32) $(TK_INCLUDES) $(TK_DEFINES) +TK_CFLAGS = $(CFLAGS) $(include32) $(TK_INCLUDES) $(TK_DEFINES) \ + -DUSE_TCL_STUBS + +###################################################################### +# Link flags +###################################################################### + +!IF "$(NODEBUG)" == "1" +ldebug = +!ELSE +ldebug = -v +!ENDIF + +# declarations common to all linker options +LNFLAGS = -D"" -Gn -I$(TMPDIR) -x $(ldebug) $(libpath32) +# -Gi: create lib file (is -Gl in doc) +# -aa: Windows app, -ap: Windows console app +LNFLAGS_DLL = -ap -Gi -Tpd +LNFLAGS_CONS = -ap -Tpe +LNFLAGS_GUI = -aa -Tpe + +LNLIBS = import32 cw32mt + + +###################################################################### +# Project specific targets +###################################################################### + +all: setup $(WISH) $(CAT32) +install: install-binaries install-libraries +plugin: setup $(TKPLUGINDLL) $(WISHP) +tktest: setup $(TKTEST) $(CAT32) + +# Maintenance hint: We want to set environment variables before calling tktest. +# If we do this in the form of normal commands, they will not persist up to +# the call of tktest. Therfore we put all commands wanted into a batch file. +# The normal way of using 'echo >x.bat' and 'echo >>x.bat' does not work here +# because we cannot write '... > tktest.txt' this way. Hence this advanced +# form of loop hopping: +# - Have MAKE produce a temporary file with the content we want. +# - Use it as input to the COPY command to produce a batch file. +# - Run the batch file and be happy. +# +test: setup $(TKTEST) $(TKLIB) $(CAT32) + copy &&! + set TCL_LIBRARY=$(TCLDIR)/library + set PATH=$(TCLDIR)\win\$(TMPDIRNAME);$(PATH) + $(TKTEST) $(ROOT)/tests/all.tcl > tktest.txt +! _test.bat + _test.bat +# del _test.bat + +runtest: setup $(TKTEST) $(TKLIB) $(CAT32) + echo set TCL_LIBRARY=$(TCLDIR)/library > _test2.bat + echo set PATH=$(TCLDIR)\win\$(TMPDIRNAME);$(PATH) >> _test2.bat + echo $(TKTEST) >> _test2.bat + _test2.bat +# del _test2.bat + +console-wish : all $(WISHC) + +stubs: + $(TCLDIR)\win\$(TMPDIRNAME)\tclsh$(VERSION)$(DBGX) \ + $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \ + $(GENERICDIR)\tk.decls $(GENERICDIR)\tkInt.decls + +setup: + @mkd $(TMPDIR) + @mkd $(OUTDIR) + +install-binaries: + @mkd "$(BIN_INSTALL_DIR)" + copy $(TKDLL) "$(BIN_INSTALL_DIR)" + copy $(WISH) "$(BIN_INSTALL_DIR)" + @mkd "$(LIB_INSTALL_DIR)" + copy $(TKLIB) "$(LIB_INSTALL_DIR)" + +install-libraries: + @mkd "$(INCLUDE_INSTALL_DIR)" + @mkd "$(INCLUDE_INSTALL_DIR)\X11" + copy "$(GENERICDIR)\tk.h" "$(INCLUDE_INSTALL_DIR)" + copy "$(GENERICDIR)\tkDecls.h" "$(INCLUDE_INSTALL_DIR)" + copy "$(GENERICDIR)\tkPlatDecls.h" "$(INCLUDE_INSTALL_DIR)" + copy "$(GENERICDIR)\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)" + xcopy "$(XLIBDIR)\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11" + @mkd "$(SCRIPT_INSTALL_DIR)" + @mkd "$(SCRIPT_INSTALL_DIR)\images" + @mkd "$(SCRIPT_INSTALL_DIR)\demos" + @mkd "$(SCRIPT_INSTALL_DIR)\demos\images" + @mkd "$(SCRIPT_INSTALL_DIR)\msgs" + xcopy "$(ROOT)\library" "$(SCRIPT_INSTALL_DIR)" + xcopy "$(ROOT)\library\images" "$(SCRIPT_INSTALL_DIR)\images" + xcopy "$(ROOT)\library\demos" "$(SCRIPT_INSTALL_DIR)\demos" + xcopy "$(ROOT)\library\demos\images" "$(SCRIPT_INSTALL_DIR)\demos\images" + xcopy "$(ROOT)\library\msgs" "$(SCRIPT_INSTALL_DIR)\msgs" + +$(TKLIB): $(TKDLL) $(TKSTUBLIB) + +# Maintenance hint: The macro puts a '+-' before the first member of +# TKSTUBOBJS, than replaces any ' ' with ' +-' - together putting '+-' in +# front of any member of TKSTUBOBJS (provided, they are separated in their +# defintion by just one space). +# +# The first time you *make* this target, you will get a warning +# tkStubLib not found in library +# This is (probably) because of the '-' option, telling TLIB to remove +# 'tkStubLib' when it does not yet exist. Forcing a re-make when it already +# exists avoids this warning. +# +$(TKSTUBLIB): $(TKSTUBOBJS) + $(lib32) $@ +-$(TKSTUBOBJS: = +-) + +# $(lib32) $@ @&&! +#+-$(TKSTUBOBJS: = &^ +#+-) +#! + +$(TKDLL): $(TKOBJS) $(TMPDIR)\tk.res + $(link32) $(ldebug) $(LNFLAGS) $(LNFLAGS_DLL) $(TOOLS32)\lib\c0d32 @&&! + $(TKOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLSTUBLIB),, $(TMPDIR)\tk.res +! + +$(TKPLUGINLIB): $(TKPLUGINDLL) + +#$(TKPLUGINDLL): $(TKOBJS) $(TMPDIR)\tk.res +# $(link32) $(ldebug) $(dlllflags) \ +# -out:$@ $(TMPDIR)\tk.res $(TCLLIBDIR)\$(TCLPLUGINLIB) \ +# $(guilibsdll) @<< +# $(TKOBJS) +#<< + +$(WISH): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res + $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_GUI) $(TOOLS32)\lib\c0x32 @&&! + $(WISHOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res +! + +$(WISHC): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res + $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_CONS) $(TOOLS32)\lib\c0x32 @&&! + $(WISHOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res +! + +$(WISHP): $(WISHOBJS) $(TKPLUGINLIB) $(TMPDIR)\wish.res + $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \ + $(guilibsdll) $(TCLLIBDIR)\$(TCLPLUGINLIB) \ + $(TKPLUGINLIB) $(WISHOBJS) + +$(TKTEST): $(TKTESTOBJS) $(TKLIB) $(TMPDIR)\wish.res + $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_GUI) $(TOOLS32)\lib\c0x32 @&&! + $(TKTESTOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res +! +# $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \ +# $(guilibsdll) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB) $(TKTESTOBJS) + +#$(CAT32): $(TCLDIR)\win\cat.c +# $(cc32) $(CON_CFLAGS) -o$(TMPDIR)\cat.obj $? +# $(link32) $(conlflags) -out:$@ -stack:16384 $(TMPDIR)\cat.obj $(conlibs) + +$(CAT32): $(TCLDIR)\win\cat.c + $(cc32) $(CONS_CFLAGS) -o$(TMPDIR)\cat.obj $? + $(link32) $(ldebug) $(LNFLAGS) $(LNFLAGS_CONS) $(TOOLS32)\lib\c0x32 \ + $(TMPDIR)\cat.obj, $@, -x, $(LNLIBS),, + +# +# Regenerate the stubs files. +# + +genstubs: + tclsh$(VERSION) $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \ + $(GENERICDIR)\tk.decls $(GENERICDIR)\tkInt.decls + +# +# Special case object file targets +# + +$(TMPDIR)\testMain.obj: $(WINDIR)\winMain.c + $(cc32) $(WISH_CFLAGS) -DTK_TEST -o$@ $? + +$(TMPDIR)\tkTest.obj: $(GENERICDIR)\tkTest.c + $(cc32) $(WISH_CFLAGS) -o$@ $? + +$(TMPDIR)\tkOldTest.obj: $(GENERICDIR)\tkOldTest.c + $(cc32) $(WISH_CFLAGS) -o$@ $? + +$(TMPDIR)\tkWinTest.obj: $(WINDIR)\tkWinTest.c + $(cc32) $(WISH_CFLAGS) -o$@ $? + +$(TMPDIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c + $(cc32) $(WISH_CFLAGS) -o$@ $? + +$(TMPDIR)\winMain.obj: $(WINDIR)\winMain.c + $(cc32) $(WISH_CFLAGS) -o$@ $? + +$(TMPDIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c + $(cc32) $(TK_CFLAGS) -DSTATIC_BUILD -o$@ $? + +# +# Implicit rules +# + +{$(XLIBDIR)}.c{$(TMPDIR)}.obj: + $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< + +{$(GENERICDIR)}.c{$(TMPDIR)}.obj: + $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< + +{$(WINDIR)}.c{$(TMPDIR)}.obj: + $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< + +{$(ROOT)\unix}.c{$(TMPDIR)}.obj: + $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $< + +{$(RCDIR)}.rc{$(TMPDIR)}.res: + $(rc32) -I"$(GENERICDIR)" -I"$(TOOLS32)\include" -I"$(TCLDIR)\generic" \ + -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< + +clean: + -@del $(OUTDIR)\*.exp + -@del $(OUTDIR)\*.lib + -@del $(OUTDIR)\*.dll + -@del $(OUTDIR)\*.exe + -@del $(OUTDIR)\*.pdb + -@del $(TMPDIR)\*.pch + -@del $(TMPDIR)\*.obj + -@del $(TMPDIR)\*.res + -@del $(TMPDIR)\*.exe + -@rmd $(OUTDIR) + -@rmd $(TMPDIR) + +# dependencies + +$(TMPDIR)\tk.res: \ + $(RCDIR)\buttons.bmp \ + $(RCDIR)\cursor*.cur \ + $(RCDIR)\tk.ico + +$(GENERICDIR)/default.h: $(WINDIR)/tkWinDefault.h +$(GENERICDIR)/tkButton.c: $(GENERICDIR)/default.h +$(GENERICDIR)/tkCanvas.c: $(GENERICDIR)/default.h +$(GENERICDIR)/tkEntry.c: $(GENERICDIR)/default.h +$(GENERICDIR)/tkFrame.c: $(GENERICDIR)/default.h +$(GENERICDIR)/tkListbox.c: $(GENERICDIR)/default.h +$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/default.h +$(GENERICDIR)/tkMenubutton.c: $(GENERICDIR)/default.h +$(GENERICDIR)/tkMessage.c: $(GENERICDIR)/default.h +$(GENERICDIR)/tkScale.c: $(GENERICDIR)/default.h +$(GENERICDIR)/tkScrollbar.c: $(GENERICDIR)/default.h +$(GENERICDIR)/tkText.c: $(GENERICDIR)/default.h +$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/default.h +$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/default.h + +$(GENERICDIR)/tkText.c: $(GENERICDIR)/tkText.h +$(GENERICDIR)/tkTextBTree.c: $(GENERICDIR)/tkText.h +$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h +$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h +$(GENERICDIR)/tkTextImage.c: $(GENERICDIR)/tkText.h +$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/tkText.h +$(GENERICDIR)/tkTextMark.c: $(GENERICDIR)/tkText.h +$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/tkText.h +$(GENERICDIR)/tkTextWind.c: $(GENERICDIR)/tkText.h + +$(GENERICDIR)/tkMacWinMenu.c: $(GENERICDIR)/tkMenu.h +$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/tkMenu.h +$(GENERICDIR)/tkMenuDraw.c: $(GENERICDIR)/tkMenu.h +$(WINDIR)/tkWinMenu.c: $(GENERICDIR)/tkMenu.h + + diff --git a/win/makefile.vc b/win/makefile.vc index 8fbe917..4b9475f 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -1,1028 +1,1028 @@ -#------------------------------------------------------------- -*- makefile -*- -# makefile.vc -- -# -# Microsoft Visual C++ makefile for use with nmake.exe v1.62+ (VC++ 5.0+) -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# Copyright (c) 1995-1996 Sun Microsystems, Inc. -# Copyright (c) 1998-2000 Ajuba Solutions. -# Copyright (c) 2001-2005 ActiveState Corporation. -# Copyright (c) 2001-2004 David Gravereaux. -# Copyright (c) 2003-2008 Pat Thoyts. -#------------------------------------------------------------------------------ - -# Check to see we are configured to build with MSVC (MSDEVDIR, MSVCDIR or -# VCINSTALLDIR) or with the MS Platform SDK (MSSDK or WindowsSDKDir) -!if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(VCINSTALLDIR) && !defined(MSSDK) && !defined(WINDOWSSDKDIR) -MSG = ^ -You need to run vcvars32.bat from Developer Studio or setenv.bat from the^ -Platform SDK first to setup the environment. Jump to this line to read^ -the build instructions. -!error $(MSG) -!endif - -#------------------------------------------------------------------------------ -# HOW TO USE this makefile: -# -# 1) It is now necessary to have MSVCDir, MSDevDir or MSSDK set in the -# environment. This is used as a check to see if vcvars32.bat had been -# run prior to running nmake or during the installation of Microsoft -# Visual C++, MSVCDir had been set globally and the PATH adjusted. -# Either way is valid. -# -# You'll need to run vcvars32.bat contained in the MsDev's vc(98)/bin -# directory to setup the proper environment, if needed, for your -# current setup. This is a needed bootstrap requirement and allows the -# swapping of different environments to be easier. -# -# 2) To use the Platform SDK (not expressly needed), run setenv.bat after -# vcvars32.bat according to the instructions for it. This can also -# turn on the 64-bit compiler, if your SDK has it. -# -# 3) Targets are: -# release -- Builds the core, the shell. (default) -# dlls -- Just builds the windows extensions. -# shell -- Just builds the shell and the core. -# core -- Only builds the core [tkXX.(dll|lib)]. -# all -- Builds everything. -# test -- Builds and runs the test suite. -# tktest -- Just builds the binaries for the test suite. -# install -- Installs the built binaries and libraries to $(INSTALLDIR) -# as the root of the install tree. -# cwish -- Builds a console version of wish. -# tidy/clean/hose -- varying levels of cleaning. -# genstubs -- Rebuilds the Stubs table and support files (dev only). -# depend -- Generates an accurate set of source dependancies for this -# makefile. Helpful to avoid problems when the sources are -# refreshed and you rebuild, but can "overbuild" when common -# headers like tkInt.h just get small changes. -# htmlhelp -- Builds a Windows .chm help file for Tcl and Tk from the -# troff manual pages found in $(ROOT)\doc. You need to -# have installed the HTML Help Compiler package from Microsoft -# to produce the .chm file. -# winhelp -- Builds the windows .hlp file for Tcl from the troff man -# files found in $(ROOT)\doc. -# -# 4) Macros usable on the commandline: -# TCLDIR= -# Sets the location for where to find the Tcl headers and -# libraries. The install point is assumed when not specified. -# Tk does need the source directory, though. Tk comes very close -# to not needing the sources, but does, in fact, require them. -# -# INSTALLDIR= -# Sets where to install Tcl from the built binaries. -# C:\Progra~1\Tcl is assumed when not specified. -# -# OPTS=loimpact,msvcrt,nothreads,noxp,pdbs,profile,square,static,staticpkg,symbols,unchecked,none -# Sets special options for the core. The default is for none. -# Any combination of the above may be used (comma separated). -# 'none' will over-ride everything to nothing. -# -# loimpact = Adds a flag for how NT treats the heap to keep memory -# in use, low. This is said to impact alloc performance. -# msvcrt = Affects the static option only to switch it from -# using libcmt(d) as the C runtime [by default] to -# msvcrt(d). This is useful for static embedding -# support. -# nothreads= Turns off full multithreading support. -# noxp = If you do not have the uxtheme.h header then you -# cannot include support for XP themeing. -# square = Include the demo square widget. -# static = Builds a static library of the core instead of a -# dll. The shell will be static (and large), as well. -# staticpkg= Affects the static option only to switch wishXX.exe -# to have the dde and reg extension linked inside it. -# pdbs = Build detached symbols for release builds. -# profile = Adds profiling hooks. Map file is assumed. -# thrdalloc = Use the thread allocator (shared global free pool) -# This is the default on threaded builds. -# tclalloc = Use the old non-thread allocator -# symbols = Debug build. Links to the debug C runtime, disables -# optimizations and creates pdb symbols files. -# unchecked = Allows a symbols build to not use the debug -# enabled runtime (msvcrt.dll not msvcrtd.dll -# or libcmt.lib not libcmtd.lib). -# -# STATS=compdbg,memdbg,none -# Sets optional memory and bytecode compiler debugging code added -# to the core. The default is for none. Any combination of the -# above may be used (comma separated). 'none' will over-ride -# everything to nothing. -# -# compdbg = Enables byte compilation logging. -# memdbg = Enables the debugging memory allocator. -# -# CHECKS=64bit,fullwarn,nodep,none -# Sets special macros for checking compatability. -# -# 64bit = Enable 64bit portability warnings (if available) -# fullwarn = Builds with full compiler and link warnings enabled. -# Very verbose. -# nodep = Turns off compatability macros to ensure the core -# isn't being built with deprecated functions. -# -# MACHINE=(ALPHA|AMD64|IA64|IX86) -# Set the machine type used for the compiler, linker, and -# resource compiler. This hook is needed to tell the tools -# when alternate platforms are requested. IX86 is the default -# when not specified. If the CPU environment variable has been -# set (ie: recent Platform SDK) then MACHINE is set from CPU. -# -# TMP_DIR= -# OUT_DIR= -# Hooks to allow the intermediate and output directories to be -# changed. $(OUT_DIR) is assumed to be -# $(BINROOT)\(Release|Debug) based on if symbols are requested. -# $(TMP_DIR) will de $(OUT_DIR)\ by default. -# -# TESTPAT= -# Reads the tests requested to be run from this file. -# -# 5) Examples: -# -# Basic syntax of calling nmake looks like this: -# nmake [-nologo] -f makefile.vc [target|macrodef [target|macrodef] [...]] -# -# Standard (no frills) -# c:\tk_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat -# Setting environment for using Microsoft Visual C++ tools. -# c:\tk_src\win\>nmake -f makefile.vc release -# c:\tk_src\win\>nmake -f makefile.vc install INSTALLDIR=c:\progra~1\tcl -# -# Building for Win64 -# c:\tk_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat -# Setting environment for using Microsoft Visual C++ tools. -# c:\tk_src\win\>c:\progra~1\platfo~1\setenv.bat /pre64 /RETAIL -# Targeting Windows pre64 RETAIL -# c:\tk_src\win\>nmake -f makefile.vc MACHINE=IA64 -# -#------------------------------------------------------------------------------ -#============================================================================== -############################################################################### - - -# //==================================================================\\ -# >>[ -> Do not modify below this line. <- ]<< -# >>[ Please, use the commandline macros to modify how Tcl is built. ]<< -# >>[ If you need more features, send us a patch for more macros. ]<< -# \\==================================================================// - - -############################################################################### -#============================================================================== -#------------------------------------------------------------------------------ - -!if !exist("makefile.vc") -MSG = ^ -You must run this makefile only from the directory it is in.^ -Please `cd` to its location first. -!error $(MSG) -!endif - -PROJECT = tk -!include "rules.vc" - -!if $(TCLINSTALL) -!message *** Warning: Tk requires the source distribution of Tcl to build from, -!message *** at this time, sorry. Please set the TCLDIR macro to point to the -!message *** Tcl sources. -!endif - -# Extra makefile options processing... -!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"] -HAVE_UXTHEME_H = 1 -TTK_SQUARE_WIDGET = 0 -!else -!if [nmakehlp -f $(OPTS) "noxp"] -!message *** Exclude support for XP theme -HAVE_UXTHEME_H = 0 -!else -HAVE_UXTHEME_H = 1 -!endif -!if [nmakehlp -f "$(OPTS)" "square"] -!message *** Include ttk square demo widget -TTK_SQUARE_WIDGET = 1 -!else -TTK_SQUARE_WIDGET = 0 -!endif -!endif - -STUBPREFIX = $(PROJECT)stub -WISHNAMEPREFIX = wish - -BINROOT = $(MAKEDIR) # originally . -ROOT = $(MAKEDIR)\.. # originally .. - -TK_LIBRARY = $(ROOT)\library - -TKIMPLIB = "$(OUT_DIR)\$(PROJECT)$(TK_VERSION)$(SUFX).lib" -TKLIBNAME = $(PROJECT)$(TK_VERSION)$(SUFX).$(EXT) -TKLIB = "$(OUT_DIR)\$(TKLIBNAME)" - -TKSTUBLIBNAME = $(STUBPREFIX)$(TK_VERSION).lib -TKSTUBLIB = "$(OUT_DIR)\$(TKSTUBLIBNAME)" - -WISH = "$(OUT_DIR)\$(WISHNAMEPREFIX)$(TK_VERSION)$(SUFX).exe" -WISHC = "$(OUT_DIR)\$(WISHNAMEPREFIX)c$(TK_VERSION)$(SUFX).exe" - -TKTEST = "$(OUT_DIR)\$(PROJECT)test.exe" -CAT32 = "$(OUT_DIR)\cat32.exe" - -LIB_INSTALL_DIR = $(_INSTALLDIR)\lib -BIN_INSTALL_DIR = $(_INSTALLDIR)\bin -DOC_INSTALL_DIR = $(_INSTALLDIR)\doc -SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TK_DOTVERSION) -INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\include - -WISHOBJS = \ - $(TMP_DIR)\winMain.obj \ -!if $(TCL_USE_STATIC_PACKAGES) - $(TCLDDELIB) \ - $(TCLREGLIB) \ -!endif - $(TMP_DIR)\wish.res - -TKTESTOBJS = \ - $(TMP_DIR)\testMain.obj \ - $(TMP_DIR)\tkSquare.obj \ - $(TMP_DIR)\tkTest.obj \ - $(TMP_DIR)\tkOldTest.obj \ - $(TMP_DIR)\tkWinTest.obj - -XLIBOBJS = \ - $(TMP_DIR)\xcolors.obj \ - $(TMP_DIR)\xdraw.obj \ - $(TMP_DIR)\xgc.obj \ - $(TMP_DIR)\ximage.obj \ - $(TMP_DIR)\xutil.obj - -TKOBJS = \ - $(TMP_DIR)\tkConsole.obj \ - $(TMP_DIR)\tkUnixMenubu.obj \ - $(TMP_DIR)\tkUnixScale.obj \ - $(XLIBOBJS) \ - $(TMP_DIR)\tkWin3d.obj \ - $(TMP_DIR)\tkWin32Dll.obj \ - $(TMP_DIR)\tkWinButton.obj \ - $(TMP_DIR)\tkWinClipboard.obj \ - $(TMP_DIR)\tkWinColor.obj \ - $(TMP_DIR)\tkWinConfig.obj \ - $(TMP_DIR)\tkWinCursor.obj \ - $(TMP_DIR)\tkWinDialog.obj \ - $(TMP_DIR)\tkWinDraw.obj \ - $(TMP_DIR)\tkWinEmbed.obj \ - $(TMP_DIR)\tkWinFont.obj \ - $(TMP_DIR)\tkWinImage.obj \ - $(TMP_DIR)\tkWinInit.obj \ - $(TMP_DIR)\tkWinKey.obj \ - $(TMP_DIR)\tkWinMenu.obj \ - $(TMP_DIR)\tkWinPixmap.obj \ - $(TMP_DIR)\tkWinPointer.obj \ - $(TMP_DIR)\tkWinRegion.obj \ - $(TMP_DIR)\tkWinScrlbr.obj \ - $(TMP_DIR)\tkWinSend.obj \ - $(TMP_DIR)\tkWinSendCom.obj \ - $(TMP_DIR)\tkWinWindow.obj \ - $(TMP_DIR)\tkWinWm.obj \ - $(TMP_DIR)\tkWinX.obj \ - $(TMP_DIR)\stubs.obj \ - $(TMP_DIR)\tk3d.obj \ - $(TMP_DIR)\tkArgv.obj \ - $(TMP_DIR)\tkAtom.obj \ - $(TMP_DIR)\tkBind.obj \ - $(TMP_DIR)\tkBitmap.obj \ - $(TMP_DIR)\tkButton.obj \ - $(TMP_DIR)\tkCanvArc.obj \ - $(TMP_DIR)\tkCanvBmap.obj \ - $(TMP_DIR)\tkCanvImg.obj \ - $(TMP_DIR)\tkCanvLine.obj \ - $(TMP_DIR)\tkCanvPoly.obj \ - $(TMP_DIR)\tkCanvPs.obj \ - $(TMP_DIR)\tkCanvText.obj \ - $(TMP_DIR)\tkCanvUtil.obj \ - $(TMP_DIR)\tkCanvWind.obj \ - $(TMP_DIR)\tkCanvas.obj \ - $(TMP_DIR)\tkClipboard.obj \ - $(TMP_DIR)\tkCmds.obj \ - $(TMP_DIR)\tkColor.obj \ - $(TMP_DIR)\tkConfig.obj \ - $(TMP_DIR)\tkCursor.obj \ - $(TMP_DIR)\tkEntry.obj \ - $(TMP_DIR)\tkError.obj \ - $(TMP_DIR)\tkEvent.obj \ - $(TMP_DIR)\tkFileFilter.obj \ - $(TMP_DIR)\tkFocus.obj \ - $(TMP_DIR)\tkFont.obj \ - $(TMP_DIR)\tkFrame.obj \ - $(TMP_DIR)\tkGC.obj \ - $(TMP_DIR)\tkGeometry.obj \ - $(TMP_DIR)\tkGet.obj \ - $(TMP_DIR)\tkGrab.obj \ - $(TMP_DIR)\tkGrid.obj \ - $(TMP_DIR)\tkImage.obj \ - $(TMP_DIR)\tkImgBmap.obj \ - $(TMP_DIR)\tkImgGIF.obj \ - $(TMP_DIR)\tkImgPPM.obj \ - $(TMP_DIR)\tkImgPhoto.obj \ - $(TMP_DIR)\tkImgUtil.obj \ - $(TMP_DIR)\tkListbox.obj \ - $(TMP_DIR)\tkMacWinMenu.obj \ - $(TMP_DIR)\tkMain.obj \ - $(TMP_DIR)\tkMenu.obj \ - $(TMP_DIR)\tkMenubutton.obj \ - $(TMP_DIR)\tkMenuDraw.obj \ - $(TMP_DIR)\tkMessage.obj \ - $(TMP_DIR)\tkPanedWindow.obj \ - $(TMP_DIR)\tkObj.obj \ - $(TMP_DIR)\tkOldConfig.obj \ - $(TMP_DIR)\tkOption.obj \ - $(TMP_DIR)\tkPack.obj \ - $(TMP_DIR)\tkPlace.obj \ - $(TMP_DIR)\tkPointer.obj \ - $(TMP_DIR)\tkRectOval.obj \ - $(TMP_DIR)\tkScale.obj \ - $(TMP_DIR)\tkScrollbar.obj \ - $(TMP_DIR)\tkSelect.obj \ - $(TMP_DIR)\tkStyle.obj \ - $(TMP_DIR)\tkText.obj \ - $(TMP_DIR)\tkTextBTree.obj \ - $(TMP_DIR)\tkTextDisp.obj \ - $(TMP_DIR)\tkTextImage.obj \ - $(TMP_DIR)\tkTextIndex.obj \ - $(TMP_DIR)\tkTextMark.obj \ - $(TMP_DIR)\tkTextTag.obj \ - $(TMP_DIR)\tkTextWind.obj \ - $(TMP_DIR)\tkTrig.obj \ - $(TMP_DIR)\tkUndo.obj \ - $(TMP_DIR)\tkUtil.obj \ - $(TMP_DIR)\tkVisual.obj \ - $(TMP_DIR)\tkStubInit.obj \ - $(TMP_DIR)\tkWindow.obj \ - $(TTK_OBJS) \ -!if !$(STATIC_BUILD) - $(TMP_DIR)\tk.res -!endif - -TTK_OBJS = \ - $(TMP_DIR)\ttkWinMonitor.obj \ - $(TMP_DIR)\ttkWinTheme.obj \ - $(TMP_DIR)\ttkWinXPTheme.obj \ - $(TMP_DIR)\ttkBlink.obj \ - $(TMP_DIR)\ttkButton.obj \ - $(TMP_DIR)\ttkCache.obj \ - $(TMP_DIR)\ttkClamTheme.obj \ - $(TMP_DIR)\ttkClassicTheme.obj \ - $(TMP_DIR)\ttkDefaultTheme.obj \ - $(TMP_DIR)\ttkElements.obj \ - $(TMP_DIR)\ttkEntry.obj \ - $(TMP_DIR)\ttkFrame.obj \ - $(TMP_DIR)\ttkImage.obj \ - $(TMP_DIR)\ttkInit.obj \ - $(TMP_DIR)\ttkLabel.obj \ - $(TMP_DIR)\ttkLayout.obj \ - $(TMP_DIR)\ttkManager.obj \ - $(TMP_DIR)\ttkNotebook.obj \ - $(TMP_DIR)\ttkPanedwindow.obj \ - $(TMP_DIR)\ttkProgress.obj \ - $(TMP_DIR)\ttkScale.obj \ - $(TMP_DIR)\ttkScrollbar.obj \ - $(TMP_DIR)\ttkScroll.obj \ - $(TMP_DIR)\ttkSeparator.obj \ - $(TMP_DIR)\ttkSquare.obj \ - $(TMP_DIR)\ttkState.obj \ - $(TMP_DIR)\ttkTagSet.obj \ - $(TMP_DIR)\ttkTheme.obj \ - $(TMP_DIR)\ttkTrace.obj \ - $(TMP_DIR)\ttkTrack.obj \ - $(TMP_DIR)\ttkTreeview.obj \ - $(TMP_DIR)\ttkWidget.obj \ - $(TMP_DIR)\ttkStubInit.obj - -TKSTUBOBJS = \ - $(TMP_DIR)\tkStubLib.obj \ - $(TMP_DIR)\ttkStubLib.obj - - -WINDIR = $(ROOT)\win -GENERICDIR = $(ROOT)\generic -XLIBDIR = $(ROOT)\xlib -TTKDIR = $(ROOT)\generic\ttk -BITMAPDIR = $(ROOT)\bitmaps -DOCDIR = $(ROOT)\doc -RCDIR = $(WINDIR)\rc - -TK_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)" -I"$(BITMAPDIR)" -I"$(XLIBDIR)" \ - $(TCL_INCLUDES) - -CONFIG_DEFS =-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 \ - -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 \ - -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 \ - -DSUPPORT_CONFIG_EMBEDDED \ -!if $(HAVE_UXTHEME_H) - -DHAVE_UXTHEME_H=1 \ -!endif -!if $(TTK_SQUARE_WIDGET) - -DTTK_SQUARE_WIDGET=1 \ -!endif - -TK_DEFINES =-DBUILD_ttk $(OPTDEFINES) $(CONFIG_DEFS) -Dinline=__inline - -#--------------------------------------------------------------------- -# Compile flags -#--------------------------------------------------------------------- - -!if !$(DEBUG) -!if $(OPTIMIZING) -### This cranks the optimization level to maximize speed -### We can't use -O2 because sometimes it causes problems. -cdebug = $(OPTIMIZATIONS) -!else -cdebug = -!endif -!if $(SYMBOLS) -cdebug = $(cdebug) -Zi -!endif -!else if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" -### Warnings are too many, can't support warnings into errors. -cdebug = -Zi -Od $(DEBUGFLAGS) -!else -cdebug = -Zi -WX $(DEBUGFLAGS) -!endif - -### Declarations common to all compiler options -cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE -cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\ - -!if $(MSVCRT) -!if $(DEBUG) && !$(UNCHECKED) -crt = -MDd -!else -crt = -MD -!endif -!else -!if $(DEBUG) && !$(UNCHECKED) -crt = -MTd -!else -crt = -MT -!endif -!endif - -BASE_CFLAGS = $(cdebug) $(cflags) $(crt) $(TK_INCLUDES) -TK_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) -DUSE_TCL_STUBS -CON_CFLAGS = $(cdebug) $(cflags) $(crt) -DCONSOLE -WISH_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) -STUB_CFLAGS = $(cflags) $(cdebug) $(TK_DEFINES) - -#--------------------------------------------------------------------- -# Link flags -#--------------------------------------------------------------------- - -!if $(DEBUG) -ldebug = -debug -debugtype:cv -!else -ldebug = -release -opt:ref -opt:icf,3 -!if $(SYMBOLS) -ldebug = $(ldebug) -debug -debugtype:cv -!endif -!endif - -### Declarations common to all linker options -lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) - -!if $(PROFILE) -lflags = $(lflags) -profile -!endif - -!if $(ALIGN98_HACK) && !$(STATIC_BUILD) -### Align sections for PE size savings. -lflags = $(lflags) -opt:nowin98 -!else if !$(ALIGN98_HACK) && $(STATIC_BUILD) -### Align sections for speed in loading by choosing the virtual page size. -lflags = $(lflags) -align:4096 -!endif - -!if $(LOIMPACT) -lflags = $(lflags) -ws:aggressive -!endif - -dlllflags = $(lflags) -dll -conlflags = $(lflags) -subsystem:console -guilflags = $(lflags) -subsystem:windows - -baselibs = kernel32.lib user32.lib -# Avoid 'unresolved external symbol __security_cookie' errors. -# c.f. http://support.microsoft.com/?id=894573 -!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" -!if $(VCVERSION) > 1399 && $(VCVERSION) < 1500 -baselibs = $(baselibs) bufferoverflowU.lib -!endif -!endif -guilibs = $(baselibs) gdi32.lib - - -#--------------------------------------------------------------------- -# TkTest flags -#--------------------------------------------------------------------- - -!if "$(TESTPAT)" != "" -TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) -!endif - - -#--------------------------------------------------------------------- -# Project specific targets -#--------------------------------------------------------------------- - -release: setup $(TKSTUBLIB) $(WISH) -all: release $(CAT32) -core: setup $(TKSTUBLIB) $(TKLIB) -cwish: $(WISHC) -install: install-binaries install-libraries install-docs -tktest: setup $(TKTEST) $(CAT32) - - -test: test-classic test-ttk - -test-classic: setup $(TKTEST) $(TKLIB) $(CAT32) - @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) - @set TK_LIBRARY=$(TK_LIBRARY:\=/) - @set TCLLIBPATH= -!if $(TCLINSTALL) - @set PATH=$(_TCLDIR)\bin;$(PATH) -!else - @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) -!endif -!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" - $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) | $(CAT32) -!else - $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) > tests.log - type tests.log | more -!endif - -test-ttk: setup $(TKTEST) $(TKLIB) $(CAT32) - @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) - @set TK_LIBRARY=$(TK_LIBRARY:\=/) - @set TCLLIBPATH= -!if $(TCLINSTALL) - @set PATH=$(_TCLDIR)\bin;$(PATH) -!else - @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) -!endif -!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" - $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32) -!else - $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/ttk/all.tcl" $(TESTFLAGS) > tests.log - type tests.log | more -!endif - -runtest: setup $(TKTEST) $(TKLIB) $(CAT32) - @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) - @set TK_LIBRARY=$(TK_LIBRARY:\=/) - @set TCLLIBPATH= -!if $(TCLINSTALL) - @set PATH=$(_TCLDIR)\bin;$(PATH) -!else - @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) -!endif - $(DEBUGGER) $(TKTEST) - -rundemo: setup $(TKTEST) $(TKLIB) $(CAT32) - @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) - @set TK_LIBRARY=$(TK_LIBRARY:\=/) - @set TCLLIBPATH= -!if $(TCLINSTALL) - @set PATH=$(_TCLDIR)\bin;$(PATH) -!else - @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) -!endif - $(TKTEST) $(ROOT:\=/)\library\demos\widget - -shell: setup $(WISH) - @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) - @set TK_LIBRARY=$(TK_LIBRARY:\=/) - @set TCLLIBPATH= -!if $(TCLINSTALL) - @set PATH=$(_TCLDIR)\bin;$(PATH) -!else - @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) -!endif - $(DEBUGGER) $(WISH) << - console show -<< - -dbgshell: setup $(WISH) - @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) - @set TK_LIBRARY=$(TK_LIBRARY:\=/) - @set TCLLIBPATH= -!if $(TCLINSTALL) - @set PATH=$(_TCLDIR)\bin;$(PATH) -!else - @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) -!endif - windbg $(WISH) - -setup: - @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) - @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) - -!if !$(STATIC_BUILD) -$(TKIMPLIB): $(TKLIB) -!endif - -$(TKLIB): $(TKOBJS) -!if $(STATIC_BUILD) - $(lib32) -nologo -out:$@ @<< -$** -<< -!else - $(link32) $(dlllflags) -base:@$(COFFBASE),tk -out:$@ $(guilibs) \ - $(TCLSTUBLIB) @<< -$** -<< - $(_VC_MANIFEST_EMBED_DLL) - -@del $*.exp -!endif - - -$(TKSTUBLIB): $(TKSTUBOBJS) - $(lib32) -nologo -nodefaultlib -out:$@ $** - - -$(WISH): $(WISHOBJS) $(TKIMPLIB) - $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** - $(_VC_MANIFEST_EMBED_EXE) - - -$(WISHC): $(WISHOBJS) $(TKIMPLIB) - $(link32) $(conlflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** - $(_VC_MANIFEST_EMBED_EXE) - - -$(TKTEST): $(TKTESTOBJS) $(TKIMPLIB) - $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** - $(_VC_MANIFEST_EMBED_EXE) - - -$(CAT32): $(_TCLDIR)\win\cat.c - $(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $? - $(link32) $(conlflags) -out:$@ -stack:16384 $(TMP_DIR)\cat.obj $(baselibs) - $(_VC_MANIFEST_EMBED_EXE) - -#--------------------------------------------------------------------- -# Regenerate the stubs files. [Development use only] -#--------------------------------------------------------------------- - -genstubs: -!if !exist($(TCLSH)) - @echo Build tclsh first! -!else - set TCL_LIBRARY=$(TCL_LIBRARY) - $(TCLSH) $(_TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \ - $(GENERICDIR)\$(PROJECT).decls $(GENERICDIR)\$(PROJECT)Int.decls -!endif - - -#--------------------------------------------------------------------- -# Build the Windows HTML help file. -#--------------------------------------------------------------------- - -# NOTE: you can define HHC on the command-line to override this -!ifndef HHC -HHC=""%ProgramFiles%\HTML Help Workshop\hhc.exe"" -!endif -HTMLDIR=$(ROOT)\html -HTMLBASE=TclTk$(VERSION) -HHPFILE=$(HTMLDIR)\$(HTMLBASE).hhp -CHMFILE=$(HTMLDIR)\$(HTMLBASE).chm - -htmlhelp: chmsetup $(CHMFILE) - -$(CHMFILE): $(DOCDIR)\* - @$(TCLSH) $(TCLTOOLSDIR)\tcltk-man2html.tcl - @echo Compiling HTML help project - @$(HHC) <<$(HHPFILE) >NUL -[OPTIONS] -Compatibility=1.1 or later -Compiled file=$(HTMLBASE).chm -Display compile progress=no -Error log file=$(HTMLBASE).log -Language=0x409 English (United States) -Title=Tcl/Tk $(DOT_VERSION) Help -[FILES] -contents.htm -docs.css -Keywords -TclCmd -TclLib -TkCmd -TkLib -UserCmd -<< - -chmsetup: - @if not exist $(HTMLDIR)\nul mkdir $(HTMLDIR) - -#------------------------------------------------------------------------- -# Build the old-style Windows .hlp file -#------------------------------------------------------------------------- - -HLPBASE = $(PROJECT)$(TK_VERSION) -HELPFILE = $(OUT_DIR)\$(HLPBASE).hlp -HELPCNT = $(OUT_DIR)\$(HLPBASE).cnt -DOCTMP_DIR = $(OUT_DIR)\$(PROJECT)_docs -HELPRTF = $(DOCTMP_DIR)\$(PROJECT).rtf -MAN2HELP = $(DOCTMP_DIR)\man2help.tcl -MAN2HELP2 = $(DOCTMP_DIR)\man2help2.tcl -INDEX = $(DOCTMP_DIR)\index.tcl -BMP = $(DOCTMP_DIR)\lamp.bmp -BMP_NOPATH = lamp.bmp -MAN2TCL = $(DOCTMP_DIR)\man2tcl.exe - -winhelp: docsetup $(HELPFILE) - -docsetup: - @if not exist $(DOCTMP_DIR)\nul mkdir $(DOCTMP_DIR) - -$(MAN2HELP) $(MAN2HELP2) $(INDEX): $(TCLTOOLSDIR)\$$(@F) - $(CPY) $(TCLTOOLSDIR)\$(@F) $(@D) - -$(BMP): - $(CPY) $(WINDIR)\rc\$(@F) $(@D) - -$(HELPFILE): $(HELPRTF) $(BMP) - cd $(DOCTMP_DIR) - start /wait hcrtf.exe -x <<$(PROJECT).hpj -[OPTIONS] -COMPRESS=12 Hall Zeck -LCID=0x409 0x0 0x0 ; English (United States) -TITLE=Tk Reference Manual -BMROOT=. -CNT=$(@B).cnt -HLP=$(@B).hlp - -[FILES] -$(PROJECT).rtf - -[WINDOWS] -main="Tcl/Tk Reference Manual",,27648,(r15263976),(r4227327) - -[CONFIG] -BrowseButtons() -CreateButton(1, "Web", ExecFile("http://www.tcl.tk")) -CreateButton(2, "SF", ExecFile("http://sf.net/projects/tcl")) -CreateButton(3, "Wiki", ExecFile("http://wiki.tcl.tk")) -CreateButton(4, "FAQ", ExecFile("http://www.purl.org/NET/Tcl-FAQ/")) -<< - cd $(MAKEDIR) - @$(CPY) "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)" - @$(CPY) "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)" - -$(MAN2TCL): $(TCLTOOLSDIR)\$$(@B).c - $(cc32) $(TK_CFLAGS) -Fo$(@D)\ $(TCLTOOLSDIR)\$(@B).c - $(link32) $(conlflags) -out:$@ -stack:16384 $(@D)\man2tcl.obj - $(_VC_MANIFEST_EMBED_EXE) - -$(HELPRTF): $(MAN2TCL) $(MAN2HELP) $(MAN2HELP2) $(INDEX) - $(TCLSH) $(MAN2HELP) -bitmap $(BMP_NOPATH) $(PROJECT) $(TK_VERSION) $(DOCDIR:\=/) - -install-docs: -!if exist($(HELPFILE)) - $(CPY) "$(HELPFILE)" "$(DOC_INSTALL_DIR)\" - $(CPY) "$(HELPCNT)" "$(DOC_INSTALL_DIR)\" - $(TCLSH) << -puts "Installing $(PROJECT)'s helpfile contents into Tcl's ..." -set f [open "$(DOC_INSTALL_DIR:\=/)/tcl$(TK_VERSION).cnt" r] -while {![eof $$f]} { - if {[regexp {:Include $(PROJECT)([0-9]{2}).cnt} [gets $$f] dummy ver]} { - if {$$ver == $(TK_VERSION)} { - puts "Already installed." - exit - } else { - # do something here logical to remove (or replace) it. - puts "$$ver != $(TK_VERSION), unfinished code path, die, die!" - exit 1 - } - } -} -close $$f -set f [open "$(DOC_INSTALL_DIR:\=/)/tcl$(TK_VERSION).cnt" a] -puts $$f {:Include $(HLPBASE).cnt} -close $$f -<< - start /wait winhlp32 -g $(DOC_INSTALL_DIR)\tcl$(TK_VERSION).hlp -!endif - -#--------------------------------------------------------------------- -# Special case object file targets -#--------------------------------------------------------------------- - -$(TMP_DIR)\testMain.obj: $(WINDIR)\winMain.c - $(cc32) $(WISH_CFLAGS) -DTK_TEST \ - -DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \ - -Fo$@ $? - -$(TMP_DIR)\tkTest.obj: $(GENERICDIR)\tkTest.c - $(cc32) $(WISH_CFLAGS) -Fo$@ $? - -$(TMP_DIR)\tkOldTest.obj: $(GENERICDIR)\tkOldTest.c - $(cc32) $(WISH_CFLAGS) -Fo$@ $? - -$(TMP_DIR)\tkWinTest.obj: $(WINDIR)\tkWinTest.c - $(cc32) $(WISH_CFLAGS) -Fo$@ $? - -$(TMP_DIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c - $(cc32) $(WISH_CFLAGS) -Fo$@ $? - -$(TMP_DIR)\winMain.obj: $(WINDIR)\winMain.c - $(cc32) $(WISH_CFLAGS) \ - -DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \ - -Fo$@ $? - -# The following objects are part of the stub library and should not -# be built as DLL objects but none of the symbols should be exported -# and no reference made to a C runtime. - -$(TMP_DIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c - $(cc32) $(STUB_CFLAGS) $(TK_INCLUDES) -Zl -DSTATIC_BUILD -Fo$@ $? - - -$(TMP_DIR)\wish.exe.manifest: $(WINDIR)\wish.exe.manifest.in - @nmakehlp -s << $** >$@ -@MACHINE@ $(MACHINE:IX86=X86) -@TK_WIN_VERSION@ $(TK_DOTVERSION).0.0 -<< - -#--------------------------------------------------------------------- -# Generate the source dependencies. Having dependency rules will -# improve incremental build accuracy without having to resort to a -# full rebuild just because some non-global header file like -# tclCompile.h was changed. These rules aren't needed when building -# from scratch. -#--------------------------------------------------------------------- - -depend: -!if !exist($(TCLSH)) - @echo Build tclsh first! -!else - set TCL_LIBRARY=$(TCL_LIBRARY) - $(TCLSH) $(TCLTOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \ - -passthru:"-DBUILD_tk $(TK_INCLUDES)" $(GENERICDIR),$$(GENERICDIR) \ - $(WINDIR),$$(WINDIR) $(TTKDIR),$$(TTKDIR) $(XLIBDIR),$$(XLIBDIR) \ - $(BITMAPDIR),$$(BITMAPDIR) @<< -$(TKOBJS) -<< -!endif - -#--------------------------------------------------------------------- -# Dependency rules -#--------------------------------------------------------------------- - -$(TMP_DIR)\tk.res: \ - $(RCDIR)\buttons.bmp \ - $(RCDIR)\cursor*.cur \ - $(RCDIR)\tk.ico - -!if exist("$(OUT_DIR)\depend.mk") -!include "$(OUT_DIR)\depend.mk" -!message *** Dependency rules in use. -!else -!message *** Dependency rules are not being used. -!endif - -### add a spacer in the output -!message - -#--------------------------------------------------------------------- -# Implicit rules -#--------------------------------------------------------------------- - -{$(XLIBDIR)}.c{$(TMP_DIR)}.obj:: - $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< -$< -<< - -{$(GENERICDIR)}.c{$(TMP_DIR)}.obj:: - $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< -$< -<< - -{$(TTKDIR)}.c{$(TMP_DIR)}.obj:: - $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< -$< -<< - -{$(WINDIR)}.c{$(TMP_DIR)}.obj:: - $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< -$< -<< - -{$(ROOT)\unix}.c{$(TMP_DIR)}.obj:: - $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< -$< -<< - -{$(RCDIR)}.rc{$(TMP_DIR)}.res: - $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" $(TCL_INCLUDES) \ - -d DEBUG=$(DEBUG) -d UNCHECKED=$(UNCHECKED) \ - -d TCL_THREADS=$(TCL_THREADS) \ - -d STATIC_BUILD=$(STATIC_BUILD) \ - $< - -$(TMP_DIR)\tk.res: $(TMP_DIR)\wish.exe.manifest -$(TMP_DIR)\wish.res: $(TMP_DIR)\wish.exe.manifest - -.SUFFIXES: -.SUFFIXES:.c .rc - - -#--------------------------------------------------------------------- -# Installation. -#--------------------------------------------------------------------- - -install-binaries: - @echo installing binaries - @$(CPY) "$(WISH)" "$(BIN_INSTALL_DIR)\" -!if $(TKLIB) != $(TKIMPLIB) - @$(CPY) "$(TKLIB)" "$(BIN_INSTALL_DIR)\" -!endif - @$(CPY) "$(TKIMPLIB)" "$(LIB_INSTALL_DIR)\" - @$(CPY) "$(TKSTUBLIB)" "$(LIB_INSTALL_DIR)\" -!if !$(STATIC_BUILD) - @echo creating package index - @type << > $(OUT_DIR)\pkgIndex.tcl -if {[catch {package present Tcl $(TK_DOTVERSION).0}]} { return } -if {($$::tcl_platform(platform) eq "unix") && ([info exists ::env(DISPLAY)] - || ([info exists ::argv] && ("-display" in $$::argv)))} { - package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin libtk$(TK_DOTVERSION).dll] Tk] -} else { - package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin $(TKLIBNAME)] Tk] -} -<< - @$(CPY) $(OUT_DIR)\pkgIndex.tcl "$(SCRIPT_INSTALL_DIR)\" -!endif - -#" - -install-libraries: - @echo installing Tk headers - @$(CPY) "$(GENERICDIR)\tk.h" "$(INCLUDE_INSTALL_DIR)\" - @$(CPY) "$(GENERICDIR)\tkDecls.h" "$(INCLUDE_INSTALL_DIR)\" - @$(CPY) "$(GENERICDIR)\tkPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\" - @$(CPY) "$(GENERICDIR)\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)\" - @$(CPY) "$(XLIBDIR)\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11\" - @echo installing script library - @$(CPY) "$(ROOT)\library\*" "$(SCRIPT_INSTALL_DIR)\" - @echo installing theme library - @$(CPY) "$(ROOT)\library\ttk\*" "$(SCRIPT_INSTALL_DIR)\ttk\" - @echo installing demos - @$(CPY) "$(ROOT)\library\demos\*" "$(SCRIPT_INSTALL_DIR)\demos\" - @$(CPY) "$(ROOT)\library\demos\images\*" "$(SCRIPT_INSTALL_DIR)\demos\images\" - @echo installing images - @$(CPY) "$(ROOT)\library\images\*" "$(SCRIPT_INSTALL_DIR)\images\" - @echo installing language files - @$(CPY) "$(ROOT)\library\msgs\*" "$(SCRIPT_INSTALL_DIR)\msgs\" - -#" - -#--------------------------------------------------------------------- -# Clean up -#--------------------------------------------------------------------- - -tidy: -!if $(TKLIB) != $(TKIMPLIB) - @echo Removing $(TKLIB) ... - @if exist $(TKLIB) del $(TKLIB) -!endif - @echo Removing $(TKIMPLIB) ... - @if exist $(TKIMPLIB) del $(TKIMPLIB) - @echo Removing $(WISH) ... - @if exist $(WISH) del $(WISH) - @echo Removing $(TKTEST) ... - @if exist $(TKTEST) del $(TKTEST) - @echo Removing $(TKSTUBLIB) ... - @if exist $(TKSTUBLIB) del $(TKSTUBLIB) - -clean: - @echo Cleaning $(TMP_DIR)\* ... - @if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR) - @echo Cleaning $(WINDIR)\nmakehlp.obj ... - @if exist $(WINDIR)\nmakehlp.obj del $(WINDIR)\nmakehlp.obj - @echo Cleaning $(WINDIR)\nmakehlp.exe ... - @if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe - @echo Cleaning $(WINDIR)\_junk.pch ... - @if exist $(WINDIR)\_junk.pch del $(WINDIR)\_junk.pch - @echo Cleaning $(WINDIR)\vercl.x ... - @if exist $(WINDIR)\vercl.x del $(WINDIR)\vercl.x - @echo Cleaning $(WINDIR)\vercl.i ... - @if exist $(WINDIR)\vercl.i del $(WINDIR)\vercl.i - @echo Cleaning $(WINDIR)\versions.vc ... - @if exist $(WINDIR)\versions.vc del $(WINDIR)\versions.vc - -realclean: hose - -hose: - @echo Hosing $(OUT_DIR)\* ... - @if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR) +#------------------------------------------------------------- -*- makefile -*- +# makefile.vc -- +# +# Microsoft Visual C++ makefile for use with nmake.exe v1.62+ (VC++ 5.0+) +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# Copyright (c) 1995-1996 Sun Microsystems, Inc. +# Copyright (c) 1998-2000 Ajuba Solutions. +# Copyright (c) 2001-2005 ActiveState Corporation. +# Copyright (c) 2001-2004 David Gravereaux. +# Copyright (c) 2003-2008 Pat Thoyts. +#------------------------------------------------------------------------------ + +# Check to see we are configured to build with MSVC (MSDEVDIR, MSVCDIR or +# VCINSTALLDIR) or with the MS Platform SDK (MSSDK or WindowsSDKDir) +!if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(VCINSTALLDIR) && !defined(MSSDK) && !defined(WINDOWSSDKDIR) +MSG = ^ +You need to run vcvars32.bat from Developer Studio or setenv.bat from the^ +Platform SDK first to setup the environment. Jump to this line to read^ +the build instructions. +!error $(MSG) +!endif + +#------------------------------------------------------------------------------ +# HOW TO USE this makefile: +# +# 1) It is now necessary to have MSVCDir, MSDevDir or MSSDK set in the +# environment. This is used as a check to see if vcvars32.bat had been +# run prior to running nmake or during the installation of Microsoft +# Visual C++, MSVCDir had been set globally and the PATH adjusted. +# Either way is valid. +# +# You'll need to run vcvars32.bat contained in the MsDev's vc(98)/bin +# directory to setup the proper environment, if needed, for your +# current setup. This is a needed bootstrap requirement and allows the +# swapping of different environments to be easier. +# +# 2) To use the Platform SDK (not expressly needed), run setenv.bat after +# vcvars32.bat according to the instructions for it. This can also +# turn on the 64-bit compiler, if your SDK has it. +# +# 3) Targets are: +# release -- Builds the core, the shell. (default) +# dlls -- Just builds the windows extensions. +# shell -- Just builds the shell and the core. +# core -- Only builds the core [tkXX.(dll|lib)]. +# all -- Builds everything. +# test -- Builds and runs the test suite. +# tktest -- Just builds the binaries for the test suite. +# install -- Installs the built binaries and libraries to $(INSTALLDIR) +# as the root of the install tree. +# cwish -- Builds a console version of wish. +# tidy/clean/hose -- varying levels of cleaning. +# genstubs -- Rebuilds the Stubs table and support files (dev only). +# depend -- Generates an accurate set of source dependancies for this +# makefile. Helpful to avoid problems when the sources are +# refreshed and you rebuild, but can "overbuild" when common +# headers like tkInt.h just get small changes. +# htmlhelp -- Builds a Windows .chm help file for Tcl and Tk from the +# troff manual pages found in $(ROOT)\doc. You need to +# have installed the HTML Help Compiler package from Microsoft +# to produce the .chm file. +# winhelp -- Builds the windows .hlp file for Tcl from the troff man +# files found in $(ROOT)\doc. +# +# 4) Macros usable on the commandline: +# TCLDIR= +# Sets the location for where to find the Tcl headers and +# libraries. The install point is assumed when not specified. +# Tk does need the source directory, though. Tk comes very close +# to not needing the sources, but does, in fact, require them. +# +# INSTALLDIR= +# Sets where to install Tcl from the built binaries. +# C:\Progra~1\Tcl is assumed when not specified. +# +# OPTS=loimpact,msvcrt,nothreads,noxp,pdbs,profile,square,static,staticpkg,symbols,unchecked,none +# Sets special options for the core. The default is for none. +# Any combination of the above may be used (comma separated). +# 'none' will over-ride everything to nothing. +# +# loimpact = Adds a flag for how NT treats the heap to keep memory +# in use, low. This is said to impact alloc performance. +# msvcrt = Affects the static option only to switch it from +# using libcmt(d) as the C runtime [by default] to +# msvcrt(d). This is useful for static embedding +# support. +# nothreads= Turns off full multithreading support. +# noxp = If you do not have the uxtheme.h header then you +# cannot include support for XP themeing. +# square = Include the demo square widget. +# static = Builds a static library of the core instead of a +# dll. The shell will be static (and large), as well. +# staticpkg= Affects the static option only to switch wishXX.exe +# to have the dde and reg extension linked inside it. +# pdbs = Build detached symbols for release builds. +# profile = Adds profiling hooks. Map file is assumed. +# thrdalloc = Use the thread allocator (shared global free pool) +# This is the default on threaded builds. +# tclalloc = Use the old non-thread allocator +# symbols = Debug build. Links to the debug C runtime, disables +# optimizations and creates pdb symbols files. +# unchecked = Allows a symbols build to not use the debug +# enabled runtime (msvcrt.dll not msvcrtd.dll +# or libcmt.lib not libcmtd.lib). +# +# STATS=compdbg,memdbg,none +# Sets optional memory and bytecode compiler debugging code added +# to the core. The default is for none. Any combination of the +# above may be used (comma separated). 'none' will over-ride +# everything to nothing. +# +# compdbg = Enables byte compilation logging. +# memdbg = Enables the debugging memory allocator. +# +# CHECKS=64bit,fullwarn,nodep,none +# Sets special macros for checking compatability. +# +# 64bit = Enable 64bit portability warnings (if available) +# fullwarn = Builds with full compiler and link warnings enabled. +# Very verbose. +# nodep = Turns off compatability macros to ensure the core +# isn't being built with deprecated functions. +# +# MACHINE=(ALPHA|AMD64|IA64|IX86) +# Set the machine type used for the compiler, linker, and +# resource compiler. This hook is needed to tell the tools +# when alternate platforms are requested. IX86 is the default +# when not specified. If the CPU environment variable has been +# set (ie: recent Platform SDK) then MACHINE is set from CPU. +# +# TMP_DIR= +# OUT_DIR= +# Hooks to allow the intermediate and output directories to be +# changed. $(OUT_DIR) is assumed to be +# $(BINROOT)\(Release|Debug) based on if symbols are requested. +# $(TMP_DIR) will de $(OUT_DIR)\ by default. +# +# TESTPAT= +# Reads the tests requested to be run from this file. +# +# 5) Examples: +# +# Basic syntax of calling nmake looks like this: +# nmake [-nologo] -f makefile.vc [target|macrodef [target|macrodef] [...]] +# +# Standard (no frills) +# c:\tk_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat +# Setting environment for using Microsoft Visual C++ tools. +# c:\tk_src\win\>nmake -f makefile.vc release +# c:\tk_src\win\>nmake -f makefile.vc install INSTALLDIR=c:\progra~1\tcl +# +# Building for Win64 +# c:\tk_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat +# Setting environment for using Microsoft Visual C++ tools. +# c:\tk_src\win\>c:\progra~1\platfo~1\setenv.bat /pre64 /RETAIL +# Targeting Windows pre64 RETAIL +# c:\tk_src\win\>nmake -f makefile.vc MACHINE=IA64 +# +#------------------------------------------------------------------------------ +#============================================================================== +############################################################################### + + +# //==================================================================\\ +# >>[ -> Do not modify below this line. <- ]<< +# >>[ Please, use the commandline macros to modify how Tcl is built. ]<< +# >>[ If you need more features, send us a patch for more macros. ]<< +# \\==================================================================// + + +############################################################################### +#============================================================================== +#------------------------------------------------------------------------------ + +!if !exist("makefile.vc") +MSG = ^ +You must run this makefile only from the directory it is in.^ +Please `cd` to its location first. +!error $(MSG) +!endif + +PROJECT = tk +!include "rules.vc" + +!if $(TCLINSTALL) +!message *** Warning: Tk requires the source distribution of Tcl to build from, +!message *** at this time, sorry. Please set the TCLDIR macro to point to the +!message *** Tcl sources. +!endif + +# Extra makefile options processing... +!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"] +HAVE_UXTHEME_H = 1 +TTK_SQUARE_WIDGET = 0 +!else +!if [nmakehlp -f $(OPTS) "noxp"] +!message *** Exclude support for XP theme +HAVE_UXTHEME_H = 0 +!else +HAVE_UXTHEME_H = 1 +!endif +!if [nmakehlp -f "$(OPTS)" "square"] +!message *** Include ttk square demo widget +TTK_SQUARE_WIDGET = 1 +!else +TTK_SQUARE_WIDGET = 0 +!endif +!endif + +STUBPREFIX = $(PROJECT)stub +WISHNAMEPREFIX = wish + +BINROOT = $(MAKEDIR) # originally . +ROOT = $(MAKEDIR)\.. # originally .. + +TK_LIBRARY = $(ROOT)\library + +TKIMPLIB = "$(OUT_DIR)\$(PROJECT)$(TK_VERSION)$(SUFX).lib" +TKLIBNAME = $(PROJECT)$(TK_VERSION)$(SUFX).$(EXT) +TKLIB = "$(OUT_DIR)\$(TKLIBNAME)" + +TKSTUBLIBNAME = $(STUBPREFIX)$(TK_VERSION).lib +TKSTUBLIB = "$(OUT_DIR)\$(TKSTUBLIBNAME)" + +WISH = "$(OUT_DIR)\$(WISHNAMEPREFIX)$(TK_VERSION)$(SUFX).exe" +WISHC = "$(OUT_DIR)\$(WISHNAMEPREFIX)c$(TK_VERSION)$(SUFX).exe" + +TKTEST = "$(OUT_DIR)\$(PROJECT)test.exe" +CAT32 = "$(OUT_DIR)\cat32.exe" + +LIB_INSTALL_DIR = $(_INSTALLDIR)\lib +BIN_INSTALL_DIR = $(_INSTALLDIR)\bin +DOC_INSTALL_DIR = $(_INSTALLDIR)\doc +SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TK_DOTVERSION) +INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\include + +WISHOBJS = \ + $(TMP_DIR)\winMain.obj \ +!if $(TCL_USE_STATIC_PACKAGES) + $(TCLDDELIB) \ + $(TCLREGLIB) \ +!endif + $(TMP_DIR)\wish.res + +TKTESTOBJS = \ + $(TMP_DIR)\testMain.obj \ + $(TMP_DIR)\tkSquare.obj \ + $(TMP_DIR)\tkTest.obj \ + $(TMP_DIR)\tkOldTest.obj \ + $(TMP_DIR)\tkWinTest.obj + +XLIBOBJS = \ + $(TMP_DIR)\xcolors.obj \ + $(TMP_DIR)\xdraw.obj \ + $(TMP_DIR)\xgc.obj \ + $(TMP_DIR)\ximage.obj \ + $(TMP_DIR)\xutil.obj + +TKOBJS = \ + $(TMP_DIR)\tkConsole.obj \ + $(TMP_DIR)\tkUnixMenubu.obj \ + $(TMP_DIR)\tkUnixScale.obj \ + $(XLIBOBJS) \ + $(TMP_DIR)\tkWin3d.obj \ + $(TMP_DIR)\tkWin32Dll.obj \ + $(TMP_DIR)\tkWinButton.obj \ + $(TMP_DIR)\tkWinClipboard.obj \ + $(TMP_DIR)\tkWinColor.obj \ + $(TMP_DIR)\tkWinConfig.obj \ + $(TMP_DIR)\tkWinCursor.obj \ + $(TMP_DIR)\tkWinDialog.obj \ + $(TMP_DIR)\tkWinDraw.obj \ + $(TMP_DIR)\tkWinEmbed.obj \ + $(TMP_DIR)\tkWinFont.obj \ + $(TMP_DIR)\tkWinImage.obj \ + $(TMP_DIR)\tkWinInit.obj \ + $(TMP_DIR)\tkWinKey.obj \ + $(TMP_DIR)\tkWinMenu.obj \ + $(TMP_DIR)\tkWinPixmap.obj \ + $(TMP_DIR)\tkWinPointer.obj \ + $(TMP_DIR)\tkWinRegion.obj \ + $(TMP_DIR)\tkWinScrlbr.obj \ + $(TMP_DIR)\tkWinSend.obj \ + $(TMP_DIR)\tkWinSendCom.obj \ + $(TMP_DIR)\tkWinWindow.obj \ + $(TMP_DIR)\tkWinWm.obj \ + $(TMP_DIR)\tkWinX.obj \ + $(TMP_DIR)\stubs.obj \ + $(TMP_DIR)\tk3d.obj \ + $(TMP_DIR)\tkArgv.obj \ + $(TMP_DIR)\tkAtom.obj \ + $(TMP_DIR)\tkBind.obj \ + $(TMP_DIR)\tkBitmap.obj \ + $(TMP_DIR)\tkButton.obj \ + $(TMP_DIR)\tkCanvArc.obj \ + $(TMP_DIR)\tkCanvBmap.obj \ + $(TMP_DIR)\tkCanvImg.obj \ + $(TMP_DIR)\tkCanvLine.obj \ + $(TMP_DIR)\tkCanvPoly.obj \ + $(TMP_DIR)\tkCanvPs.obj \ + $(TMP_DIR)\tkCanvText.obj \ + $(TMP_DIR)\tkCanvUtil.obj \ + $(TMP_DIR)\tkCanvWind.obj \ + $(TMP_DIR)\tkCanvas.obj \ + $(TMP_DIR)\tkClipboard.obj \ + $(TMP_DIR)\tkCmds.obj \ + $(TMP_DIR)\tkColor.obj \ + $(TMP_DIR)\tkConfig.obj \ + $(TMP_DIR)\tkCursor.obj \ + $(TMP_DIR)\tkEntry.obj \ + $(TMP_DIR)\tkError.obj \ + $(TMP_DIR)\tkEvent.obj \ + $(TMP_DIR)\tkFileFilter.obj \ + $(TMP_DIR)\tkFocus.obj \ + $(TMP_DIR)\tkFont.obj \ + $(TMP_DIR)\tkFrame.obj \ + $(TMP_DIR)\tkGC.obj \ + $(TMP_DIR)\tkGeometry.obj \ + $(TMP_DIR)\tkGet.obj \ + $(TMP_DIR)\tkGrab.obj \ + $(TMP_DIR)\tkGrid.obj \ + $(TMP_DIR)\tkImage.obj \ + $(TMP_DIR)\tkImgBmap.obj \ + $(TMP_DIR)\tkImgGIF.obj \ + $(TMP_DIR)\tkImgPPM.obj \ + $(TMP_DIR)\tkImgPhoto.obj \ + $(TMP_DIR)\tkImgUtil.obj \ + $(TMP_DIR)\tkListbox.obj \ + $(TMP_DIR)\tkMacWinMenu.obj \ + $(TMP_DIR)\tkMain.obj \ + $(TMP_DIR)\tkMenu.obj \ + $(TMP_DIR)\tkMenubutton.obj \ + $(TMP_DIR)\tkMenuDraw.obj \ + $(TMP_DIR)\tkMessage.obj \ + $(TMP_DIR)\tkPanedWindow.obj \ + $(TMP_DIR)\tkObj.obj \ + $(TMP_DIR)\tkOldConfig.obj \ + $(TMP_DIR)\tkOption.obj \ + $(TMP_DIR)\tkPack.obj \ + $(TMP_DIR)\tkPlace.obj \ + $(TMP_DIR)\tkPointer.obj \ + $(TMP_DIR)\tkRectOval.obj \ + $(TMP_DIR)\tkScale.obj \ + $(TMP_DIR)\tkScrollbar.obj \ + $(TMP_DIR)\tkSelect.obj \ + $(TMP_DIR)\tkStyle.obj \ + $(TMP_DIR)\tkText.obj \ + $(TMP_DIR)\tkTextBTree.obj \ + $(TMP_DIR)\tkTextDisp.obj \ + $(TMP_DIR)\tkTextImage.obj \ + $(TMP_DIR)\tkTextIndex.obj \ + $(TMP_DIR)\tkTextMark.obj \ + $(TMP_DIR)\tkTextTag.obj \ + $(TMP_DIR)\tkTextWind.obj \ + $(TMP_DIR)\tkTrig.obj \ + $(TMP_DIR)\tkUndo.obj \ + $(TMP_DIR)\tkUtil.obj \ + $(TMP_DIR)\tkVisual.obj \ + $(TMP_DIR)\tkStubInit.obj \ + $(TMP_DIR)\tkWindow.obj \ + $(TTK_OBJS) \ +!if !$(STATIC_BUILD) + $(TMP_DIR)\tk.res +!endif + +TTK_OBJS = \ + $(TMP_DIR)\ttkWinMonitor.obj \ + $(TMP_DIR)\ttkWinTheme.obj \ + $(TMP_DIR)\ttkWinXPTheme.obj \ + $(TMP_DIR)\ttkBlink.obj \ + $(TMP_DIR)\ttkButton.obj \ + $(TMP_DIR)\ttkCache.obj \ + $(TMP_DIR)\ttkClamTheme.obj \ + $(TMP_DIR)\ttkClassicTheme.obj \ + $(TMP_DIR)\ttkDefaultTheme.obj \ + $(TMP_DIR)\ttkElements.obj \ + $(TMP_DIR)\ttkEntry.obj \ + $(TMP_DIR)\ttkFrame.obj \ + $(TMP_DIR)\ttkImage.obj \ + $(TMP_DIR)\ttkInit.obj \ + $(TMP_DIR)\ttkLabel.obj \ + $(TMP_DIR)\ttkLayout.obj \ + $(TMP_DIR)\ttkManager.obj \ + $(TMP_DIR)\ttkNotebook.obj \ + $(TMP_DIR)\ttkPanedwindow.obj \ + $(TMP_DIR)\ttkProgress.obj \ + $(TMP_DIR)\ttkScale.obj \ + $(TMP_DIR)\ttkScrollbar.obj \ + $(TMP_DIR)\ttkScroll.obj \ + $(TMP_DIR)\ttkSeparator.obj \ + $(TMP_DIR)\ttkSquare.obj \ + $(TMP_DIR)\ttkState.obj \ + $(TMP_DIR)\ttkTagSet.obj \ + $(TMP_DIR)\ttkTheme.obj \ + $(TMP_DIR)\ttkTrace.obj \ + $(TMP_DIR)\ttkTrack.obj \ + $(TMP_DIR)\ttkTreeview.obj \ + $(TMP_DIR)\ttkWidget.obj \ + $(TMP_DIR)\ttkStubInit.obj + +TKSTUBOBJS = \ + $(TMP_DIR)\tkStubLib.obj \ + $(TMP_DIR)\ttkStubLib.obj + + +WINDIR = $(ROOT)\win +GENERICDIR = $(ROOT)\generic +XLIBDIR = $(ROOT)\xlib +TTKDIR = $(ROOT)\generic\ttk +BITMAPDIR = $(ROOT)\bitmaps +DOCDIR = $(ROOT)\doc +RCDIR = $(WINDIR)\rc + +TK_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)" -I"$(BITMAPDIR)" -I"$(XLIBDIR)" \ + $(TCL_INCLUDES) + +CONFIG_DEFS =-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 \ + -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 \ + -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 \ + -DSUPPORT_CONFIG_EMBEDDED \ +!if $(HAVE_UXTHEME_H) + -DHAVE_UXTHEME_H=1 \ +!endif +!if $(TTK_SQUARE_WIDGET) + -DTTK_SQUARE_WIDGET=1 \ +!endif + +TK_DEFINES =-DBUILD_ttk $(OPTDEFINES) $(CONFIG_DEFS) -Dinline=__inline + +#--------------------------------------------------------------------- +# Compile flags +#--------------------------------------------------------------------- + +!if !$(DEBUG) +!if $(OPTIMIZING) +### This cranks the optimization level to maximize speed +### We can't use -O2 because sometimes it causes problems. +cdebug = $(OPTIMIZATIONS) +!else +cdebug = +!endif +!if $(SYMBOLS) +cdebug = $(cdebug) -Zi +!endif +!else if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" +### Warnings are too many, can't support warnings into errors. +cdebug = -Zi -Od $(DEBUGFLAGS) +!else +cdebug = -Zi -WX $(DEBUGFLAGS) +!endif + +### Declarations common to all compiler options +cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE +cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\ + +!if $(MSVCRT) +!if $(DEBUG) && !$(UNCHECKED) +crt = -MDd +!else +crt = -MD +!endif +!else +!if $(DEBUG) && !$(UNCHECKED) +crt = -MTd +!else +crt = -MT +!endif +!endif + +BASE_CFLAGS = $(cdebug) $(cflags) $(crt) $(TK_INCLUDES) +TK_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) -DUSE_TCL_STUBS +CON_CFLAGS = $(cdebug) $(cflags) $(crt) -DCONSOLE +WISH_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) +STUB_CFLAGS = $(cflags) $(cdebug) $(TK_DEFINES) + +#--------------------------------------------------------------------- +# Link flags +#--------------------------------------------------------------------- + +!if $(DEBUG) +ldebug = -debug -debugtype:cv +!else +ldebug = -release -opt:ref -opt:icf,3 +!if $(SYMBOLS) +ldebug = $(ldebug) -debug -debugtype:cv +!endif +!endif + +### Declarations common to all linker options +lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) + +!if $(PROFILE) +lflags = $(lflags) -profile +!endif + +!if $(ALIGN98_HACK) && !$(STATIC_BUILD) +### Align sections for PE size savings. +lflags = $(lflags) -opt:nowin98 +!else if !$(ALIGN98_HACK) && $(STATIC_BUILD) +### Align sections for speed in loading by choosing the virtual page size. +lflags = $(lflags) -align:4096 +!endif + +!if $(LOIMPACT) +lflags = $(lflags) -ws:aggressive +!endif + +dlllflags = $(lflags) -dll +conlflags = $(lflags) -subsystem:console +guilflags = $(lflags) -subsystem:windows + +baselibs = kernel32.lib user32.lib +# Avoid 'unresolved external symbol __security_cookie' errors. +# c.f. http://support.microsoft.com/?id=894573 +!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" +!if $(VCVERSION) > 1399 && $(VCVERSION) < 1500 +baselibs = $(baselibs) bufferoverflowU.lib +!endif +!endif +guilibs = $(baselibs) gdi32.lib + + +#--------------------------------------------------------------------- +# TkTest flags +#--------------------------------------------------------------------- + +!if "$(TESTPAT)" != "" +TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) +!endif + + +#--------------------------------------------------------------------- +# Project specific targets +#--------------------------------------------------------------------- + +release: setup $(TKSTUBLIB) $(WISH) +all: release $(CAT32) +core: setup $(TKSTUBLIB) $(TKLIB) +cwish: $(WISHC) +install: install-binaries install-libraries install-docs +tktest: setup $(TKTEST) $(CAT32) + + +test: test-classic test-ttk + +test-classic: setup $(TKTEST) $(TKLIB) $(CAT32) + @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) + @set TK_LIBRARY=$(TK_LIBRARY:\=/) + @set TCLLIBPATH= +!if $(TCLINSTALL) + @set PATH=$(_TCLDIR)\bin;$(PATH) +!else + @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) +!endif +!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" + $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) | $(CAT32) +!else + $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) > tests.log + type tests.log | more +!endif + +test-ttk: setup $(TKTEST) $(TKLIB) $(CAT32) + @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) + @set TK_LIBRARY=$(TK_LIBRARY:\=/) + @set TCLLIBPATH= +!if $(TCLINSTALL) + @set PATH=$(_TCLDIR)\bin;$(PATH) +!else + @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) +!endif +!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" + $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32) +!else + $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/ttk/all.tcl" $(TESTFLAGS) > tests.log + type tests.log | more +!endif + +runtest: setup $(TKTEST) $(TKLIB) $(CAT32) + @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) + @set TK_LIBRARY=$(TK_LIBRARY:\=/) + @set TCLLIBPATH= +!if $(TCLINSTALL) + @set PATH=$(_TCLDIR)\bin;$(PATH) +!else + @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) +!endif + $(DEBUGGER) $(TKTEST) + +rundemo: setup $(TKTEST) $(TKLIB) $(CAT32) + @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) + @set TK_LIBRARY=$(TK_LIBRARY:\=/) + @set TCLLIBPATH= +!if $(TCLINSTALL) + @set PATH=$(_TCLDIR)\bin;$(PATH) +!else + @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) +!endif + $(TKTEST) $(ROOT:\=/)\library\demos\widget + +shell: setup $(WISH) + @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) + @set TK_LIBRARY=$(TK_LIBRARY:\=/) + @set TCLLIBPATH= +!if $(TCLINSTALL) + @set PATH=$(_TCLDIR)\bin;$(PATH) +!else + @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) +!endif + $(DEBUGGER) $(WISH) << + console show +<< + +dbgshell: setup $(WISH) + @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) + @set TK_LIBRARY=$(TK_LIBRARY:\=/) + @set TCLLIBPATH= +!if $(TCLINSTALL) + @set PATH=$(_TCLDIR)\bin;$(PATH) +!else + @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) +!endif + windbg $(WISH) + +setup: + @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) + @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) + +!if !$(STATIC_BUILD) +$(TKIMPLIB): $(TKLIB) +!endif + +$(TKLIB): $(TKOBJS) +!if $(STATIC_BUILD) + $(lib32) -nologo -out:$@ @<< +$** +<< +!else + $(link32) $(dlllflags) -base:@$(COFFBASE),tk -out:$@ $(guilibs) \ + $(TCLSTUBLIB) @<< +$** +<< + $(_VC_MANIFEST_EMBED_DLL) + -@del $*.exp +!endif + + +$(TKSTUBLIB): $(TKSTUBOBJS) + $(lib32) -nologo -nodefaultlib -out:$@ $** + + +$(WISH): $(WISHOBJS) $(TKIMPLIB) + $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** + $(_VC_MANIFEST_EMBED_EXE) + + +$(WISHC): $(WISHOBJS) $(TKIMPLIB) + $(link32) $(conlflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** + $(_VC_MANIFEST_EMBED_EXE) + + +$(TKTEST): $(TKTESTOBJS) $(TKIMPLIB) + $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** + $(_VC_MANIFEST_EMBED_EXE) + + +$(CAT32): $(_TCLDIR)\win\cat.c + $(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $? + $(link32) $(conlflags) -out:$@ -stack:16384 $(TMP_DIR)\cat.obj $(baselibs) + $(_VC_MANIFEST_EMBED_EXE) + +#--------------------------------------------------------------------- +# Regenerate the stubs files. [Development use only] +#--------------------------------------------------------------------- + +genstubs: +!if !exist($(TCLSH)) + @echo Build tclsh first! +!else + set TCL_LIBRARY=$(TCL_LIBRARY) + $(TCLSH) $(_TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \ + $(GENERICDIR)\$(PROJECT).decls $(GENERICDIR)\$(PROJECT)Int.decls +!endif + + +#--------------------------------------------------------------------- +# Build the Windows HTML help file. +#--------------------------------------------------------------------- + +# NOTE: you can define HHC on the command-line to override this +!ifndef HHC +HHC=""%ProgramFiles%\HTML Help Workshop\hhc.exe"" +!endif +HTMLDIR=$(ROOT)\html +HTMLBASE=TclTk$(VERSION) +HHPFILE=$(HTMLDIR)\$(HTMLBASE).hhp +CHMFILE=$(HTMLDIR)\$(HTMLBASE).chm + +htmlhelp: chmsetup $(CHMFILE) + +$(CHMFILE): $(DOCDIR)\* + @$(TCLSH) $(TCLTOOLSDIR)\tcltk-man2html.tcl + @echo Compiling HTML help project + @$(HHC) <<$(HHPFILE) >NUL +[OPTIONS] +Compatibility=1.1 or later +Compiled file=$(HTMLBASE).chm +Display compile progress=no +Error log file=$(HTMLBASE).log +Language=0x409 English (United States) +Title=Tcl/Tk $(DOT_VERSION) Help +[FILES] +contents.htm +docs.css +Keywords +TclCmd +TclLib +TkCmd +TkLib +UserCmd +<< + +chmsetup: + @if not exist $(HTMLDIR)\nul mkdir $(HTMLDIR) + +#------------------------------------------------------------------------- +# Build the old-style Windows .hlp file +#------------------------------------------------------------------------- + +HLPBASE = $(PROJECT)$(TK_VERSION) +HELPFILE = $(OUT_DIR)\$(HLPBASE).hlp +HELPCNT = $(OUT_DIR)\$(HLPBASE).cnt +DOCTMP_DIR = $(OUT_DIR)\$(PROJECT)_docs +HELPRTF = $(DOCTMP_DIR)\$(PROJECT).rtf +MAN2HELP = $(DOCTMP_DIR)\man2help.tcl +MAN2HELP2 = $(DOCTMP_DIR)\man2help2.tcl +INDEX = $(DOCTMP_DIR)\index.tcl +BMP = $(DOCTMP_DIR)\lamp.bmp +BMP_NOPATH = lamp.bmp +MAN2TCL = $(DOCTMP_DIR)\man2tcl.exe + +winhelp: docsetup $(HELPFILE) + +docsetup: + @if not exist $(DOCTMP_DIR)\nul mkdir $(DOCTMP_DIR) + +$(MAN2HELP) $(MAN2HELP2) $(INDEX): $(TCLTOOLSDIR)\$$(@F) + $(CPY) $(TCLTOOLSDIR)\$(@F) $(@D) + +$(BMP): + $(CPY) $(WINDIR)\rc\$(@F) $(@D) + +$(HELPFILE): $(HELPRTF) $(BMP) + cd $(DOCTMP_DIR) + start /wait hcrtf.exe -x <<$(PROJECT).hpj +[OPTIONS] +COMPRESS=12 Hall Zeck +LCID=0x409 0x0 0x0 ; English (United States) +TITLE=Tk Reference Manual +BMROOT=. +CNT=$(@B).cnt +HLP=$(@B).hlp + +[FILES] +$(PROJECT).rtf + +[WINDOWS] +main="Tcl/Tk Reference Manual",,27648,(r15263976),(r4227327) + +[CONFIG] +BrowseButtons() +CreateButton(1, "Web", ExecFile("http://www.tcl.tk")) +CreateButton(2, "SF", ExecFile("http://sf.net/projects/tcl")) +CreateButton(3, "Wiki", ExecFile("http://wiki.tcl.tk")) +CreateButton(4, "FAQ", ExecFile("http://www.purl.org/NET/Tcl-FAQ/")) +<< + cd $(MAKEDIR) + @$(CPY) "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)" + @$(CPY) "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)" + +$(MAN2TCL): $(TCLTOOLSDIR)\$$(@B).c + $(cc32) $(TK_CFLAGS) -Fo$(@D)\ $(TCLTOOLSDIR)\$(@B).c + $(link32) $(conlflags) -out:$@ -stack:16384 $(@D)\man2tcl.obj + $(_VC_MANIFEST_EMBED_EXE) + +$(HELPRTF): $(MAN2TCL) $(MAN2HELP) $(MAN2HELP2) $(INDEX) + $(TCLSH) $(MAN2HELP) -bitmap $(BMP_NOPATH) $(PROJECT) $(TK_VERSION) $(DOCDIR:\=/) + +install-docs: +!if exist($(HELPFILE)) + $(CPY) "$(HELPFILE)" "$(DOC_INSTALL_DIR)\" + $(CPY) "$(HELPCNT)" "$(DOC_INSTALL_DIR)\" + $(TCLSH) << +puts "Installing $(PROJECT)'s helpfile contents into Tcl's ..." +set f [open "$(DOC_INSTALL_DIR:\=/)/tcl$(TK_VERSION).cnt" r] +while {![eof $$f]} { + if {[regexp {:Include $(PROJECT)([0-9]{2}).cnt} [gets $$f] dummy ver]} { + if {$$ver == $(TK_VERSION)} { + puts "Already installed." + exit + } else { + # do something here logical to remove (or replace) it. + puts "$$ver != $(TK_VERSION), unfinished code path, die, die!" + exit 1 + } + } +} +close $$f +set f [open "$(DOC_INSTALL_DIR:\=/)/tcl$(TK_VERSION).cnt" a] +puts $$f {:Include $(HLPBASE).cnt} +close $$f +<< + start /wait winhlp32 -g $(DOC_INSTALL_DIR)\tcl$(TK_VERSION).hlp +!endif + +#--------------------------------------------------------------------- +# Special case object file targets +#--------------------------------------------------------------------- + +$(TMP_DIR)\testMain.obj: $(WINDIR)\winMain.c + $(cc32) $(WISH_CFLAGS) -DTK_TEST \ + -DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \ + -Fo$@ $? + +$(TMP_DIR)\tkTest.obj: $(GENERICDIR)\tkTest.c + $(cc32) $(WISH_CFLAGS) -Fo$@ $? + +$(TMP_DIR)\tkOldTest.obj: $(GENERICDIR)\tkOldTest.c + $(cc32) $(WISH_CFLAGS) -Fo$@ $? + +$(TMP_DIR)\tkWinTest.obj: $(WINDIR)\tkWinTest.c + $(cc32) $(WISH_CFLAGS) -Fo$@ $? + +$(TMP_DIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c + $(cc32) $(WISH_CFLAGS) -Fo$@ $? + +$(TMP_DIR)\winMain.obj: $(WINDIR)\winMain.c + $(cc32) $(WISH_CFLAGS) \ + -DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \ + -Fo$@ $? + +# The following objects are part of the stub library and should not +# be built as DLL objects but none of the symbols should be exported +# and no reference made to a C runtime. + +$(TMP_DIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c + $(cc32) $(STUB_CFLAGS) $(TK_INCLUDES) -Zl -DSTATIC_BUILD -Fo$@ $? + + +$(TMP_DIR)\wish.exe.manifest: $(WINDIR)\wish.exe.manifest.in + @nmakehlp -s << $** >$@ +@MACHINE@ $(MACHINE:IX86=X86) +@TK_WIN_VERSION@ $(TK_DOTVERSION).0.0 +<< + +#--------------------------------------------------------------------- +# Generate the source dependencies. Having dependency rules will +# improve incremental build accuracy without having to resort to a +# full rebuild just because some non-global header file like +# tclCompile.h was changed. These rules aren't needed when building +# from scratch. +#--------------------------------------------------------------------- + +depend: +!if !exist($(TCLSH)) + @echo Build tclsh first! +!else + set TCL_LIBRARY=$(TCL_LIBRARY) + $(TCLSH) $(TCLTOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \ + -passthru:"-DBUILD_tk $(TK_INCLUDES)" $(GENERICDIR),$$(GENERICDIR) \ + $(WINDIR),$$(WINDIR) $(TTKDIR),$$(TTKDIR) $(XLIBDIR),$$(XLIBDIR) \ + $(BITMAPDIR),$$(BITMAPDIR) @<< +$(TKOBJS) +<< +!endif + +#--------------------------------------------------------------------- +# Dependency rules +#--------------------------------------------------------------------- + +$(TMP_DIR)\tk.res: \ + $(RCDIR)\buttons.bmp \ + $(RCDIR)\cursor*.cur \ + $(RCDIR)\tk.ico + +!if exist("$(OUT_DIR)\depend.mk") +!include "$(OUT_DIR)\depend.mk" +!message *** Dependency rules in use. +!else +!message *** Dependency rules are not being used. +!endif + +### add a spacer in the output +!message + +#--------------------------------------------------------------------- +# Implicit rules +#--------------------------------------------------------------------- + +{$(XLIBDIR)}.c{$(TMP_DIR)}.obj:: + $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +{$(GENERICDIR)}.c{$(TMP_DIR)}.obj:: + $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +{$(TTKDIR)}.c{$(TMP_DIR)}.obj:: + $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +{$(WINDIR)}.c{$(TMP_DIR)}.obj:: + $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +{$(ROOT)\unix}.c{$(TMP_DIR)}.obj:: + $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<< +$< +<< + +{$(RCDIR)}.rc{$(TMP_DIR)}.res: + $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" $(TCL_INCLUDES) \ + -d DEBUG=$(DEBUG) -d UNCHECKED=$(UNCHECKED) \ + -d TCL_THREADS=$(TCL_THREADS) \ + -d STATIC_BUILD=$(STATIC_BUILD) \ + $< + +$(TMP_DIR)\tk.res: $(TMP_DIR)\wish.exe.manifest +$(TMP_DIR)\wish.res: $(TMP_DIR)\wish.exe.manifest + +.SUFFIXES: +.SUFFIXES:.c .rc + + +#--------------------------------------------------------------------- +# Installation. +#--------------------------------------------------------------------- + +install-binaries: + @echo installing binaries + @$(CPY) "$(WISH)" "$(BIN_INSTALL_DIR)\" +!if $(TKLIB) != $(TKIMPLIB) + @$(CPY) "$(TKLIB)" "$(BIN_INSTALL_DIR)\" +!endif + @$(CPY) "$(TKIMPLIB)" "$(LIB_INSTALL_DIR)\" + @$(CPY) "$(TKSTUBLIB)" "$(LIB_INSTALL_DIR)\" +!if !$(STATIC_BUILD) + @echo creating package index + @type << > $(OUT_DIR)\pkgIndex.tcl +if {[catch {package present Tcl $(TK_DOTVERSION).0}]} { return } +if {($$::tcl_platform(platform) eq "unix") && ([info exists ::env(DISPLAY)] + || ([info exists ::argv] && ("-display" in $$::argv)))} { + package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin libtk$(TK_DOTVERSION).dll] Tk] +} else { + package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin $(TKLIBNAME)] Tk] +} +<< + @$(CPY) $(OUT_DIR)\pkgIndex.tcl "$(SCRIPT_INSTALL_DIR)\" +!endif + +#" + +install-libraries: + @echo installing Tk headers + @$(CPY) "$(GENERICDIR)\tk.h" "$(INCLUDE_INSTALL_DIR)\" + @$(CPY) "$(GENERICDIR)\tkDecls.h" "$(INCLUDE_INSTALL_DIR)\" + @$(CPY) "$(GENERICDIR)\tkPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\" + @$(CPY) "$(GENERICDIR)\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)\" + @$(CPY) "$(XLIBDIR)\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11\" + @echo installing script library + @$(CPY) "$(ROOT)\library\*" "$(SCRIPT_INSTALL_DIR)\" + @echo installing theme library + @$(CPY) "$(ROOT)\library\ttk\*" "$(SCRIPT_INSTALL_DIR)\ttk\" + @echo installing demos + @$(CPY) "$(ROOT)\library\demos\*" "$(SCRIPT_INSTALL_DIR)\demos\" + @$(CPY) "$(ROOT)\library\demos\images\*" "$(SCRIPT_INSTALL_DIR)\demos\images\" + @echo installing images + @$(CPY) "$(ROOT)\library\images\*" "$(SCRIPT_INSTALL_DIR)\images\" + @echo installing language files + @$(CPY) "$(ROOT)\library\msgs\*" "$(SCRIPT_INSTALL_DIR)\msgs\" + +#" + +#--------------------------------------------------------------------- +# Clean up +#--------------------------------------------------------------------- + +tidy: +!if $(TKLIB) != $(TKIMPLIB) + @echo Removing $(TKLIB) ... + @if exist $(TKLIB) del $(TKLIB) +!endif + @echo Removing $(TKIMPLIB) ... + @if exist $(TKIMPLIB) del $(TKIMPLIB) + @echo Removing $(WISH) ... + @if exist $(WISH) del $(WISH) + @echo Removing $(TKTEST) ... + @if exist $(TKTEST) del $(TKTEST) + @echo Removing $(TKSTUBLIB) ... + @if exist $(TKSTUBLIB) del $(TKSTUBLIB) + +clean: + @echo Cleaning $(TMP_DIR)\* ... + @if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR) + @echo Cleaning $(WINDIR)\nmakehlp.obj ... + @if exist $(WINDIR)\nmakehlp.obj del $(WINDIR)\nmakehlp.obj + @echo Cleaning $(WINDIR)\nmakehlp.exe ... + @if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe + @echo Cleaning $(WINDIR)\_junk.pch ... + @if exist $(WINDIR)\_junk.pch del $(WINDIR)\_junk.pch + @echo Cleaning $(WINDIR)\vercl.x ... + @if exist $(WINDIR)\vercl.x del $(WINDIR)\vercl.x + @echo Cleaning $(WINDIR)\vercl.i ... + @if exist $(WINDIR)\vercl.i del $(WINDIR)\vercl.i + @echo Cleaning $(WINDIR)\versions.vc ... + @if exist $(WINDIR)\versions.vc del $(WINDIR)\versions.vc + +realclean: hose + +hose: + @echo Hosing $(OUT_DIR)\* ... + @if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR) diff --git a/win/mkd.bat b/win/mkd.bat index f741daf..1bd5ccb 100644 --- a/win/mkd.bat +++ b/win/mkd.bat @@ -1,12 +1,12 @@ -@echo off - -if exist %1\nul goto end - -md %1 -if errorlevel 1 goto end - -echo Created directory %1 - -:end - - +@echo off + +if exist %1\nul goto end + +md %1 +if errorlevel 1 goto end + +echo Created directory %1 + +:end + + diff --git a/win/rc/tk_base.rc b/win/rc/tk_base.rc index 3e065c9..e6ab016 100644 --- a/win/rc/tk_base.rc +++ b/win/rc/tk_base.rc @@ -26,12 +26,12 @@ FONT 8, "Helv" BEGIN LTEXT "Directory &name:",-1,8,6,118,9 EDITTEXT edt10,8,26,144,12, WS_TABSTOP | ES_AUTOHSCROLL - LISTBOX lst2,8,40,144,64,LBS_SORT | LBS_OWNERDRAWFIXED | - LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | + LISTBOX lst2,8,40,144,64,LBS_SORT | LBS_OWNERDRAWFIXED | + LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP LTEXT "Dri&ves:",stc4,8,106,92,9 - COMBOBOX cmb2,8,115,144,68,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | + COMBOBOX cmb2,8,115,144,68,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP DEFPUSHBUTTON "OK",1,160,6,50,14,WS_GROUP PUSHBUTTON "Cancel",2,160,24,50,14,WS_GROUP @@ -42,8 +42,8 @@ BEGIN LTEXT "a",stc3,9,143,114,15 EDITTEXT edt1,7,158,135,20,NOT WS_TABSTOP LISTBOX lst1,8,205,134,42,LBS_NOINTEGRALHEIGHT - COMBOBOX cmb1,8,253,135,21,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | - CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | + COMBOBOX cmb1,8,253,135,21,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | + CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL END diff --git a/win/rc/wish.rc b/win/rc/wish.rc index 5cc2fa4..53e02fa 100644 --- a/win/rc/wish.rc +++ b/win/rc/wish.rc @@ -63,7 +63,7 @@ END // // Icon -// +// // The icon whose name or resource ID is lexigraphically first, is used // as the application's icon. // diff --git a/win/rmd.bat b/win/rmd.bat index d260936..820b76f 100644 --- a/win/rmd.bat +++ b/win/rmd.bat @@ -1,20 +1,20 @@ -@echo off - -if not exist %1\nul goto end - -echo Removing directory %1 - -if "%OS%" == "Windows_NT" goto winnt - -deltree /y %1 -if errorlevel 1 goto end -goto success - -:winnt -rmdir /s /q %1 -if errorlevel 1 goto end - -:success -echo Deleted directory %1 - -:end +@echo off + +if not exist %1\nul goto end + +echo Removing directory %1 + +if "%OS%" == "Windows_NT" goto winnt + +deltree /y %1 +if errorlevel 1 goto end +goto success + +:winnt +rmdir /s /q %1 +if errorlevel 1 goto end + +:success +echo Deleted directory %1 + +:end diff --git a/win/rules.vc b/win/rules.vc index dd417c8..a43fac6 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -1,716 +1,716 @@ -#------------------------------------------------------------------------------ -# rules.vc -- -# -# Microsoft Visual C++ makefile include for decoding the commandline -# macros. This file does not need editing to build Tcl. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# Copyright (c) 2001-2003 David Gravereaux. -# Copyright (c) 2003-2008 Patrick Thoyts -#------------------------------------------------------------------------------ - -!ifndef _RULES_VC -_RULES_VC = 1 - -cc32 = $(CC) # built-in default. -link32 = link -lib32 = lib -rc32 = $(RC) # built-in default. - -!ifndef INSTALLDIR -### Assume the normal default. -_INSTALLDIR = C:\Program Files\Tcl -!else -### Fix the path separators. -_INSTALLDIR = $(INSTALLDIR:/=\) -!endif - -#---------------------------------------------------------- -# Set the proper copy method to avoid overwrite questions -# to the user when copying files and selecting the right -# "delete all" method. -#---------------------------------------------------------- - -!if "$(OS)" == "Windows_NT" -RMDIR = rmdir /S /Q -ERRNULL = 2>NUL -!if ![ver | find "4.0" > nul] -CPY = echo y | xcopy /i >NUL -COPY = copy >NUL -!else -CPY = xcopy /i /y >NUL -COPY = copy /y >NUL -!endif -!else # "$(OS)" != "Windows_NT" -CPY = xcopy /i >_JUNK.OUT # On Win98 NUL does not work here. -COPY = copy >_JUNK.OUT # On Win98 NUL does not work here. -RMDIR = deltree /Y -NULL = \NUL # Used in testing directory existence -ERRNULL = >NUL # Win9x shell cannot redirect stderr -!endif -MKDIR = mkdir - -#------------------------------------------------------------------------------ -# Determine the host and target architectures and compiler version. -#------------------------------------------------------------------------------ - -_HASH=^# -_VC_MANIFEST_EMBED_EXE= -_VC_MANIFEST_EMBED_DLL= -VCVER=0 -!if ![echo VCVERSION=_MSC_VER > vercl.x] \ - && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \ - && ![echo ARCH=IX86 >> vercl.x] \ - && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \ - && ![echo ARCH=AMD64 >> vercl.x] \ - && ![echo $(_HASH)endif >> vercl.x] \ - && ![cl -nologo -TC -P vercl.x $(ERRNULL)] -!include vercl.i -!if ![echo VCVER= ^\> vercl.vc] \ - && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc] -!include vercl.vc -!endif -!endif -!if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc] -!endif - -!if ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i x86] -NATIVE_ARCH=IX86 -!else -NATIVE_ARCH=AMD64 -!endif - -# Since MSVC8 we must deal with manifest resources. -!if $(VCVERSION) >= 1400 -_VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 -_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 -!endif - -!ifndef MACHINE -MACHINE=$(ARCH) -!endif - -!ifndef CFG_ENCODING -CFG_ENCODING = \"cp1252\" -!endif - -!message =============================================================================== - -#---------------------------------------------------------- -# build the helper app we need to overcome nmake's limiting -# environment. -#---------------------------------------------------------- - -!if !exist(nmakehlp.exe) -!if [$(cc32) -nologo nmakehlp.c -link -subsystem:console > nul] -!endif -!endif - -#---------------------------------------------------------- -# Test for compiler features -#---------------------------------------------------------- - -### test for optimizations -!if [nmakehlp -c -Ot] -!message *** Compiler has 'Optimizations' -OPTIMIZING = 1 -!else -!message *** Compiler does not have 'Optimizations' -OPTIMIZING = 0 -!endif - -OPTIMIZATIONS = - -!if [nmakehlp -c -Ot] -OPTIMIZATIONS = $(OPTIMIZATIONS) -Ot -!endif - -!if [nmakehlp -c -Oi] -OPTIMIZATIONS = $(OPTIMIZATIONS) -Oi -!endif - -!if [nmakehlp -c -Op] -OPTIMIZATIONS = $(OPTIMIZATIONS) -Op -!endif - -!if [nmakehlp -c -fp:strict] -OPTIMIZATIONS = $(OPTIMIZATIONS) -fp:strict -!endif - -!if [nmakehlp -c -Gs] -OPTIMIZATIONS = $(OPTIMIZATIONS) -Gs -!endif - -!if [nmakehlp -c -GS] -OPTIMIZATIONS = $(OPTIMIZATIONS) -GS -!endif - -!if [nmakehlp -c -GL] -OPTIMIZATIONS = $(OPTIMIZATIONS) -GL -!endif - -DEBUGFLAGS = - -!if [nmakehlp -c -RTC1] -DEBUGFLAGS = $(DEBUGFLAGS) -RTC1 -!elseif [nmakehlp -c -GZ] -DEBUGFLAGS = $(DEBUGFLAGS) -GZ -!endif - -COMPILERFLAGS =-W3 - -# In v13 -GL and -YX are incompatible. -!if [nmakehlp -c -YX] -!if ![nmakehlp -c -GL] -OPTIMIZATIONS = $(OPTIMIZATIONS) -YX -!endif -!endif - -!if "$(MACHINE)" == "IX86" -### test for pentium errata -!if [nmakehlp -c -QI0f] -!message *** Compiler has 'Pentium 0x0f fix' -COMPILERFLAGS = $(COMPILERFLAGS) -QI0f -!else -!message *** Compiler does not have 'Pentium 0x0f fix' -!endif -!endif - -!if "$(MACHINE)" == "IA64" -### test for Itanium errata -!if [nmakehlp -c -QIA64_Bx] -!message *** Compiler has 'B-stepping errata workarounds' -COMPILERFLAGS = $(COMPILERFLAGS) -QIA64_Bx -!else -!message *** Compiler does not have 'B-stepping errata workarounds' -!endif -!endif - -!if "$(MACHINE)" == "IX86" -### test for -align:4096, when align:512 will do. -!if [nmakehlp -l -opt:nowin98] -!message *** Linker has 'Win98 alignment problem' -ALIGN98_HACK = 1 -!else -!message *** Linker does not have 'Win98 alignment problem' -ALIGN98_HACK = 0 -!endif -!else -ALIGN98_HACK = 0 -!endif - -LINKERFLAGS = - -!if [nmakehlp -l -ltcg] -LINKERFLAGS =-ltcg -!endif - -#---------------------------------------------------------- -# Decode the options requested. -#---------------------------------------------------------- - -!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"] -STATIC_BUILD = 0 -TCL_THREADS = 0 -DEBUG = 0 -SYMBOLS = 0 -PROFILE = 0 -PGO = 0 -MSVCRT = 1 -LOIMPACT = 0 -TCL_USE_STATIC_PACKAGES = 0 -USE_THREAD_ALLOC = 0 -UNCHECKED = 0 -!else -!if [nmakehlp -f $(OPTS) "static"] -!message *** Doing static -STATIC_BUILD = 1 -!else -STATIC_BUILD = 0 -!endif -!if [nmakehlp -f $(OPTS) "msvcrt"] -!message *** Doing msvcrt -MSVCRT = 1 -!else -!if !$(STATIC_BUILD) -MSVCRT = 1 -!else -MSVCRT = 0 -!endif -!endif -!if [nmakehlp -f $(OPTS) "staticpkg"] && $(STATIC_BUILD) -!message *** Doing staticpkg -TCL_USE_STATIC_PACKAGES = 1 -!else -TCL_USE_STATIC_PACKAGES = 0 -!endif -!if [nmakehlp -f $(OPTS) "threads"] -!message *** Doing threads -TCL_THREADS = 1 -USE_THREAD_ALLOC = 1 -!else -TCL_THREADS = 0 -USE_THREAD_ALLOC = 0 -!endif -!if [nmakehlp -f $(OPTS) "symbols"] -!message *** Doing symbols -DEBUG = 1 -!else -DEBUG = 0 -!endif -!if [nmakehlp -f $(OPTS) "pdbs"] -!message *** Doing pdbs -SYMBOLS = 1 -!else -SYMBOLS = 0 -!endif -!if [nmakehlp -f $(OPTS) "profile"] -!message *** Doing profile -PROFILE = 1 -!else -PROFILE = 0 -!endif -!if [nmakehlp -f $(OPTS) "pgi"] -!message *** Doing profile guided optimization instrumentation -PGO = 1 -!elseif [nmakehlp -f $(OPTS) "pgo"] -!message *** Doing profile guided optimization -PGO = 2 -!else -PGO = 0 -!endif -!if [nmakehlp -f $(OPTS) "loimpact"] -!message *** Doing loimpact -LOIMPACT = 1 -!else -LOIMPACT = 0 -!endif -!if [nmakehlp -f $(OPTS) "thrdalloc"] -!message *** Doing thrdalloc -USE_THREAD_ALLOC = 1 -!endif -!if [nmakehlp -f $(OPTS) "tclalloc"] -!message *** Doing tclalloc -USE_THREAD_ALLOC = 0 -!endif -!if [nmakehlp -f $(OPTS) "unchecked"] -!message *** Doing unchecked -UNCHECKED = 1 -!else -UNCHECKED = 0 -!endif -!endif - -#---------------------------------------------------------- -# Figure-out how to name our intermediate and output directories. -# We wouldn't want different builds to use the same .obj files -# by accident. -#---------------------------------------------------------- - -#---------------------------------------- -# Naming convention: -# t = full thread support. -# s = static library (as opposed to an -# import library) -# g = linked to the debug enabled C -# run-time. -# x = special static build when it -# links to the dynamic C run-time. -#---------------------------------------- -SUFX = tsgx - -!if $(DEBUG) -BUILDDIRTOP = Debug -!else -BUILDDIRTOP = Release -!endif - -!if "$(MACHINE)" != "IX86" -BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE) -!endif -!if $(VCVER) > 6 -BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER) -!endif - -!if !$(DEBUG) || $(DEBUG) && $(UNCHECKED) -SUFX = $(SUFX:g=) -!endif - -TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX - -!if !$(STATIC_BUILD) -TMP_DIRFULL = $(TMP_DIRFULL:Static=) -SUFX = $(SUFX:s=) -EXT = dll -TMP_DIRFULL = $(TMP_DIRFULL:X=) -SUFX = $(SUFX:x=) -!else -TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=) -EXT = lib -!if !$(MSVCRT) -TMP_DIRFULL = $(TMP_DIRFULL:X=) -SUFX = $(SUFX:x=) -!endif -!endif - -!if !$(TCL_THREADS) -TMP_DIRFULL = $(TMP_DIRFULL:Threaded=) -SUFX = $(SUFX:t=) -!endif - -!ifndef TMP_DIR -TMP_DIR = $(TMP_DIRFULL) -!ifndef OUT_DIR -OUT_DIR = .\$(BUILDDIRTOP) -!endif -!else -!ifndef OUT_DIR -OUT_DIR = $(TMP_DIR) -!endif -!endif - - -#---------------------------------------------------------- -# Decode the statistics requested. -#---------------------------------------------------------- - -!if "$(STATS)" == "" || [nmakehlp -f "$(STATS)" "none"] -TCL_MEM_DEBUG = 0 -TCL_COMPILE_DEBUG = 0 -!else -!if [nmakehlp -f $(STATS) "memdbg"] -!message *** Doing memdbg -TCL_MEM_DEBUG = 1 -!else -TCL_MEM_DEBUG = 0 -!endif -!if [nmakehlp -f $(STATS) "compdbg"] -!message *** Doing compdbg -TCL_COMPILE_DEBUG = 1 -!else -TCL_COMPILE_DEBUG = 0 -!endif -!endif - - -#---------------------------------------------------------- -# Decode the checks requested. -#---------------------------------------------------------- - -!if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"] -TCL_NO_DEPRECATED = 0 -WARNINGS = -W3 -!else -!if [nmakehlp -f $(CHECKS) "nodep"] -!message *** Doing nodep check -TCL_NO_DEPRECATED = 1 -!else -TCL_NO_DEPRECATED = 0 -!endif -!if [nmakehlp -f $(CHECKS) "fullwarn"] -!message *** Doing full warnings check -WARNINGS = -W4 -!if [nmakehlp -l -warn:3] -LINKERFLAGS = $(LINKERFLAGS) -warn:3 -!endif -!else -WARNINGS = -W3 -!endif -!if [nmakehlp -f $(CHECKS) "64bit"] && [nmakehlp -c -Wp64] -!message *** Doing 64bit portability warnings -WARNINGS = $(WARNINGS) -Wp64 -!endif -!endif - -!if $(PGO) > 1 -!if [nmakehlp -l -ltcg:pgoptimize] -LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pgoptimize -!else -MSG=^ -This compiler does not support profile guided optimization. -!error $(MSG) -!endif -!elseif $(PGO) > 0 -!if [nmakehlp -l -ltcg:pginstrument] -LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pginstrument -!else -MSG=^ -This compiler does not support profile guided optimization. -!error $(MSG) -!endif -!endif - -#---------------------------------------------------------- -# Set our defines now armed with our options. -#---------------------------------------------------------- - -OPTDEFINES = -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) -DSTDC_HEADERS - -!if $(TCL_MEM_DEBUG) -OPTDEFINES = $(OPTDEFINES) -DTCL_MEM_DEBUG -!endif -!if $(TCL_COMPILE_DEBUG) -OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS -!endif -!if $(TCL_THREADS) -OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1 -!if $(USE_THREAD_ALLOC) -OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1 -!endif -!endif -!if $(STATIC_BUILD) -OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD -!endif -!if $(TCL_NO_DEPRECATED) -OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED -!endif - -!if !$(DEBUG) -OPTDEFINES = $(OPTDEFINES) -DNDEBUG -!if $(OPTIMIZING) -OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED -!endif -!endif -!if $(PROFILE) -OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED -!endif -!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" -OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT -!endif -!if $(VCVERSION) < 1300 -OPTDEFINES = $(OPTDEFINES) -DNO_STRTOI64 -!endif - -#---------------------------------------------------------- -# Locate the Tcl headers to build against -#---------------------------------------------------------- - -!if "$(PROJECT)" == "tcl" - -_TCL_H = ..\generic\tcl.h - -!else - -# If INSTALLDIR set to tcl root dir then reset to the lib dir. -!if exist("$(_INSTALLDIR)\include\tcl.h") -_INSTALLDIR=$(_INSTALLDIR)\lib -!endif - -!if !defined(TCLDIR) -!if exist("$(_INSTALLDIR)\..\include\tcl.h") -TCLINSTALL = 1 -_TCLDIR = $(_INSTALLDIR)\.. -_TCL_H = $(_INSTALLDIR)\..\include\tcl.h -TCLDIR = $(_INSTALLDIR)\.. -!else -MSG=^ -Failed to find tcl.h. Set the TCLDIR macro. -!error $(MSG) -!endif -!else -_TCLDIR = $(TCLDIR:/=\) -!if exist("$(_TCLDIR)\include\tcl.h") -TCLINSTALL = 1 -_TCL_H = $(_TCLDIR)\include\tcl.h -!elseif exist("$(_TCLDIR)\generic\tcl.h") -TCLINSTALL = 0 -_TCL_H = $(_TCLDIR)\generic\tcl.h -!else -MSG =^ -Failed to find tcl.h. The TCLDIR macro does not appear correct. -!error $(MSG) -!endif -!endif -!endif - -#-------------------------------------------------------------- -# Extract various version numbers from tcl headers -# The generated file is then included in the makefile. -#-------------------------------------------------------------- - -!if [echo REM = This file is generated from rules.vc > versions.vc] -!endif -!if [echo TCL_MAJOR_VERSION = \>> versions.vc] \ - && [nmakehlp -V "$(_TCL_H)" TCL_MAJOR_VERSION >> versions.vc] -!endif -!if [echo TCL_MINOR_VERSION = \>> versions.vc] \ - && [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc] -!endif -!if [echo TCL_PATCH_LEVEL = \>> versions.vc] \ - && [nmakehlp -V "$(_TCL_H)" TCL_PATCH_LEVEL >> versions.vc] -!endif - -# If building the tcl core then we need additional package versions -!if "$(PROJECT)" == "tcl" -!if [echo PKG_HTTP_VER = \>> versions.vc] \ - && [nmakehlp -V ..\library\http\pkgIndex.tcl http >> versions.vc] -!endif -!if [echo PKG_TCLTEST_VER = \>> versions.vc] \ - && [nmakehlp -V ..\library\tcltest\pkgIndex.tcl tcltest >> versions.vc] -!endif -!if [echo PKG_MSGCAT_VER = \>> versions.vc] \ - && [nmakehlp -V ..\library\msgcat\pkgIndex.tcl msgcat >> versions.vc] -!endif -!if [echo PKG_PLATFORM_VER = \>> versions.vc] \ - && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform " >> versions.vc] -!endif -!if [echo PKG_SHELL_VER = \>> versions.vc] \ - && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform::shell" >> versions.vc] -!endif -!if [echo PKG_DDE_VER = \>> versions.vc] \ - && [nmakehlp -V ..\library\dde\pkgIndex.tcl "dde " >> versions.vc] -!endif -!if [echo PKG_REG_VER =\>> versions.vc] \ - && [nmakehlp -V ..\library\reg\pkgIndex.tcl registry >> versions.vc] -!endif -!endif - -!include versions.vc - -#-------------------------------------------------------------- -# Setup tcl version dependent stuff headers -#-------------------------------------------------------------- - -!if "$(PROJECT)" != "tcl" - -TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION) - -!if $(TCLINSTALL) -TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe" -!if !exist($(TCLSH)) -TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:x=).exe" -!endif -TCLSTUBLIB = "$(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib" -TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib" -!if !exist($(TCLIMPLIB)) -TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX:x=).lib" -!endif -TCL_LIBRARY = $(_TCLDIR)\lib -TCLREGLIB = "$(_TCLDIR)\lib\tclreg12$(SUFX:t=).lib" -TCLDDELIB = "$(_TCLDIR)\lib\tcldde13$(SUFX:t=).lib" -COFFBASE = \must\have\tcl\sources\to\build\this\target -TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target -TCL_INCLUDES = -I"$(_TCLDIR)\include" -!else -TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe" -!if !exist($(TCLSH)) -TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:x=).exe" -!endif -TCLSTUBLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib" -TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib" -!if !exist($(TCLIMPLIB)) -TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX:x=).lib" -!endif -TCL_LIBRARY = $(_TCLDIR)\library -TCLREGLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg12$(SUFX:t=).lib" -TCLDDELIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde13$(SUFX:t=).lib" -COFFBASE = "$(_TCLDIR)\win\coffbase.txt" -TCLTOOLSDIR = $(_TCLDIR)\tools -TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win" -!endif - -!endif - -#------------------------------------------------------------------------- -# Locate the Tk headers to build against -#------------------------------------------------------------------------- - -!if "$(PROJECT)" == "tk" -_TK_H = ..\generic\tk.h -_INSTALLDIR = $(_INSTALLDIR)\.. -!endif - -!ifdef PROJECT_REQUIRES_TK -!if !defined(TKDIR) -!if exist("$(_INSTALLDIR)\..\include\tk.h") -TKINSTALL = 1 -_TKDIR = $(_INSTALLDIR)\.. -_TK_H = $(_TKDIR)\include\tk.h -TKDIR = $(_TKDIR) -!elseif exist("$(_TCLDIR)\include\tk.h") -TKINSTALL = 1 -_TKDIR = $(_TCLDIR) -_TK_H = $(_TKDIR)\include\tk.h -TKDIR = $(_TKDIR) -!endif -!else -_TKDIR = $(TKDIR:/=\) -!if exist("$(_TKDIR)\include\tk.h") -TKINSTALL = 1 -_TK_H = $(_TKDIR)\include\tk.h -!elseif exist("$(_TKDIR)\generic\tk.h") -TKINSTALL = 0 -_TK_H = $(_TKDIR)\generic\tk.h -!else -MSG =^ -Failed to find tk.h. The TKDIR macro does not appear correct. -!error $(MSG) -!endif -!endif -!endif - -#------------------------------------------------------------------------- -# Extract Tk version numbers -#------------------------------------------------------------------------- - -!if defined(PROJECT_REQUIRES_TK) || "$(PROJECT)" == "tk" - -!if [echo TK_MAJOR_VERSION = \>> versions.vc] \ - && [nmakehlp -V $(_TK_H) TK_MAJOR_VERSION >> versions.vc] -!endif -!if [echo TK_MINOR_VERSION = \>> versions.vc] \ - && [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc] -!endif -!if [echo TK_PATCH_LEVEL = \>> versions.vc] \ - && [nmakehlp -V $(_TK_H) TK_PATCH_LEVEL >> versions.vc] -!endif - -!include versions.vc - -TK_DOTVERSION = $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION) -TK_VERSION = $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION) - -!if "$(PROJECT)" != "tk" -!if $(TKINSTALL) -WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX).exe" -!if !exist($(WISH)) -WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX:x=).exe" -!endif -TKSTUBLIB = "$(_TKDIR)\lib\tkstub$(TK_VERSION).lib" -TKIMPLIB = "$(_TKDIR)\lib\tk$(TK_VERSION)$(SUFX).lib" -!if !exist($(TKIMPLIB)) -TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX:x=).lib" -!endif -TK_INCLUDES = -I"$(_TKDIR)\include" -!else -WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX).exe" -!if !exist($(WISH)) -WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX:x=).exe" -!endif -TKSTUBLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib" -TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX).lib" -!if !exist($(TKIMPLIB)) -TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX:x=).lib" -!endif -TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib" -!endif -!endif - -!endif - -#---------------------------------------------------------- -# Display stats being used. -#---------------------------------------------------------- - -!message *** Intermediate directory will be '$(TMP_DIR)' -!message *** Output directory will be '$(OUT_DIR)' -!message *** Suffix for binaries will be '$(SUFX)' -!message *** Optional defines are '$(OPTDEFINES)' -!message *** Compiler version $(VCVER). Target machine is $(MACHINE) -!message *** Host architecture is $(NATIVE_ARCH) -!message *** Compiler options '$(COMPILERFLAGS) $(OPTIMIZATIONS) $(DEBUGFLAGS) $(WARNINGS)' -!message *** Link options '$(LINKERFLAGS)' - -!endif +#------------------------------------------------------------------------------ +# rules.vc -- +# +# Microsoft Visual C++ makefile include for decoding the commandline +# macros. This file does not need editing to build Tcl. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# Copyright (c) 2001-2003 David Gravereaux. +# Copyright (c) 2003-2008 Patrick Thoyts +#------------------------------------------------------------------------------ + +!ifndef _RULES_VC +_RULES_VC = 1 + +cc32 = $(CC) # built-in default. +link32 = link +lib32 = lib +rc32 = $(RC) # built-in default. + +!ifndef INSTALLDIR +### Assume the normal default. +_INSTALLDIR = C:\Program Files\Tcl +!else +### Fix the path separators. +_INSTALLDIR = $(INSTALLDIR:/=\) +!endif + +#---------------------------------------------------------- +# Set the proper copy method to avoid overwrite questions +# to the user when copying files and selecting the right +# "delete all" method. +#---------------------------------------------------------- + +!if "$(OS)" == "Windows_NT" +RMDIR = rmdir /S /Q +ERRNULL = 2>NUL +!if ![ver | find "4.0" > nul] +CPY = echo y | xcopy /i >NUL +COPY = copy >NUL +!else +CPY = xcopy /i /y >NUL +COPY = copy /y >NUL +!endif +!else # "$(OS)" != "Windows_NT" +CPY = xcopy /i >_JUNK.OUT # On Win98 NUL does not work here. +COPY = copy >_JUNK.OUT # On Win98 NUL does not work here. +RMDIR = deltree /Y +NULL = \NUL # Used in testing directory existence +ERRNULL = >NUL # Win9x shell cannot redirect stderr +!endif +MKDIR = mkdir + +#------------------------------------------------------------------------------ +# Determine the host and target architectures and compiler version. +#------------------------------------------------------------------------------ + +_HASH=^# +_VC_MANIFEST_EMBED_EXE= +_VC_MANIFEST_EMBED_DLL= +VCVER=0 +!if ![echo VCVERSION=_MSC_VER > vercl.x] \ + && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \ + && ![echo ARCH=IX86 >> vercl.x] \ + && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \ + && ![echo ARCH=AMD64 >> vercl.x] \ + && ![echo $(_HASH)endif >> vercl.x] \ + && ![cl -nologo -TC -P vercl.x $(ERRNULL)] +!include vercl.i +!if ![echo VCVER= ^\> vercl.vc] \ + && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc] +!include vercl.vc +!endif +!endif +!if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc] +!endif + +!if ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i x86] +NATIVE_ARCH=IX86 +!else +NATIVE_ARCH=AMD64 +!endif + +# Since MSVC8 we must deal with manifest resources. +!if $(VCVERSION) >= 1400 +_VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1 +_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 +!endif + +!ifndef MACHINE +MACHINE=$(ARCH) +!endif + +!ifndef CFG_ENCODING +CFG_ENCODING = \"cp1252\" +!endif + +!message =============================================================================== + +#---------------------------------------------------------- +# build the helper app we need to overcome nmake's limiting +# environment. +#---------------------------------------------------------- + +!if !exist(nmakehlp.exe) +!if [$(cc32) -nologo nmakehlp.c -link -subsystem:console > nul] +!endif +!endif + +#---------------------------------------------------------- +# Test for compiler features +#---------------------------------------------------------- + +### test for optimizations +!if [nmakehlp -c -Ot] +!message *** Compiler has 'Optimizations' +OPTIMIZING = 1 +!else +!message *** Compiler does not have 'Optimizations' +OPTIMIZING = 0 +!endif + +OPTIMIZATIONS = + +!if [nmakehlp -c -Ot] +OPTIMIZATIONS = $(OPTIMIZATIONS) -Ot +!endif + +!if [nmakehlp -c -Oi] +OPTIMIZATIONS = $(OPTIMIZATIONS) -Oi +!endif + +!if [nmakehlp -c -Op] +OPTIMIZATIONS = $(OPTIMIZATIONS) -Op +!endif + +!if [nmakehlp -c -fp:strict] +OPTIMIZATIONS = $(OPTIMIZATIONS) -fp:strict +!endif + +!if [nmakehlp -c -Gs] +OPTIMIZATIONS = $(OPTIMIZATIONS) -Gs +!endif + +!if [nmakehlp -c -GS] +OPTIMIZATIONS = $(OPTIMIZATIONS) -GS +!endif + +!if [nmakehlp -c -GL] +OPTIMIZATIONS = $(OPTIMIZATIONS) -GL +!endif + +DEBUGFLAGS = + +!if [nmakehlp -c -RTC1] +DEBUGFLAGS = $(DEBUGFLAGS) -RTC1 +!elseif [nmakehlp -c -GZ] +DEBUGFLAGS = $(DEBUGFLAGS) -GZ +!endif + +COMPILERFLAGS =-W3 + +# In v13 -GL and -YX are incompatible. +!if [nmakehlp -c -YX] +!if ![nmakehlp -c -GL] +OPTIMIZATIONS = $(OPTIMIZATIONS) -YX +!endif +!endif + +!if "$(MACHINE)" == "IX86" +### test for pentium errata +!if [nmakehlp -c -QI0f] +!message *** Compiler has 'Pentium 0x0f fix' +COMPILERFLAGS = $(COMPILERFLAGS) -QI0f +!else +!message *** Compiler does not have 'Pentium 0x0f fix' +!endif +!endif + +!if "$(MACHINE)" == "IA64" +### test for Itanium errata +!if [nmakehlp -c -QIA64_Bx] +!message *** Compiler has 'B-stepping errata workarounds' +COMPILERFLAGS = $(COMPILERFLAGS) -QIA64_Bx +!else +!message *** Compiler does not have 'B-stepping errata workarounds' +!endif +!endif + +!if "$(MACHINE)" == "IX86" +### test for -align:4096, when align:512 will do. +!if [nmakehlp -l -opt:nowin98] +!message *** Linker has 'Win98 alignment problem' +ALIGN98_HACK = 1 +!else +!message *** Linker does not have 'Win98 alignment problem' +ALIGN98_HACK = 0 +!endif +!else +ALIGN98_HACK = 0 +!endif + +LINKERFLAGS = + +!if [nmakehlp -l -ltcg] +LINKERFLAGS =-ltcg +!endif + +#---------------------------------------------------------- +# Decode the options requested. +#---------------------------------------------------------- + +!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"] +STATIC_BUILD = 0 +TCL_THREADS = 0 +DEBUG = 0 +SYMBOLS = 0 +PROFILE = 0 +PGO = 0 +MSVCRT = 1 +LOIMPACT = 0 +TCL_USE_STATIC_PACKAGES = 0 +USE_THREAD_ALLOC = 0 +UNCHECKED = 0 +!else +!if [nmakehlp -f $(OPTS) "static"] +!message *** Doing static +STATIC_BUILD = 1 +!else +STATIC_BUILD = 0 +!endif +!if [nmakehlp -f $(OPTS) "msvcrt"] +!message *** Doing msvcrt +MSVCRT = 1 +!else +!if !$(STATIC_BUILD) +MSVCRT = 1 +!else +MSVCRT = 0 +!endif +!endif +!if [nmakehlp -f $(OPTS) "staticpkg"] && $(STATIC_BUILD) +!message *** Doing staticpkg +TCL_USE_STATIC_PACKAGES = 1 +!else +TCL_USE_STATIC_PACKAGES = 0 +!endif +!if [nmakehlp -f $(OPTS) "threads"] +!message *** Doing threads +TCL_THREADS = 1 +USE_THREAD_ALLOC = 1 +!else +TCL_THREADS = 0 +USE_THREAD_ALLOC = 0 +!endif +!if [nmakehlp -f $(OPTS) "symbols"] +!message *** Doing symbols +DEBUG = 1 +!else +DEBUG = 0 +!endif +!if [nmakehlp -f $(OPTS) "pdbs"] +!message *** Doing pdbs +SYMBOLS = 1 +!else +SYMBOLS = 0 +!endif +!if [nmakehlp -f $(OPTS) "profile"] +!message *** Doing profile +PROFILE = 1 +!else +PROFILE = 0 +!endif +!if [nmakehlp -f $(OPTS) "pgi"] +!message *** Doing profile guided optimization instrumentation +PGO = 1 +!elseif [nmakehlp -f $(OPTS) "pgo"] +!message *** Doing profile guided optimization +PGO = 2 +!else +PGO = 0 +!endif +!if [nmakehlp -f $(OPTS) "loimpact"] +!message *** Doing loimpact +LOIMPACT = 1 +!else +LOIMPACT = 0 +!endif +!if [nmakehlp -f $(OPTS) "thrdalloc"] +!message *** Doing thrdalloc +USE_THREAD_ALLOC = 1 +!endif +!if [nmakehlp -f $(OPTS) "tclalloc"] +!message *** Doing tclalloc +USE_THREAD_ALLOC = 0 +!endif +!if [nmakehlp -f $(OPTS) "unchecked"] +!message *** Doing unchecked +UNCHECKED = 1 +!else +UNCHECKED = 0 +!endif +!endif + +#---------------------------------------------------------- +# Figure-out how to name our intermediate and output directories. +# We wouldn't want different builds to use the same .obj files +# by accident. +#---------------------------------------------------------- + +#---------------------------------------- +# Naming convention: +# t = full thread support. +# s = static library (as opposed to an +# import library) +# g = linked to the debug enabled C +# run-time. +# x = special static build when it +# links to the dynamic C run-time. +#---------------------------------------- +SUFX = tsgx + +!if $(DEBUG) +BUILDDIRTOP = Debug +!else +BUILDDIRTOP = Release +!endif + +!if "$(MACHINE)" != "IX86" +BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE) +!endif +!if $(VCVER) > 6 +BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER) +!endif + +!if !$(DEBUG) || $(DEBUG) && $(UNCHECKED) +SUFX = $(SUFX:g=) +!endif + +TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX + +!if !$(STATIC_BUILD) +TMP_DIRFULL = $(TMP_DIRFULL:Static=) +SUFX = $(SUFX:s=) +EXT = dll +TMP_DIRFULL = $(TMP_DIRFULL:X=) +SUFX = $(SUFX:x=) +!else +TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=) +EXT = lib +!if !$(MSVCRT) +TMP_DIRFULL = $(TMP_DIRFULL:X=) +SUFX = $(SUFX:x=) +!endif +!endif + +!if !$(TCL_THREADS) +TMP_DIRFULL = $(TMP_DIRFULL:Threaded=) +SUFX = $(SUFX:t=) +!endif + +!ifndef TMP_DIR +TMP_DIR = $(TMP_DIRFULL) +!ifndef OUT_DIR +OUT_DIR = .\$(BUILDDIRTOP) +!endif +!else +!ifndef OUT_DIR +OUT_DIR = $(TMP_DIR) +!endif +!endif + + +#---------------------------------------------------------- +# Decode the statistics requested. +#---------------------------------------------------------- + +!if "$(STATS)" == "" || [nmakehlp -f "$(STATS)" "none"] +TCL_MEM_DEBUG = 0 +TCL_COMPILE_DEBUG = 0 +!else +!if [nmakehlp -f $(STATS) "memdbg"] +!message *** Doing memdbg +TCL_MEM_DEBUG = 1 +!else +TCL_MEM_DEBUG = 0 +!endif +!if [nmakehlp -f $(STATS) "compdbg"] +!message *** Doing compdbg +TCL_COMPILE_DEBUG = 1 +!else +TCL_COMPILE_DEBUG = 0 +!endif +!endif + + +#---------------------------------------------------------- +# Decode the checks requested. +#---------------------------------------------------------- + +!if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"] +TCL_NO_DEPRECATED = 0 +WARNINGS = -W3 +!else +!if [nmakehlp -f $(CHECKS) "nodep"] +!message *** Doing nodep check +TCL_NO_DEPRECATED = 1 +!else +TCL_NO_DEPRECATED = 0 +!endif +!if [nmakehlp -f $(CHECKS) "fullwarn"] +!message *** Doing full warnings check +WARNINGS = -W4 +!if [nmakehlp -l -warn:3] +LINKERFLAGS = $(LINKERFLAGS) -warn:3 +!endif +!else +WARNINGS = -W3 +!endif +!if [nmakehlp -f $(CHECKS) "64bit"] && [nmakehlp -c -Wp64] +!message *** Doing 64bit portability warnings +WARNINGS = $(WARNINGS) -Wp64 +!endif +!endif + +!if $(PGO) > 1 +!if [nmakehlp -l -ltcg:pgoptimize] +LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pgoptimize +!else +MSG=^ +This compiler does not support profile guided optimization. +!error $(MSG) +!endif +!elseif $(PGO) > 0 +!if [nmakehlp -l -ltcg:pginstrument] +LINKERFLAGS = $(LINKERFLAGS:-ltcg=) -ltcg:pginstrument +!else +MSG=^ +This compiler does not support profile guided optimization. +!error $(MSG) +!endif +!endif + +#---------------------------------------------------------- +# Set our defines now armed with our options. +#---------------------------------------------------------- + +OPTDEFINES = -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) -DSTDC_HEADERS + +!if $(TCL_MEM_DEBUG) +OPTDEFINES = $(OPTDEFINES) -DTCL_MEM_DEBUG +!endif +!if $(TCL_COMPILE_DEBUG) +OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS +!endif +!if $(TCL_THREADS) +OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1 +!if $(USE_THREAD_ALLOC) +OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1 +!endif +!endif +!if $(STATIC_BUILD) +OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD +!endif +!if $(TCL_NO_DEPRECATED) +OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED +!endif + +!if !$(DEBUG) +OPTDEFINES = $(OPTDEFINES) -DNDEBUG +!if $(OPTIMIZING) +OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED +!endif +!endif +!if $(PROFILE) +OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED +!endif +!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" +OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT +!endif +!if $(VCVERSION) < 1300 +OPTDEFINES = $(OPTDEFINES) -DNO_STRTOI64 +!endif + +#---------------------------------------------------------- +# Locate the Tcl headers to build against +#---------------------------------------------------------- + +!if "$(PROJECT)" == "tcl" + +_TCL_H = ..\generic\tcl.h + +!else + +# If INSTALLDIR set to tcl root dir then reset to the lib dir. +!if exist("$(_INSTALLDIR)\include\tcl.h") +_INSTALLDIR=$(_INSTALLDIR)\lib +!endif + +!if !defined(TCLDIR) +!if exist("$(_INSTALLDIR)\..\include\tcl.h") +TCLINSTALL = 1 +_TCLDIR = $(_INSTALLDIR)\.. +_TCL_H = $(_INSTALLDIR)\..\include\tcl.h +TCLDIR = $(_INSTALLDIR)\.. +!else +MSG=^ +Failed to find tcl.h. Set the TCLDIR macro. +!error $(MSG) +!endif +!else +_TCLDIR = $(TCLDIR:/=\) +!if exist("$(_TCLDIR)\include\tcl.h") +TCLINSTALL = 1 +_TCL_H = $(_TCLDIR)\include\tcl.h +!elseif exist("$(_TCLDIR)\generic\tcl.h") +TCLINSTALL = 0 +_TCL_H = $(_TCLDIR)\generic\tcl.h +!else +MSG =^ +Failed to find tcl.h. The TCLDIR macro does not appear correct. +!error $(MSG) +!endif +!endif +!endif + +#-------------------------------------------------------------- +# Extract various version numbers from tcl headers +# The generated file is then included in the makefile. +#-------------------------------------------------------------- + +!if [echo REM = This file is generated from rules.vc > versions.vc] +!endif +!if [echo TCL_MAJOR_VERSION = \>> versions.vc] \ + && [nmakehlp -V "$(_TCL_H)" TCL_MAJOR_VERSION >> versions.vc] +!endif +!if [echo TCL_MINOR_VERSION = \>> versions.vc] \ + && [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc] +!endif +!if [echo TCL_PATCH_LEVEL = \>> versions.vc] \ + && [nmakehlp -V "$(_TCL_H)" TCL_PATCH_LEVEL >> versions.vc] +!endif + +# If building the tcl core then we need additional package versions +!if "$(PROJECT)" == "tcl" +!if [echo PKG_HTTP_VER = \>> versions.vc] \ + && [nmakehlp -V ..\library\http\pkgIndex.tcl http >> versions.vc] +!endif +!if [echo PKG_TCLTEST_VER = \>> versions.vc] \ + && [nmakehlp -V ..\library\tcltest\pkgIndex.tcl tcltest >> versions.vc] +!endif +!if [echo PKG_MSGCAT_VER = \>> versions.vc] \ + && [nmakehlp -V ..\library\msgcat\pkgIndex.tcl msgcat >> versions.vc] +!endif +!if [echo PKG_PLATFORM_VER = \>> versions.vc] \ + && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform " >> versions.vc] +!endif +!if [echo PKG_SHELL_VER = \>> versions.vc] \ + && [nmakehlp -V ..\library\platform\pkgIndex.tcl "platform::shell" >> versions.vc] +!endif +!if [echo PKG_DDE_VER = \>> versions.vc] \ + && [nmakehlp -V ..\library\dde\pkgIndex.tcl "dde " >> versions.vc] +!endif +!if [echo PKG_REG_VER =\>> versions.vc] \ + && [nmakehlp -V ..\library\reg\pkgIndex.tcl registry >> versions.vc] +!endif +!endif + +!include versions.vc + +#-------------------------------------------------------------- +# Setup tcl version dependent stuff headers +#-------------------------------------------------------------- + +!if "$(PROJECT)" != "tcl" + +TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION) + +!if $(TCLINSTALL) +TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe" +!if !exist($(TCLSH)) +TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:x=).exe" +!endif +TCLSTUBLIB = "$(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib" +TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib" +!if !exist($(TCLIMPLIB)) +TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX:x=).lib" +!endif +TCL_LIBRARY = $(_TCLDIR)\lib +TCLREGLIB = "$(_TCLDIR)\lib\tclreg12$(SUFX:t=).lib" +TCLDDELIB = "$(_TCLDIR)\lib\tcldde13$(SUFX:t=).lib" +COFFBASE = \must\have\tcl\sources\to\build\this\target +TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target +TCL_INCLUDES = -I"$(_TCLDIR)\include" +!else +TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe" +!if !exist($(TCLSH)) +TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:x=).exe" +!endif +TCLSTUBLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib" +TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib" +!if !exist($(TCLIMPLIB)) +TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX:x=).lib" +!endif +TCL_LIBRARY = $(_TCLDIR)\library +TCLREGLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg12$(SUFX:t=).lib" +TCLDDELIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde13$(SUFX:t=).lib" +COFFBASE = "$(_TCLDIR)\win\coffbase.txt" +TCLTOOLSDIR = $(_TCLDIR)\tools +TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win" +!endif + +!endif + +#------------------------------------------------------------------------- +# Locate the Tk headers to build against +#------------------------------------------------------------------------- + +!if "$(PROJECT)" == "tk" +_TK_H = ..\generic\tk.h +_INSTALLDIR = $(_INSTALLDIR)\.. +!endif + +!ifdef PROJECT_REQUIRES_TK +!if !defined(TKDIR) +!if exist("$(_INSTALLDIR)\..\include\tk.h") +TKINSTALL = 1 +_TKDIR = $(_INSTALLDIR)\.. +_TK_H = $(_TKDIR)\include\tk.h +TKDIR = $(_TKDIR) +!elseif exist("$(_TCLDIR)\include\tk.h") +TKINSTALL = 1 +_TKDIR = $(_TCLDIR) +_TK_H = $(_TKDIR)\include\tk.h +TKDIR = $(_TKDIR) +!endif +!else +_TKDIR = $(TKDIR:/=\) +!if exist("$(_TKDIR)\include\tk.h") +TKINSTALL = 1 +_TK_H = $(_TKDIR)\include\tk.h +!elseif exist("$(_TKDIR)\generic\tk.h") +TKINSTALL = 0 +_TK_H = $(_TKDIR)\generic\tk.h +!else +MSG =^ +Failed to find tk.h. The TKDIR macro does not appear correct. +!error $(MSG) +!endif +!endif +!endif + +#------------------------------------------------------------------------- +# Extract Tk version numbers +#------------------------------------------------------------------------- + +!if defined(PROJECT_REQUIRES_TK) || "$(PROJECT)" == "tk" + +!if [echo TK_MAJOR_VERSION = \>> versions.vc] \ + && [nmakehlp -V $(_TK_H) TK_MAJOR_VERSION >> versions.vc] +!endif +!if [echo TK_MINOR_VERSION = \>> versions.vc] \ + && [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc] +!endif +!if [echo TK_PATCH_LEVEL = \>> versions.vc] \ + && [nmakehlp -V $(_TK_H) TK_PATCH_LEVEL >> versions.vc] +!endif + +!include versions.vc + +TK_DOTVERSION = $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION) +TK_VERSION = $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION) + +!if "$(PROJECT)" != "tk" +!if $(TKINSTALL) +WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX).exe" +!if !exist($(WISH)) +WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX:x=).exe" +!endif +TKSTUBLIB = "$(_TKDIR)\lib\tkstub$(TK_VERSION).lib" +TKIMPLIB = "$(_TKDIR)\lib\tk$(TK_VERSION)$(SUFX).lib" +!if !exist($(TKIMPLIB)) +TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX:x=).lib" +!endif +TK_INCLUDES = -I"$(_TKDIR)\include" +!else +WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX).exe" +!if !exist($(WISH)) +WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX:x=).exe" +!endif +TKSTUBLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib" +TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX).lib" +!if !exist($(TKIMPLIB)) +TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX:x=).lib" +!endif +TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib" +!endif +!endif + +!endif + +#---------------------------------------------------------- +# Display stats being used. +#---------------------------------------------------------- + +!message *** Intermediate directory will be '$(TMP_DIR)' +!message *** Output directory will be '$(OUT_DIR)' +!message *** Suffix for binaries will be '$(SUFX)' +!message *** Optional defines are '$(OPTDEFINES)' +!message *** Compiler version $(VCVER). Target machine is $(MACHINE) +!message *** Host architecture is $(NATIVE_ARCH) +!message *** Compiler options '$(COMPILERFLAGS) $(OPTIMIZATIONS) $(DEBUGFLAGS) $(WARNINGS)' +!message *** Link options '$(LINKERFLAGS)' + +!endif diff --git a/win/tkConfig.sh.in b/win/tkConfig.sh.in index 7816b15..c511312 100644 --- a/win/tkConfig.sh.in +++ b/win/tkConfig.sh.in @@ -1,5 +1,5 @@ # tkConfig.sh -- -# +# # This shell script (for sh) is generated automatically by Tk's # configure script. It will create shell variables for most of # the configuration options discovered by the configure script. -- cgit v0.12 From da6ca47d6d53db41a974859bf961ddc2d8f9d1d3 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 29 Jun 2015 21:57:04 +0000 Subject: Fixed bug [2886436fff] - [.txt delete] deletes before start index - This is option 2: don't change the behavior of the text widget, but document it better. --- doc/text.n | 7 +++++-- generic/tkText.c | 14 +++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/doc/text.n b/doc/text.n index b11363d..1ccadbb 100644 --- a/doc/text.n +++ b/doc/text.n @@ -1216,8 +1216,11 @@ If \fIindex2\fR does not specify a position later in the text than \fIindex1\fR then no characters are deleted. If \fIindex2\fR is not specified then the single character at \fIindex1\fR is deleted. -It is not allowable to delete characters in a way that would leave -the text without a newline as the last character. +Attempts to delete characters in a way that would leave +the text without a newline as the last character will be tweaked by the +text widget to avoid this. In particular, attempts to delete complete +lines of text up to the end of the text will result in +deletion of the newline character just preceding \fIindex1\fR. The command returns an empty string. If more indices are given, multiple ranges of text will be deleted. All indices are first checked for validity before any deletions are made. diff --git a/generic/tkText.c b/generic/tkText.c index 139e71d..5042582 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -3001,11 +3001,15 @@ DeleteIndexRange( * file (just before the dummy line) is being deleted, then back up index * to just before the newline. If there is a newline just before the first * character being deleted, then back up the first index too, so that an - * even number of lines gets deleted. Furthermore, remove any tags that - * are present on the newline that isn't going to be deleted after all - * (this simulates deleting the newline and then adding a "clean" one back - * again). Note that index1 and index2 might now be equal again which - * means that no text will be deleted but tags might be removed. + * even number of lines gets deleted. The idea is that a deletion + * involving a range starting at a line start and including the final \n + * (i.e. index2 is "end") is an attempt to delete complete lines, so the + * \n before the deleted block shall become the new final \n. Furthermore, + * remove any tags that are present on the newline that isn't going to be + * deleted after all (this simulates deleting the newline and then adding + * a "clean" one back again). Note that index1 and index2 might now be + * equal again which means that no text will be deleted but tags might be + * removed. */ line1 = TkBTreeLinesTo(textPtr, index1.linePtr); -- cgit v0.12 From 23378d66e9d5598a406f1d396412a33b6e00feac Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Tue, 30 Jun 2015 02:29:58 +0000 Subject: Add tk-mac doc to 8.5 --- doc/tk_mac.n | 237 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 doc/tk_mac.n diff --git a/doc/tk_mac.n b/doc/tk_mac.n new file mode 100644 index 0000000..f29ef2f --- /dev/null +++ b/doc/tk_mac.n @@ -0,0 +1,237 @@ +'\" +'\" Copyright (c) 2011 Kevin Walzer. +'\" Copyright (c) 2011 Donal K. Fellows. +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +.TH tk::mac n 8.6 Tk "Tk Built-In Commands" +.so man.macros +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +tk::mac \- Access Mac-Specific Functionality on OS X from Tk +.SH SYNOPSIS +.nf +\fB::tk::mac::ShowPreferences\fR +\fB::tk::mac::OpenApplication\fR +\fB::tk::mac::ReopenApplication\fR +\fB::tk::mac::OpenDocument \fIfile...\fR +\fB::tk::mac::PrintDocument \fIfile...\fR +\fB::tk::mac::Quit\fR +\fB::tk::mac::OnHide\fR +\fB::tk::mac::OnShow\fR +\fB::tk::mac::ShowHelp\fR + +\fB::tk::mac::standardAboutPanel\fR + +\fB::tk::mac::useCompatibilityMetrics \fIboolean\fR +\fB::tk::mac::CGAntialiasLimit \fIlimit\fR +\fB::tk::mac::antialiasedtext \fInumber\fR +\fB::tk::mac::useThemedToplevel \fIboolean\fR + +\fB::tk::mac::iconBitmap \fIname width height \-kind value\fR +.fi +.BE +.SH "EVENT HANDLER CALLBACKS" +.PP +The Aqua/Mac OS X application environment defines a number of additional +events that applications should respond to. These events are mapped by Tk to +calls to commands in the \fB::tk::mac\fR namespace; unless otherwise noted, if +the command is absent, no action will be taken. +.TP +\fB::tk::mac::ShowPreferences\fR +. +The default Apple Event handler for kAEShowPreferences, +.QW pref . +The application menu +.QW "Preferences" +menu item is only enabled when this proc is defined. Typically this command is +used to wrap a specific own preferences command, which pops up a preferences +window. Something like: +.RS +.PP +.CS +proc ::tk::mac::ShowPreferences {} { + setPref +} +.CE +.RE +.TP +\fB::tk::mac::OpenApplication\fR +. +If a proc of this name is defined, this proc fill fire when your application +is intially opened. It is the default Apple Event handler for +kAEOpenApplication, +.QW oapp . +.TP +\fB::tk::mac::ReopenApplication\fR +. +If a proc of this name is defined it is the default Apple Event handler for +kAEReopenApplication, +.QW rapp , +the Apple Event sent when your application is opened when it is already +running (e.g. by clicking its icon in the Dock). Here is a sample that raises +a minimized window when the Dock icon is clicked: +.RS +.PP +.CS +proc ::tk::mac::ReopenApplication {} { + if {[wm state .] eq "withdrawn"} { + wm state . normal + } else { + wm deiconify . + } + raise . +} +.CE +.RE +.TP +\fB::tk::mac::OpenDocument \fIfile...\fR +. +If a proc of this name is defined it is the default Apple Event handler for +kAEOpenDocuments, +.QW odoc , +the Apple Event sent when your application is asked to open one or more +documents (e.g., by drag & drop onto the app or by opening a document of a +type associated to the app). The proc should take as arguments paths to the +files to be opened, like so: +.RS +.PP +.CS +proc ::tk::mac::OpenDocument {args} { + foreach f $args {my_open_document $f} +} +.CE +.RE +.TP +\fB::tk::mac::PrintDocument \fIfile...\fR +. +If a proc of this name is defined it is the default Apple Event handler for +kAEPrintDocuments, +.QW pdoc , +the Apple Event sent when your application is asked to print one or more +documents (e.g., via the Print menu item in the Finder). It works the same +way as \fBtk::mac::OpenDocument\fR in terms of arguments. +.TP +\fB::tk::mac::Quit\fR +. +If a proc of this name is defined it is the default Apple Event handler for +kAEQuitApplication, +.QW quit , +the Apple Event sent when your application is asked to be quit, e.g. via the +quit menu item in the application menu, the quit menu item in the Dock menu, +or during a logout/restart/shutdown etc. If this is not defined, \fBexit\fR is +called instead. +.TP +\fB::tk::mac::OnHide\fR +. +If defined, this is called when your application receives a kEventAppHidden +event, e.g. via the hide menu item in the application or Dock menus. +.TP +\fB::tk::mac::OnShow\fR +. +If defined, this is called when your application receives a kEventAppShown +event, e.g. via the show all menu item in the application menu, or by clicking +the Dock icon of a hidden application. +.TP +\fB::tk::mac::ShowHelp\fR +. +Customizes behavior of Apple Help menu; if this procedure is not defined, the +platform-specific standard Help menu item +.QW "YourApp Help" +performs the default Cocoa action of showing the Help Book configured in the +application's Info.plist (or displaying an alert if no Help Book is set). +.SH "ADDITIONAL DIALOGS" +.PP +The Aqua/Mac OS X defines additional dialogs that applications should +support. +.TP +\fB::tk::mac::standardAboutPanel\fR +. +Brings the standard Cocoa about panel to the front, with all its information +filled in from your application bundle files (standard about panel with no +options specified). See Apple Technote TN2179 and the AppKit documentation for +-[NSApplication orderFrontStandardAboutPanelWithOptions:] for details on the +Info.plist keys and app bundle files used by the about panel. +.SH "SYSTEM CONFIGURATION" +.PP +There are a number of additional global configuration options that control the +details of how Tk renders by default. +.TP +\fB::tk::mac::useCompatibilityMetrics \fIboolean\fR +. +Preserves compatibility with older Tk/Aqua metrics; set to \fBfalse\fR for +more native spacing. +.TP +\fB::tk::mac::CGAntialiasLimit \fIlimit\fR +. +Sets the antialiasing limit; lines thinner that \fIlimit\fR pixels will not be +antialiased. Integer, set to 0 by default, making all lines be antialiased. +.TP +\fB::tk::mac::antialiasedtext \fInumber\fR +. +Sets anti-aliased text. Controls text antialiasing, possible values for +\fInumber\fR are -1 (default, use system default for text AA), 0 (no text AA), +1 (use text AA). +.TP +\fB::tk::mac::useThemedToplevel \fIboolean\fR +. +Sets toplevel windows to draw with the modern grayish/ pinstripe Mac +background. Equivalent to configuring the toplevel with +.QW "\fB\-background systemWindowHeaderBackground\fR" , +or to using a \fBttk::frame\fR. +.SH "SUPPORT COMMANDS" +.TP +\fB::tk::mac::iconBitmap \fIname width height \-kind value\fR +. +Renders native icons and bitmaps in Tk applications (including any image file +readable by NSImage). A native bitmap name is interpreted as follows (in +order): +.RS +.IP \(bu 3 +predefined builtin 32x32 icon name (\fBstop\fR, \fBcaution\fR, \fBdocument\fR, +etc.) +.IP \(bu 3 +\fIname\fR, as defined by \fBtk::mac::iconBitmap\fR +.IP \(bu 3 +NSImage named image name +.IP \(bu 3 +NSImage url string +.IP \(bu 3 +4-char OSType of IconServices icon +.PP +The \fIwidth\fR and \fIheight\fR arguments to \fBtk::mac::iconBitmap\fR define +the dimensions of the image to create, and \fI\-kind\fR must be one of: +.TP +\fB\-file\fR +. +icon of file at given path +.TP +\fB\-fileType\fR +. +icon of given file type +.TP +\fB\-osType\fR +. +icon of given 4-char OSType file type +.TP +\fB\-systemType\fR +. +icon for given IconServices 4-char OSType +.TP +\fB\-namedImage\fR +. +named NSImage for given name +.TP +\fB\-imageFile\fR +. +image at given path +.RE +.SH "SEE ALSO" +bind(n), wm(n) +.SH KEYWORDS +about dialog, antialiasing, Apple event, icon, NSImage +'\" Local Variables: +'\" mode: nroff +'\" End: -- cgit v0.12 From 4a6942aa314339a94bb067b7cc073bad867f77a8 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 2 Jul 2015 20:21:10 +0000 Subject: Revert [b80a6942]. Realize now that "true" was not bold because the option does not have to literally be the exact string "true" but can also be any of the other acceptable true values, such as "yes" or "t". --- doc/canvas.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/canvas.n b/doc/canvas.n index ae139db..bc29cc3 100644 --- a/doc/canvas.n +++ b/doc/canvas.n @@ -1573,7 +1573,7 @@ times) so that it also becomes a knot point. \fB\-splinesteps \fInumber\fR Specifies the degree of smoothness desired for curves: each spline will be approximated with \fInumber\fR line segments. This -option is ignored unless the \fB\-smooth\fR option is \fBtrue\fR or \fBraw\fR. +option is ignored unless the \fB\-smooth\fR option is true or \fBraw\fR. .SS "OVAL ITEMS" .PP Items of type \fBoval\fR appear as circular or oval regions on -- cgit v0.12 From 3cbff9f968ec8d9d215341a263bd40903b8a782e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 7 Jul 2015 15:20:34 +0000 Subject: Fix for [805cffb017fde5ba]: segfault via Tk_ConfigureWidget --- generic/tkOldConfig.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index 97ad5cb..d7a33f7 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -112,6 +112,10 @@ Tk_ConfigureWidget( specs = GetCachedSpecs(interp, specs); + for (specPtr = specs; specPtr->type != TK_CONFIG_END; specPtr++) { + specPtr->specFlags &= ~TK_CONFIG_OPTION_SPECIFIED; + } + /* * Pass one: scan through all of the arguments, processing those that * match entries in the specs. @@ -167,7 +171,6 @@ Tk_ConfigureWidget( if ((specPtr->specFlags & TK_CONFIG_OPTION_SPECIFIED) || (specPtr->argvName == NULL) || (specPtr->type == TK_CONFIG_SYNONYM)) { - specPtr->specFlags &= ~TK_CONFIG_OPTION_SPECIFIED; continue; } if (((specPtr->specFlags & needFlags) != needFlags) @@ -1128,7 +1131,6 @@ GetCachedSpecs( specPtr->defValue = Tk_GetUid(specPtr->defValue); } } - specPtr->specFlags &= ~TK_CONFIG_OPTION_SPECIFIED; } } else { cachedSpecs = (Tk_ConfigSpec *) Tcl_GetHashValue(entryPtr); -- cgit v0.12 From 973b6e6d17b26ec027eb3b6df3b37d9da9d9f514 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 8 Jul 2015 07:54:08 +0000 Subject: Use size_t in stead of int for some internal refCount variables. On 32-bit systems, this doubles the range (as size_t is unsigned), on 64-bit system much more than that. --- macosx/tkMacOSXDraw.c | 2 +- macosx/tkMacOSXScrlbr.c | 2 +- win/tkWinColor.c | 14 ++++++++------ win/tkWinFont.c | 5 ++--- win/tkWinWm.c | 6 ++---- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 0f6d2f0..5f31a2c 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -769,7 +769,7 @@ DrawCGImage( dstBounds.size.width, dstBounds.size.height); #else /* TK_MAC_DEBUG_IMAGE_DRAWING */ CGContextSaveGState(context); - CGContextTranslateCTM(context, 0, + CGContextTranslateCTM(context, 0, dstBounds.origin.y + CGRectGetMaxY(dstBounds)); CGContextScaleCTM(context, 1, -1); CGContextDrawImage(context, dstBounds, image); diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index 37178ed..91cf112 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -384,7 +384,7 @@ TkpScrollbarPosition( x = y; y = tmp; length = Tk_Width(scrollPtr->tkwin); - fieldlength = length - 2 * arrowSize; + fieldlength = length - 2 * arrowSize; width = Tk_Height(scrollPtr->tkwin); } fieldlength = fieldlength < 0 ? 0 : fieldlength; diff --git a/win/tkWinColor.c b/win/tkWinColor.c index 5eaeeb3..ba9815c 100644 --- a/win/tkWinColor.c +++ b/win/tkWinColor.c @@ -316,7 +316,8 @@ XAllocColor( if (GetDeviceCaps(dc, RASTERCAPS) & RC_PALETTE) { unsigned long sizePalette = GetDeviceCaps(dc, SIZEPALETTE); UINT newPixel, closePixel; - int new, refCount; + int new; + size_t refCount; Tcl_HashEntry *entryPtr; UINT index; @@ -361,9 +362,9 @@ XAllocColor( if (new) { refCount = 1; } else { - refCount = (PTR2INT(Tcl_GetHashValue(entryPtr))) + 1; + refCount = (size_t)Tcl_GetHashValue(entryPtr) + 1; } - Tcl_SetHashValue(entryPtr, INT2PTR(refCount)); + Tcl_SetHashValue(entryPtr, (void *)refCount); } else { /* * Determine what color will actually be used on non-colormap systems. @@ -407,7 +408,8 @@ XFreeColors( { TkWinColormap *cmap = (TkWinColormap *) colormap; COLORREF cref; - UINT count, index, refCount; + UINT count, index; + size_t refCount; int i; PALETTEENTRY entry, *entries; Tcl_HashEntry *entryPtr; @@ -427,7 +429,7 @@ XFreeColors( if (!entryPtr) { Tcl_Panic("Tried to free a color that isn't allocated"); } - refCount = PTR2INT(Tcl_GetHashValue(entryPtr)) - 1; + refCount = (size_t)Tcl_GetHashValue(entryPtr) - 1; if (refCount == 0) { cref = pixels[i] & 0x00ffffff; index = GetNearestPaletteIndex(cmap->palette, cref); @@ -444,7 +446,7 @@ XFreeColors( } Tcl_DeleteHashEntry(entryPtr); } else { - Tcl_SetHashValue(entryPtr, INT2PTR(refCount)); + Tcl_SetHashValue(entryPtr, (size_t)refCount); } } } diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 86f63ac..9172b00 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -33,7 +33,7 @@ typedef struct FontFamily { struct FontFamily *nextPtr; /* Next in list of all known font families. */ - int refCount; /* How many SubFonts are referring to this + size_t refCount; /* How many SubFonts are referring to this * FontFamily. When the refCount drops to * zero, this FontFamily may be freed. */ /* @@ -1869,8 +1869,7 @@ FreeFontFamily( if (familyPtr == NULL) { return; } - familyPtr->refCount--; - if (familyPtr->refCount > 0) { + if (familyPtr->refCount-- > 1) { return; } for (i = 0; i < FONTMAP_PAGES; i++) { diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 4d46fd5..768ee69 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -148,7 +148,7 @@ typedef struct { */ typedef struct WinIconInstance { - int refCount; /* Number of instances that share this data + size_t refCount; /* Number of instances that share this data * structure. */ BlockOfIconImagesPtr iconBlock; /* Pointer to icon resource data for image */ @@ -1421,9 +1421,7 @@ static void DecrIconRefCount( WinIconPtr titlebaricon) { - titlebaricon->refCount--; - - if (titlebaricon->refCount <= 0) { + if (titlebaricon->refCount-- <= 1) { if (titlebaricon->iconBlock != NULL) { FreeIconBlock(titlebaricon->iconBlock); } -- cgit v0.12 From d224bcbbfc4193df3eef7a54d4f41892eb7de0c7 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 10 Jul 2015 21:59:14 +0000 Subject: Fixed bug [3f1f79abcf] - Text widget crash when seeing or bboxing (or selecting, moving the cursor...) in elided text --- generic/tkTextIndex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index 6a60faf..b886975 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -1695,7 +1695,7 @@ IndexCountBytesOrdered( byteCount += segPtr->size; } - linePtr = indexPtr1->linePtr->nextPtr; + linePtr = TkBTreeNextLine(textPtr, indexPtr1->linePtr); while (linePtr != indexPtr2->linePtr) { for (segPtr = linePtr->segPtr; segPtr != NULL; segPtr = segPtr->nextPtr) { -- cgit v0.12 From 1b214cf0648595eb130820824655fec78109ed6c Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 11 Jul 2015 08:00:25 +0000 Subject: Added test case for bug [3f1f79abcf] --- tests/textIndex.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/textIndex.test b/tests/textIndex.test index abed3d4..e78e54b 100644 --- a/tests/textIndex.test +++ b/tests/textIndex.test @@ -943,6 +943,19 @@ test textIndex-24.1 {text mark prev} { set res } {1.0} +test textIndex-25.1 {IndexCountBytesOrdered, bug [3f1f79abcf]} { + pack [text .t2] + .t2 tag configure elided -elide 1 + .t2 insert end "01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n" + .t2 insert end "11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n" + .t2 insert end "21\n22\n23\n25\n26\n27\n28\n29\n30\n31" + .t2 insert end "32\n33\n34\n36\n37\n38\n39" elided + # then this used to crash Tk: + .t2 see end + focus -force .t2 ; # to see the cursor blink + destroy .t2 +} {} + # cleanup rename textimage {} catch {destroy .t} -- cgit v0.12 From cca425ff8bcd56986a3f6e11dd364b7b954dc121 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 13 Jul 2015 09:54:48 +0000 Subject: Fixed bad indentation in the contents table of the text widget man page of the switches pertaining to the dump subcommand --- doc/text.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/text.n b/doc/text.n index b11363d..76c2467 100644 --- a/doc/text.n +++ b/doc/text.n @@ -1255,8 +1255,8 @@ information about marks, tags, and embedded windows. If \fIindex2\fR is not specified, then it defaults to one character past \fIindex1\fR. The information is returned in the following format: -.LP .RS +.LP \fIkey1 value1 index1 key2 value2 index2\fR ... .LP The possible \fIkey\fR values are \fBtext\fR, \fBmark\fR, -- cgit v0.12 From b3db9087841c153570ebfc1edd7ac33f3dd8bbcf Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 14 Jul 2015 19:18:58 +0000 Subject: Tried to be even clearer. --- doc/text.n | 7 ++++--- generic/tkText.c | 19 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/text.n b/doc/text.n index 1ccadbb..5b7804a 100644 --- a/doc/text.n +++ b/doc/text.n @@ -1218,9 +1218,10 @@ If \fIindex2\fR is not specified then the single character at \fIindex1\fR is deleted. Attempts to delete characters in a way that would leave the text without a newline as the last character will be tweaked by the -text widget to avoid this. In particular, attempts to delete complete -lines of text up to the end of the text will result in -deletion of the newline character just preceding \fIindex1\fR. +text widget to avoid this. In particular, deletion of complete lines of +text up to the end of the text will also delete the newline character just +before the deleted block so that it is replaced by the new final newline +of the text widget. The command returns an empty string. If more indices are given, multiple ranges of text will be deleted. All indices are first checked for validity before any deletions are made. diff --git a/generic/tkText.c b/generic/tkText.c index 5042582..eb2d77a 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -3000,16 +3000,15 @@ DeleteIndexRange( * dummy empty line at the end of the text. If the final newline of the * file (just before the dummy line) is being deleted, then back up index * to just before the newline. If there is a newline just before the first - * character being deleted, then back up the first index too, so that an - * even number of lines gets deleted. The idea is that a deletion - * involving a range starting at a line start and including the final \n - * (i.e. index2 is "end") is an attempt to delete complete lines, so the - * \n before the deleted block shall become the new final \n. Furthermore, - * remove any tags that are present on the newline that isn't going to be - * deleted after all (this simulates deleting the newline and then adding - * a "clean" one back again). Note that index1 and index2 might now be - * equal again which means that no text will be deleted but tags might be - * removed. + * character being deleted, then back up the first index too. The idea is + * that a deletion involving a range starting at a line start and + * including the final \n (i.e. index2 is "end") is an attempt to delete + * complete lines, so the \n before the deleted block shall become the new + * final \n. Furthermore, remove any tags that are present on the newline + * that isn't going to be deleted after all (this simulates deleting the + * newline and then adding a "clean" one back again). Note that index1 and + * index2 might now be equal again which means that no text will be + * deleted but tags might be removed. */ line1 = TkBTreeLinesTo(textPtr, index1.linePtr); -- cgit v0.12 From 3a83abc685b4ac6238014a7064f3384f2282a202 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 14 Jul 2015 19:50:15 +0000 Subject: Fixed bug [2886436fff] - [.txt delete] deletes before start index - This is option 1: change the behavior of the text widget to completely avoid any deletion before index1 --- generic/tkText.c | 12 +++--------- tests/text.test | 3 ++- tests/textDisp.test | 8 ++++---- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 139e71d..f023509 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2999,11 +2999,9 @@ DeleteIndexRange( * The code below is ugly, but it's needed to make sure there is always a * dummy empty line at the end of the text. If the final newline of the * file (just before the dummy line) is being deleted, then back up index - * to just before the newline. If there is a newline just before the first - * character being deleted, then back up the first index too, so that an - * even number of lines gets deleted. Furthermore, remove any tags that - * are present on the newline that isn't going to be deleted after all - * (this simulates deleting the newline and then adding a "clean" one back + * to just before the newline. Furthermore, remove any tags that are + * present on the newline that isn't going to be deleted after all (this + * simulates deleting the newline and then adding a "clean" one back * again). Note that index1 and index2 might now be equal again which * means that no text will be deleted but tags might be removed. */ @@ -3018,10 +3016,6 @@ DeleteIndexRange( oldIndex2 = index2; TkTextIndexBackChars(NULL, &oldIndex2, 1, &index2, COUNT_INDICES); line2--; - if ((index1.byteIndex == 0) && (line1 != 0)) { - TkTextIndexBackChars(NULL, &index1, 1, &index1, COUNT_INDICES); - line1--; - } arrayPtr = TkBTreeGetTags(&index2, NULL, &arraySize); if (arrayPtr != NULL) { for (i = 0; i < arraySize; i++) { diff --git a/tests/text.test b/tests/text.test index e75f38a..53196be 100644 --- a/tests/text.test +++ b/tests/text.test @@ -1267,9 +1267,10 @@ test text-17.8 {DeleteChars procedure} { .t tag add sel 1.0 end .t delete 4.0 end list [.t tag ranges sel] [.t get 1.0 end] -} {{1.0 3.5} {Line 1 +} {{1.0 4.0} {Line 1 abcde 12345 + }} test text-17.9 {DeleteChars procedure} { setup diff --git a/tests/textDisp.test b/tests/textDisp.test index aed842c..dbfeb95 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -653,7 +653,7 @@ test textDisp-4.9 {UpdateDisplayInfo, filling in extra vertical space} {textfont update .t delete 15.0 end list [.t bbox 7.0] [.t bbox 12.0] -} [list [list 3 [expr {2*$fixedDiff + 29}] 7 $fixedHeight] [list 3 [expr {7*$fixedDiff + 94}] 7 $fixedHeight]] +} [list [list 3 [expr {2*$fixedDiff + 14}] 7 $fixedHeight] [list 3 [expr {7*$fixedDiff + 79}] 7 $fixedHeight]] test textDisp-4.10 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" @@ -662,7 +662,7 @@ test textDisp-4.10 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 13.0 end update list [.t index @0,0] $tk_textRelayout $tk_textRedraw -} {5.0 {12.0 7.0 6.40 6.20 6.0 5.0} {5.0 6.0 6.20 6.40 7.0 12.0}} +} {6.0 {13.0 7.0 6.40 6.20 6.0} {6.0 6.20 6.40 7.0 13.0}} test textDisp-4.11 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around, not once but really quite a few times.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" @@ -671,7 +671,7 @@ test textDisp-4.11 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 14.0 end update list [.t index @0,0] $tk_textRelayout $tk_textRedraw -} {6.40 {13.0 7.0 6.80 6.60 6.40} {6.40 6.60 6.80 7.0 13.0}} +} {6.60 {14.0 7.0 6.80 6.60} {6.60 6.80 7.0 14.0}} test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16" @@ -3659,7 +3659,7 @@ test textDisp-28.1 {"yview" option with bizarre scroll command} { set result [.t2.t index @0,0] update lappend result [.t2.t index @0,0] -} {6.0 1.0} +} {6.0 2.0} test textDisp-29.1 {miscellaneous: lines wrap but are still too long} {textfonts} { catch {destroy .t2} -- cgit v0.12 From adea617f01759681e698094d620382857d9d5f0f Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 14 Jul 2015 20:14:02 +0000 Subject: Bug [1247115fff] - Added -proxyrelief option --- doc/panedwindow.n | 3 +++ generic/tkPanedWindow.c | 6 +++++- macosx/tkMacOSXDefault.h | 1 + tests/panedwindow.test | 19 +++++++++++-------- unix/tkUnixDefault.h | 1 + win/tkWinDefault.h | 1 + 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/doc/panedwindow.n b/doc/panedwindow.n index 53a7238..838587e 100644 --- a/doc/panedwindow.n +++ b/doc/panedwindow.n @@ -29,6 +29,9 @@ drawn as squares. May be any value accepted by \fBTk_GetPixels\fR. Specifies a desired height for the overall panedwindow widget. May be any value accepted by \fBTk_GetPixels\fR. If an empty string, the widget will be made high enough to allow all contained widgets to have their natural height. +.OP \-proxyrelief proxyRelief ProxyRelief +Relief to use when drawing the proxy. May be any of the standard Tk +relief values. .OP \-opaqueresize opaqueResize OpaqueResize Specifies whether panes should be resized as a sash is moved (true), or if resizing should be deferred until the sash is placed (false). diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 6a3766b..c7d5339 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -147,6 +147,7 @@ typedef struct PanedWindow { GC gc; /* Graphics context for copying from * off-screen pixmap onto screen. */ int proxyx, proxyy; /* Proxy x,y coordinates. */ + int proxyRelief; /* Relief used to draw proxy. */ Slave **slaves; /* Pointer to array of Slaves. */ int numSlaves; /* Number of slaves. */ int sizeofSlaves; /* Number of elements in the slaves array. */ @@ -298,6 +299,9 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", DEF_PANEDWINDOW_ORIENT, -1, Tk_Offset(PanedWindow, orient), 0, (ClientData) orientStrings, GEOMETRY}, + {TK_OPTION_RELIEF, "-proxyrelief", "proxyRelief", "Relief", + DEF_PANEDWINDOW_PROXYRELIEF, -1, Tk_Offset(PanedWindow, proxyRelief), + 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_PANEDWINDOW_RELIEF, -1, Tk_Offset(PanedWindow, relief), 0, 0, 0}, {TK_OPTION_CURSOR, "-sashcursor", "sashCursor", "Cursor", @@ -2770,7 +2774,7 @@ DisplayProxyWindow( */ Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->background, 0, 0, - Tk_Width(tkwin), Tk_Height(tkwin), 2, pwPtr->sashRelief); + Tk_Width(tkwin), Tk_Height(tkwin), 2, pwPtr->proxyRelief); #ifndef TK_NO_DOUBLE_BUFFERING /* diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index 0380de9..ad92dc6 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -409,6 +409,7 @@ #define DEF_PANEDWINDOW_HEIGHT "" #define DEF_PANEDWINDOW_OPAQUERESIZE "1" #define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_PROXYRELIEF "flat" #define DEF_PANEDWINDOW_RELIEF "flat" #define DEF_PANEDWINDOW_SASHCURSOR "" #define DEF_PANEDWINDOW_SASHPAD "0" diff --git a/tests/panedwindow.test b/tests/panedwindow.test index 724b40d..f66b35e 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -29,24 +29,27 @@ foreach {testName testData} { 20 20 badValue {bad screen distance "badValue"}} panedwindow-1.8 {-opaqueresize true 1 foo {expected boolean value but got "foo"}} - panedwindow-1.9 {-orient + panedwindow-1.9 {-proxyrelief + groove groove + 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} + panedwindow-1.10 {-orient horizontal horizontal badValue {bad orient "badValue": must be horizontal or vertical}} - panedwindow-1.10 {-relief + panedwindow-1.11 {-relief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} - panedwindow-1.11 {-sashcursor + panedwindow-1.12 {-sashcursor arrow arrow badValue {bad cursor spec "badValue"}} - panedwindow-1.12 {-sashpad + panedwindow-1.13 {-sashpad 1.3 1 badValue {bad screen distance "badValue"}} - panedwindow-1.13 {-sashrelief + panedwindow-1.14 {-sashrelief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} - panedwindow-1.14 {-sashwidth + panedwindow-1.15 {-sashwidth 10 10 badValue {bad screen distance "badValue"}} - panedwindow-1.15 {-showhandle + panedwindow-1.16 {-showhandle true 1 foo {expected boolean value but got "foo"}} - panedwindow-1.16 {-width + panedwindow-1.17 {-width 402 402 badValue {bad screen distance "badValue"}} } { lassign $testData optionName goodIn goodOut badIn badOut diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h index 4eb8778..78b10f5 100644 --- a/unix/tkUnixDefault.h +++ b/unix/tkUnixDefault.h @@ -367,6 +367,7 @@ #define DEF_PANEDWINDOW_HEIGHT "" #define DEF_PANEDWINDOW_OPAQUERESIZE "1" #define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_PROXYRELIEF "flat" #define DEF_PANEDWINDOW_RELIEF "flat" #define DEF_PANEDWINDOW_SASHCURSOR "" #define DEF_PANEDWINDOW_SASHPAD "0" diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h index a1a76c7..19cbf31 100644 --- a/win/tkWinDefault.h +++ b/win/tkWinDefault.h @@ -370,6 +370,7 @@ #define DEF_PANEDWINDOW_HEIGHT "" #define DEF_PANEDWINDOW_OPAQUERESIZE "1" #define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_PROXYRELIEF "flat" #define DEF_PANEDWINDOW_RELIEF "flat" #define DEF_PANEDWINDOW_SASHCURSOR "" #define DEF_PANEDWINDOW_SASHPAD "0" -- cgit v0.12 From dfde3458e7bc27e3eef496b2b65d38a93092b9aa Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 14 Jul 2015 20:21:38 +0000 Subject: Fixed extra space --- doc/panedwindow.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/panedwindow.n b/doc/panedwindow.n index 838587e..b9df08e 100644 --- a/doc/panedwindow.n +++ b/doc/panedwindow.n @@ -30,7 +30,7 @@ Specifies a desired height for the overall panedwindow widget. May be any value accepted by \fBTk_GetPixels\fR. If an empty string, the widget will be made high enough to allow all contained widgets to have their natural height. .OP \-proxyrelief proxyRelief ProxyRelief -Relief to use when drawing the proxy. May be any of the standard Tk +Relief to use when drawing the proxy. May be any of the standard Tk relief values. .OP \-opaqueresize opaqueResize OpaqueResize Specifies whether panes should be resized as a sash is moved (true), -- cgit v0.12 From 4f75be674fee3a89f9c8d99df95c2a9b668b8937 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 15 Jul 2015 13:27:58 +0000 Subject: Fix signature of TkMacOSXSetDrawingEnabled(), re-generate tkIntPlatDecls.h and tkStubInit.c --- generic/tkInt.decls | 2 +- generic/tkIntPlatDecls.h | 7 +++++-- generic/tkStubInit.c | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 7921852..f24d48c 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -957,7 +957,7 @@ declare 51 aqua { void TkGenWMDestroyEvent(Tk_Window tkwin) } declare 52 aqua { - TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); + void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag) } # removed duplicate from tkPlat table (tk.decls) diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 7654b5d..86127fe 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -723,7 +723,7 @@ typedef struct TkIntPlatStubs { Window (*tkGetTransientMaster) (TkWindow *winPtr); /* 49 */ int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */ void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */ - VOID *reserved52; + void (*tkMacOSXSetDrawingEnabled) (TkWindow *winPtr, int flag); /* 52 */ unsigned long (*tkpGetMS) (void); /* 53 */ VOID * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ int (*tkpScanWindowId) (Tcl_Interp *interp, CONST char *string, Window *idPtr); /* 55 */ @@ -1129,7 +1129,10 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; #define TkGenWMDestroyEvent \ (tkIntPlatStubsPtr->tkGenWMDestroyEvent) /* 51 */ #endif -/* Slot 52 is reserved */ +#ifndef TkMacOSXSetDrawingEnabled +#define TkMacOSXSetDrawingEnabled \ + (tkIntPlatStubsPtr->tkMacOSXSetDrawingEnabled) /* 52 */ +#endif #ifndef TkpGetMS #define TkpGetMS \ (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 3ee54dd..90a124f 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -588,7 +588,7 @@ TkIntPlatStubs tkIntPlatStubs = { TkGetTransientMaster, /* 49 */ TkGenerateButtonEvent, /* 50 */ TkGenWMDestroyEvent, /* 51 */ - NULL, /* 52 */ + TkMacOSXSetDrawingEnabled, /* 52 */ TkpGetMS, /* 53 */ TkMacOSXDrawable, /* 54 */ TkpScanWindowId, /* 55 */ -- cgit v0.12 From f286e06ad2da094e8154ec23f9b379d5cadd4f2d Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 28 Jul 2015 20:30:08 +0000 Subject: Fixed bug [1236306fff] - TraverseToMenu error with alt binding to toplevel destroy --- library/menu.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/menu.tcl b/library/menu.tcl index fd814b3..4875477 100644 --- a/library/menu.tcl +++ b/library/menu.tcl @@ -1037,7 +1037,7 @@ proc ::tk::MenuFind {w char} { proc ::tk::TraverseToMenu {w char} { variable ::tk::Priv - if {$char eq ""} { + if {![winfo exists $w] || $char eq ""} { return } while {[winfo class $w] eq "Menu"} { -- cgit v0.12 From 5da8b2cf18ec7d214d94b627b90307d055afd46f Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 28 Jul 2015 22:17:23 +0000 Subject: Made textDisp-4.9 more robust to font variations across platforms, so that it passes on Linux Debian 6.0 --- tests/textDisp.test | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/textDisp.test b/tests/textDisp.test index dbfeb95..a6bbfd7 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -615,6 +615,10 @@ catch {destroy .f2} .t configure -borderwidth 0 -wrap char wm geom . {} update +set bw [.t cget -borderwidth] +set px [.t cget -padx] +set py [.t cget -pady] +set hlth [.t cget -highlightthickness] test textDisp-4.7 {UpdateDisplayInfo, filling in extra vertical space} { # This test was failing on Windows because the title bar on . # was a certain minimum size and it was interfering with the size @@ -653,7 +657,7 @@ test textDisp-4.9 {UpdateDisplayInfo, filling in extra vertical space} {textfont update .t delete 15.0 end list [.t bbox 7.0] [.t bbox 12.0] -} [list [list 3 [expr {2*$fixedDiff + 14}] 7 $fixedHeight] [list 3 [expr {7*$fixedDiff + 79}] 7 $fixedHeight]] +} [list [list [expr {$hlth + $px + $bw}] [expr {$hlth + $py + $bw + $fixedHeight}] $fixedWidth $fixedHeight] [list [expr {$hlth + $px + $bw}] [expr {$hlth + $py + $bw + 6 * $fixedHeight}] $fixedWidth $fixedHeight]] test textDisp-4.10 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end .t insert end "1\n2\n3\n4\n5\nLine 6 is such a long line that it wraps around.\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17" -- cgit v0.12 From 47ca3a5ac9ec9e2f21a3efeb9bb4bda85526a3e7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 3 Aug 2015 23:40:28 +0000 Subject: Fix [6fe75131c546226b]: doc: tk_messageBox (mac) --- doc/messageBox.n | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/doc/messageBox.n b/doc/messageBox.n index bbeffee..5ce1745 100644 --- a/doc/messageBox.n +++ b/doc/messageBox.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tk_messageBox n 4.2 Tk "Tk Built-In Commands" .so man.macros .BS @@ -13,7 +13,6 @@ tk_messageBox \- pops up a message window and waits for user response. .SH SYNOPSIS \fBtk_messageBox \fR?\fIoption value ...\fR? .BE - .SH DESCRIPTION .PP This procedure creates and displays a message window with an @@ -22,70 +21,84 @@ the buttons in the message window is identified by a unique symbolic name (see the \fB\-type\fR options). After the message window is popped up, \fBtk_messageBox\fR waits for the user to select one of the buttons. Then it returns the symbolic name of the selected button. - +.PP The following option-value pairs are supported: .TP \fB\-default\fR \fIname\fR +. \fIName\fR gives the symbolic name of the default button for this message window ( .QW ok , .QW cancel , -and so on). See \fB\-type\fR +and so on). See \fB\-type\fR for a list of the symbolic names. If this option is not specified, the first button in the dialog will be made the default. .TP \fB\-detail\fR \fIstring\fR -.VS 8.5 +. Specifies an auxiliary message to the main message given by the -\fB\-message\fR option. Where supported by the underlying OS, the -message detail will be presented in a less emphasized font than the +\fB\-message\fR option. The message detail will be presented beneath the main +message and, where supported by the OS, in a less emphasized font than the main message. -.VE 8.5 .TP \fB\-icon\fR \fIiconImage\fR +. Specifies an icon to display. \fIIconImage\fR must be one of the following: \fBerror\fR, \fBinfo\fR, \fBquestion\fR or \fBwarning\fR. If this option is not specified, then the info icon will be displayed. .TP \fB\-message\fR \fIstring\fR -Specifies the message to display in this message box. +. +Specifies the message to display in this message box. The +default value is an empty string. .TP \fB\-parent\fR \fIwindow\fR +. Makes \fIwindow\fR the logical parent of the message box. The message box is displayed on top of its parent window. .TP \fB\-title\fR \fItitleString\fR -Specifies a string to display as the title of the message box. The -default value is an empty string. +. +Specifies a string to display as the title of the message box. This option +is ignored on Mac OS X, where platform guidelines forbid the use of a title +on this kind of dialog. .TP \fB\-type\fR \fIpredefinedType\fR +. Arranges for a predefined set of buttons to be displayed. The following values are possible for \fIpredefinedType\fR: .RS .TP 18 \fBabortretryignore\fR +. Displays three buttons whose symbolic names are \fBabort\fR, \fBretry\fR and \fBignore\fR. .TP 18 \fBok\fR +. Displays one button whose symbolic name is \fBok\fR. .TP 18 \fBokcancel\fR +. Displays two buttons whose symbolic names are \fBok\fR and \fBcancel\fR. .TP 18 \fBretrycancel\fR +. Displays two buttons whose symbolic names are \fBretry\fR and \fBcancel\fR. .TP 18 \fByesno\fR +. Displays two buttons whose symbolic names are \fByes\fR and \fBno\fR. .TP 18 \fByesnocancel\fR +. Displays three buttons whose symbolic names are \fByes\fR, \fBno\fR and \fBcancel\fR. .RE .PP .SH EXAMPLE +.PP .CS set answer [\fBtk_messageBox\fR \-message "Really quit?" \e \-icon question \-type yesno \e @@ -96,6 +109,8 @@ switch \-\- $answer { \-type ok} } .CE - .SH KEYWORDS message box +'\" Local Variables: +'\" mode: nroff +'\" End: -- cgit v0.12 From 3525b8b01c138cbc30c498a9e0f9a587dab26e32 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 5 Aug 2015 20:33:00 +0000 Subject: Remove various unnecessary "global tcl_platform" occurrences, which are no longer used. Add "Fit To Screen Width" menu entry to Windows (and android) console menu. Ported from androwish. --- library/bgerror.tcl | 2 +- library/console.tcl | 34 ++++++++++++++++++++++++++++------ library/demos/aniwave.tcl | 2 +- library/demos/fontchoose.tcl | 2 +- library/demos/knightstour.tcl | 4 ++-- library/demos/menu.tcl | 2 +- library/demos/menubu.tcl | 2 +- library/demos/msgbox.tcl | 4 ++-- library/demos/puzzle.tcl | 2 +- library/dialog.tcl | 1 - library/entry.tcl | 1 - library/menu.tcl | 11 ++--------- library/msgbox.tcl | 2 +- library/spinbox.tcl | 1 - library/text.tcl | 2 -- library/tk.tcl | 1 - 16 files changed, 41 insertions(+), 32 deletions(-) diff --git a/library/bgerror.tcl b/library/bgerror.tcl index d1ed60a..b15387e 100644 --- a/library/bgerror.tcl +++ b/library/bgerror.tcl @@ -98,7 +98,7 @@ proc ::tk::dialog::error::ReturnInDetails w { # err - The error message. # proc ::tk::dialog::error::bgerror err { - global errorInfo tcl_platform + global errorInfo variable button set info $errorInfo diff --git a/library/console.tcl b/library/console.tcl index 566140f..ba68ccc 100644 --- a/library/console.tcl +++ b/library/console.tcl @@ -41,8 +41,6 @@ interp alias {} EvalAttached {} consoleinterp eval # None. proc ::tk::ConsoleInit {} { - global tcl_platform - if {![consoleinterp eval {set tcl_interactive}]} { wm withdraw . } @@ -78,7 +76,7 @@ proc ::tk::ConsoleInit {} { AmpMenuArgs .menubar.edit add command -label [mc P&aste] -accel "$mod+V"\ -command {event generate .console <>} - if {$tcl_platform(platform) ne "windows"} { + if {[tk windowingsystem] ne "win32"} { AmpMenuArgs .menubar.edit add command -label [mc Cl&ear] \ -command {event generate .console <>} } else { @@ -114,6 +112,8 @@ proc ::tk::ConsoleInit {} { -accel "$mod++" -command {event generate .console <>} AmpMenuArgs .menubar.edit add command -label [mc "&Decrease Font Size"] \ -accel "$mod+-" -command {event generate .console <>} + AmpMenuArgs .menubar.edit add command -label [mc "Fit To Screen Width"] \ + -command {event generate .console <>} if {[tk windowingsystem] eq "aqua"} { .menubar add cascade -label [mc Window] -menu [menu .menubar.window] @@ -193,7 +193,7 @@ proc ::tk::ConsoleInit {} { $w mark set promptEnd insert $w mark gravity promptEnd left - if {$tcl_platform(platform) eq "windows"} { + if {[tk windowingsystem] ne "aqua"} { # Subtle work-around to erase the '% ' that tclMain.c prints out after idle [subst -nocommand { if {[$con get 1.0 output] eq "% "} { $con delete 1.0 output } @@ -378,6 +378,26 @@ proc ::tk::console::Paste {w} { } } +# Fit TkConsoleFont to window width +proc ::tk::console::FitScreenWidth {w} { + set width [winfo screenwidth $w] + set cwidth [$w cget -width] + set s -50 + set fit 0 + array set fi [font configure TkConsoleFont] + while {$s < 0} { + set fi(-size) $s + set f [font create {*}[array get fi]] + set c [font measure $f "eM"] + font delete $f + if {$c * $cwidth < 1.667 * $width} { + font configure TkConsoleFont -size $s + break + } + incr s 2 + } +} + # ::tk::ConsoleBind -- # This procedure first ensures that the default bindings for the Text # class have been defined. Then certain bindings are overridden for @@ -600,6 +620,9 @@ proc ::tk::ConsoleBind {w} { tk fontchooser configure -font TkConsoleFont } } + bind Console <> { + ::tk::console::FitScreenWidth %W + } ## ## Bindings for doing special things based on certain keys @@ -987,8 +1010,7 @@ proc ::tk::console::ExpandPathname str { set match {} } else { if {[llength $m] > 1} { - global tcl_platform - if {[string match windows $tcl_platform(platform)]} { + if { $::tcl_platform(platform) eq "windows" } { ## Windows is screwy because it's case insensitive set tmp [ExpandBestMatch [string tolower $m] \ [string tolower $dir]] diff --git a/library/demos/aniwave.tcl b/library/demos/aniwave.tcl index 6122132..a7539fb 100644 --- a/library/demos/aniwave.tcl +++ b/library/demos/aniwave.tcl @@ -17,7 +17,7 @@ wm title $w "Animated Wave Demonstration" wm iconname $w "aniwave" positionWindow $w -label $w.msg -font $font -wraplength 4i -justify left -text "This demonstration contains a canvas widget with a line item inside it. The animation routines work by adjusting the coordinates list of the line; a trace on a variable is used so updates to the variable result in a change of position of the line." +label $w.msg -font $font -wraplength 4i -justify left -text "This demonstration contains a canvas widget with a line item inside it. The animation routines work by adjusting the coordinates list of the line; a trace on a variable is used so updates to the variable result in a change of position of the line." pack $w.msg -side top ## See Code / Dismiss buttons diff --git a/library/demos/fontchoose.tcl b/library/demos/fontchoose.tcl index def30c3..8b34377 100644 --- a/library/demos/fontchoose.tcl +++ b/library/demos/fontchoose.tcl @@ -57,7 +57,7 @@ grid columnconfigure $f 0 -weight 1 grid rowconfigure $f 0 -weight 1 bind $w { bind %W {} - grid propagate %W.f 0 + grid propagate %W.f 0 } ## See Code / Dismiss buttons diff --git a/library/demos/knightstour.tcl b/library/demos/knightstour.tcl index 73ca3a3..6113db2 100644 --- a/library/demos/knightstour.tcl +++ b/library/demos/knightstour.tcl @@ -221,7 +221,7 @@ proc CreateGUI {} { $c bind knight [namespace code [list DragStart %W %x %y]] $c bind knight [namespace code [list DragMotion %W %x %y]] $c bind knight [namespace code [list DragEnd %W %x %y]] - + grid $c $f.txt $f.vs -sticky news grid rowconfigure $f 0 -weight 1 grid columnconfigure $f 1 -weight 1 @@ -244,7 +244,7 @@ proc CreateGUI {} { if {[info exists ::widgetDemo]} { grid [addSeeDismiss $dlg.buttons $dlg] - - - - - -sticky ew } - + grid rowconfigure $dlg 0 -weight 1 grid columnconfigure $dlg 0 -weight 1 diff --git a/library/demos/menu.tcl b/library/demos/menu.tcl index e19df57..e32b54f 100644 --- a/library/demos/menu.tcl +++ b/library/demos/menu.tcl @@ -16,7 +16,7 @@ wm title $w "Menu Demonstration" wm iconname $w "menu" positionWindow $w -label $w.msg -font $font -wraplength 4i -justify left +label $w.msg -font $font -wraplength 4i -justify left if {[tk windowingsystem] eq "aqua"} { catch {set origUseCustomMDEF $::tk::mac::useCustomMDEF; set ::tk::mac::useCustomMDEF 1} $w.msg configure -text "This window has a menubar with cascaded menus. You can invoke entries with an accelerator by typing Command+x, where \"x\" is the character next to the command key symbol. The rightmost menu can be torn off into a palette by selecting the first item in the menu." diff --git a/library/demos/menubu.tcl b/library/demos/menubu.tcl index 86326b5..96e3b15 100644 --- a/library/demos/menubu.tcl +++ b/library/demos/menubu.tcl @@ -21,7 +21,7 @@ pack $w.body -expand 1 -fill both if {[tk windowingsystem] eq "aqua"} {catch {set origUseCustomMDEF $::tk::mac::useCustomMDEF; set ::tk::mac::useCustomMDEF 1}} menubutton $w.body.below -text "Below" -underline 0 -direction below -menu $w.body.below.m -relief raised -menu $w.body.below.m -tearoff 0 +menu $w.body.below.m -tearoff 0 $w.body.below.m add command -label "Below menu: first item" -command "puts \"You have selected the first item from the Below menu.\"" $w.body.below.m add command -label "Below menu: second item" -command "puts \"You have selected the second item from the Below menu.\"" grid $w.body.below -row 0 -column 1 -sticky n diff --git a/library/demos/msgbox.tcl b/library/demos/msgbox.tcl index bd98bf2..2c2cc2d 100644 --- a/library/demos/msgbox.tcl +++ b/library/demos/msgbox.tcl @@ -23,7 +23,7 @@ pack [addSeeDismiss $w.buttons $w {} { }] -side bottom -fill x #pack $w.buttons.dismiss $w.buttons.code $w.buttons.vars -side left -expand 1 -frame $w.left +frame $w.left frame $w.right pack $w.left $w.right -side left -expand yes -fill y -pady .5c -padx .5c @@ -56,7 +56,7 @@ proc showMessageBox {w} { set button [tk_messageBox -icon $msgboxIcon -type $msgboxType \ -title Message -parent $w\ -message "This is a \"$msgboxType\" type messagebox with the \"$msgboxIcon\" icon"] - + tk_messageBox -icon info -message "You have selected \"$button\"" -type ok\ -parent $w } diff --git a/library/demos/puzzle.tcl b/library/demos/puzzle.tcl index fb8ab4c..4f7f955 100644 --- a/library/demos/puzzle.tcl +++ b/library/demos/puzzle.tcl @@ -54,7 +54,7 @@ pack $btns -side bottom -fill x scrollbar $w.s # The button metrics are a bit bigger in Aqua, and since we are -# using place which doesn't autosize, then we need to have a +# using place which doesn't autosize, then we need to have a # slightly larger frame here... if {[tk windowingsystem] eq "aqua"} { diff --git a/library/dialog.tcl b/library/dialog.tcl index 22c4dd3..c751621 100644 --- a/library/dialog.tcl +++ b/library/dialog.tcl @@ -28,7 +28,6 @@ # bottom of the dialog box. proc ::tk_dialog {w title text bitmap default args} { - global tcl_platform variable ::tk::Priv # Check that $default was properly given diff --git a/library/entry.tcl b/library/entry.tcl index c8422dc..f7170f7 100644 --- a/library/entry.tcl +++ b/library/entry.tcl @@ -46,7 +46,6 @@ bind Entry <> { } } bind Entry <> { - global tcl_platform catch { if {[tk windowingsystem] ne "x11"} { catch { diff --git a/library/menu.tcl b/library/menu.tcl index 5a5d9de..a7aaa3f 100644 --- a/library/menu.tcl +++ b/library/menu.tcl @@ -248,7 +248,6 @@ proc ::tk::MbLeave w { proc ::tk::MbPost {w {x {}} {y {}}} { global errorInfo variable ::tk::Priv - global tcl_platform if {[$w cget -state] eq "disabled" || $w eq $Priv(postedMb)} { return @@ -402,7 +401,6 @@ proc ::tk::MbPost {w {x {}} {y {}}} { # is a posted menubutton. proc ::tk::MenuUnpost menu { - global tcl_platform variable ::tk::Priv set mb $Priv(postedMb) @@ -531,7 +529,6 @@ proc ::tk::MbMotion {w upDown rootx rooty} { proc ::tk::MbButtonUp w { variable ::tk::Priv - global tcl_platform set menu [$w cget -menu] set tearoff [expr {[tk windowingsystem] eq "x11" || \ @@ -606,7 +603,6 @@ proc ::tk::MenuMotion {menu x y state} { proc ::tk::MenuButtonDown menu { variable ::tk::Priv - global tcl_platform if {![winfo viewable $menu]} { return @@ -1218,8 +1214,6 @@ proc ::tk::MenuFindName {menu s} { # upper-left corner goes at (x,y). proc ::tk::PostOverPoint {menu x y {entry {}}} { - global tcl_platform - if {$entry ne ""} { if {$entry == [$menu index last]} { incr y [expr {-([$menu yposition $entry] \ @@ -1234,8 +1228,8 @@ proc ::tk::PostOverPoint {menu x y {entry {}}} { if {[tk windowingsystem] eq "win32"} { # osVersion is not available in safe interps set ver 5 - if {[info exists tcl_platform(osVersion)]} { - scan $tcl_platform(osVersion) %d ver + if {[info exists ::tcl_platform(osVersion)]} { + scan $::tcl_platform(osVersion) %d ver } # We need to fix some problems with menu posting on Windows, @@ -1340,7 +1334,6 @@ proc ::tk::GenerateMenuSelect {menu} { proc ::tk_popup {menu x y {entry {}}} { variable ::tk::Priv - global tcl_platform if {$Priv(popup) ne "" || $Priv(postedMb) ne ""} { tk::MenuUnpost {} } diff --git a/library/msgbox.tcl b/library/msgbox.tcl index 939928d..6d329c2 100644 --- a/library/msgbox.tcl +++ b/library/msgbox.tcl @@ -129,7 +129,7 @@ static unsigned char w3_bits[] = { # See the user documentation for details on what tk_messageBox does. # proc ::tk::MessageBox {args} { - global tcl_platform tk_strictMotif + global tk_strictMotif variable ::tk::Priv set w ::tk::PrivMsgBox diff --git a/library/spinbox.tcl b/library/spinbox.tcl index 4d94420..6a5f829 100644 --- a/library/spinbox.tcl +++ b/library/spinbox.tcl @@ -52,7 +52,6 @@ bind Spinbox <> { } } bind Spinbox <> { - global tcl_platform catch { if {[tk windowingsystem] ne "x11"} { catch { diff --git a/library/text.tcl b/library/text.tcl index 279e2d9..18fed2c 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -543,7 +543,6 @@ proc ::tk::TextAnchor {w} { } proc ::tk::TextSelectTo {w x y {extend 0}} { - global tcl_platform variable ::tk::Priv set anchorname [tk::TextAnchor $w] @@ -1036,7 +1035,6 @@ proc ::tk_textCut w { # w - Name of a text widget. proc ::tk_textPaste w { - global tcl_platform if {![catch {::tk::GetSelection $w CLIPBOARD} sel]} { set oldSeparator [$w cget -autoseparators] if {$oldSeparator} { diff --git a/library/tk.tcl b/library/tk.tcl index da619e6..9a6a581 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -253,7 +253,6 @@ proc ::tk::ScreenChanged screen { uplevel #0 [list upvar #0 ::tk::Priv.$disp ::tk::Priv] variable ::tk::Priv - global tcl_platform if {[info exists Priv]} { set Priv(screen) $screen -- cgit v0.12 From 4660929af627a46789752dc4856f013ed2b5653a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 18 Aug 2015 14:41:55 +0000 Subject: minor spacing, no functional change. --- generic/tkOldConfig.c | 2 +- library/demos/ixset | 4 ++-- library/demos/square | 2 +- library/msgs/es.msg | 4 ++-- library/msgs/ru.msg | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index 87f4987..920d93e 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -114,7 +114,7 @@ Tk_ConfigureWidget( staticSpecs = GetCachedSpecs(interp, specs); for (specPtr = staticSpecs; specPtr->type != TK_CONFIG_END; specPtr++) { - specPtr->specFlags &= ~TK_CONFIG_OPTION_SPECIFIED; + specPtr->specFlags &= ~TK_CONFIG_OPTION_SPECIFIED; } /* diff --git a/library/demos/ixset b/library/demos/ixset index 06b644d..ee6e072 100644 --- a/library/demos/ixset +++ b/library/demos/ixset @@ -186,12 +186,12 @@ proc createwindows {} { # frame .buttons - button .buttons.ok -default active -command ok -text "Ok" + button .buttons.ok -default active -command ok -text "Ok" button .buttons.apply -default normal -command apply -text "Apply" \ -state disabled button .buttons.cancel -default normal -command cancel -text "Cancel" \ -state disabled - button .buttons.quit -default normal -command quit -text "Quit" + button .buttons.quit -default normal -command quit -text "Quit" pack .buttons.ok .buttons.apply .buttons.cancel .buttons.quit \ -side left -expand yes -pady 5 diff --git a/library/demos/square b/library/demos/square index 08c362b..1d7eb20 100644 --- a/library/demos/square +++ b/library/demos/square @@ -7,7 +7,7 @@ exec wish "$0" ${1+"$@"} # widget. It's only usable in the "tktest" application or if Tk has # been compiled with tkSquare.c. This demo arranges the following # bindings for the widget: -# +# # Button-1 press/drag: moves square to mouse # "a": toggle size animation on/off diff --git a/library/msgs/es.msg b/library/msgs/es.msg index 991711b..578c52c 100644 --- a/library/msgs/es.msg +++ b/library/msgs/es.msg @@ -1,7 +1,7 @@ namespace eval ::tk { ::msgcat::mcset es "&Abort" "&Abortar" ::msgcat::mcset es "&About..." "&Acerca de ..." - ::msgcat::mcset es "All Files" "Todos los archivos" + ::msgcat::mcset es "All Files" "Todos los archivos" ::msgcat::mcset es "Application Error" "Error de la aplicaci\u00f3n" ::msgcat::mcset es "&Blue" "&Azul" ::msgcat::mcset es "Cancel" "Cancelar" @@ -61,7 +61,7 @@ namespace eval ::tk { ::msgcat::mcset es "Tcl Scripts" "Scripts Tcl" ::msgcat::mcset es "Tcl for Windows" "Tcl para Windows" ::msgcat::mcset es "Text Files" "Archivos de texto" - ::msgcat::mcset es "&Yes" "&S\u00ed" + ::msgcat::mcset es "&Yes" "&S\u00ed" ::msgcat::mcset es "abort" "abortar" ::msgcat::mcset es "blue" "azul" ::msgcat::mcset es "cancel" "cancelar" diff --git a/library/msgs/ru.msg b/library/msgs/ru.msg index be2b551..2aac5bb 100644 --- a/library/msgs/ru.msg +++ b/library/msgs/ru.msg @@ -18,7 +18,7 @@ namespace eval ::tk { ::msgcat::mcset ru "Details >>" "\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 >>" ::msgcat::mcset ru "Directory \"%1\$s\" does not exist." "\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \"%1\$s\" \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442." ::msgcat::mcset ru "&Directory:" "&\u041a\u0430\u0442\u0430\u043b\u043e\u0433:" - ::msgcat::mcset ru "Error: %1\$s" "\u041e\u0448\u0438\u0431\u043a\u0430: %1\$s" + ::msgcat::mcset ru "Error: %1\$s" "\u041e\u0448\u0438\u0431\u043a\u0430: %1\$s" ::msgcat::mcset ru "E&xit" "\u0412\u044b\u0445\u043e\u0434" ::msgcat::mcset ru "File \"%1\$s\" already exists.\nDo you want to overwrite it?" \ "\u0424\u0430\u0439\u043b \"%1\$s\" \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.\n\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e?" @@ -34,7 +34,7 @@ namespace eval ::tk { ::msgcat::mcset ru "Hi" "\u041f\u0440\u0438\u0432\u0435\u0442" ::msgcat::mcset ru "&Hide Console" "\u0421\u043f\u0440\u044f\u0442\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c" ::msgcat::mcset ru "&Ignore" "&\u0418\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c" - ::msgcat::mcset ru "Invalid file name \"%1\$s\"." "\u041d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \"%1\$s\"." + ::msgcat::mcset ru "Invalid file name \"%1\$s\"." "\u041d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \"%1\$s\"." ::msgcat::mcset ru "Log Files" "\u0424\u0430\u0439\u043b\u044b \u0436\u0443\u0440\u043d\u0430\u043b\u0430" ::msgcat::mcset ru "&No" "&\u041d\u0435\u0442" ::msgcat::mcset ru "&OK" "&\u041e\u041a" -- cgit v0.12 From 1fd576b1cecb84450f2ae58edd48d66fe871c773 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 20 Aug 2015 14:13:25 +0000 Subject: Fix [http://core.tcl.tk/tcl/info/00189c4afcb9e2586301d711f71383e48817a72d|00189c4afc]: Allow semi-static UCRT build on Windows with VC 14.0 --- win/makefile.vc | 24 ++++++++++++++++++++++-- win/rules.vc | 7 +++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/win/makefile.vc b/win/makefile.vc index 4b9475f..dff7294 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -76,7 +76,7 @@ the build instructions. # Sets where to install Tcl from the built binaries. # C:\Progra~1\Tcl is assumed when not specified. # -# OPTS=loimpact,msvcrt,nothreads,noxp,pdbs,profile,square,static,staticpkg,symbols,unchecked,none +# OPTS=loimpact,msvcrt,nothreads,noxp,pdbs,profile,square,static,staticpkg,symbols,unchecked,ucrt,none # Sets special options for the core. The default is for none. # Any combination of the above may be used (comma separated). # 'none' will over-ride everything to nothing. @@ -105,6 +105,11 @@ the build instructions. # unchecked = Allows a symbols build to not use the debug # enabled runtime (msvcrt.dll not msvcrtd.dll # or libcmt.lib not libcmtd.lib). +# ucrt= Uses ucrt.lib and libvcruntime.lib, which +# ensures Tcl will run on machines with only the subset +# of the C runtime that is part of the operating system. +# If omitted, builds with VC 14.0 or later will require +# the full C runtime redistributable. # # STATS=compdbg,memdbg,none # Sets optional memory and bytecode compiler debugging code added @@ -456,7 +461,13 @@ cdebug = -Zi -WX $(DEBUGFLAGS) cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\ -!if $(MSVCRT) +!if $(UCRT) +!if $(DEBUG) && !$(UNCHECKED) +crt = -MDd +!else +crt = -MT +!endif +!elseif $(MSVCRT) !if $(DEBUG) && !$(UNCHECKED) crt = -MDd !else @@ -496,6 +507,10 @@ lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) lflags = $(lflags) -profile !endif +!if $(UCRT) && !($(DEBUG) && !$(UNCHECKED)) +lflags = $(lflags) -nodefaultlib:libucrt.lib +!endif + !if $(ALIGN98_HACK) && !$(STATIC_BUILD) ### Align sections for PE size savings. lflags = $(lflags) -opt:nowin98 @@ -520,6 +535,11 @@ baselibs = kernel32.lib user32.lib baselibs = $(baselibs) bufferoverflowU.lib !endif !endif + +!if $(UCRT) && !($(DEBUG) && !$(UNCHECKED)) +baselibs = $(baselibs) ucrt.lib +!endif + guilibs = $(baselibs) gdi32.lib diff --git a/win/rules.vc b/win/rules.vc index a43fac6..93c450b 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -223,6 +223,7 @@ LOIMPACT = 0 TCL_USE_STATIC_PACKAGES = 0 USE_THREAD_ALLOC = 0 UNCHECKED = 0 +UCRT = 0 !else !if [nmakehlp -f $(OPTS) "static"] !message *** Doing static @@ -302,6 +303,12 @@ UNCHECKED = 1 UNCHECKED = 0 !endif !endif +!if [nmakehlp -f $(OPTS) "ucrt"] && $(VCVERSION) >= 1900 +!message *** Doing UCRT +UCRT = 1 +!else +UCRT = 0 +!endif #---------------------------------------------------------- # Figure-out how to name our intermediate and output directories. -- cgit v0.12 From 43fa4c24905499a1f9e52986e3bcc75e2ede53fb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 28 Aug 2015 11:43:26 +0000 Subject: Completing [http://core.tcl.tk/tcl/info/00189c4afcb9e2586301d711f71383e48817a72d|00189c4afc]: Allow semi-static UCRT build on Windows with VC 14.0. Now for the configure/makefile build. --- win/configure | 20 ++++++++++++++++++-- win/makefile.vc | 25 +++++++------------------ win/rules.vc | 7 ------- win/tcl.m4 | 20 ++++++++++++++++++-- 4 files changed, 43 insertions(+), 29 deletions(-) diff --git a/win/configure b/win/configure index 35f57ca..57e0453 100755 --- a/win/configure +++ b/win/configure @@ -3827,6 +3827,13 @@ echo "${ECHO_T}using shared flags" >&6 EXESUFFIX="\${DBGX}.exe" LIBRARIES="\${SHARED_LIBRARIES}" SHLIB_LD_LIBS='${LIBS}' + case "x`echo \${VisualStudioVersion}`" in + x14*) + lflags="${lflags} -nodefaultlib:libucrt.lib" + ;; + *) + ;; + esac fi # DLLSUFFIX is separate because it is the building block for # users of tclConfig.sh that may build shared or static. @@ -3864,6 +3871,15 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 fi LIBS="user32.lib advapi32.lib ws2_32.lib" + + case "x`echo \${VisualStudioVersion}`" in + x14*) + LIBS="$LIBS ucrt.lib" + ;; + *) + ;; + esac + if test "$do64bit" != "no" ; then # The space-based-path will work for the Makefile, but will # not work if AC_TRY_COMPILE is called. TEA has the @@ -3938,7 +3954,7 @@ fi CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d" # Do not use -O2 for Win64 - this has proved buggy in code gen. CFLAGS_OPTIMIZE="-nologo -O1 ${runtime}" - lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" + lflags="${lflags} -nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 @@ -3950,7 +3966,7 @@ fi CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d" # -O2 - create fast code (/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy) CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" - lflags="-nologo" + lflags="${lflags} -nologo" LINKBIN="link" fi diff --git a/win/makefile.vc b/win/makefile.vc index dff7294..d2795c9 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -42,7 +42,7 @@ the build instructions. # turn on the 64-bit compiler, if your SDK has it. # # 3) Targets are: -# release -- Builds the core, the shell. (default) +# release -- Builds the core, the shell and the dlls. (default) # dlls -- Just builds the windows extensions. # shell -- Just builds the shell and the core. # core -- Only builds the core [tkXX.(dll|lib)]. @@ -76,7 +76,7 @@ the build instructions. # Sets where to install Tcl from the built binaries. # C:\Progra~1\Tcl is assumed when not specified. # -# OPTS=loimpact,msvcrt,nothreads,noxp,pdbs,profile,square,static,staticpkg,symbols,unchecked,ucrt,none +# OPTS=loimpact,msvcrt,nothreads,noxp,pdbs,profile,square,static,staticpkg,symbols,unchecked,none # Sets special options for the core. The default is for none. # Any combination of the above may be used (comma separated). # 'none' will over-ride everything to nothing. @@ -105,11 +105,6 @@ the build instructions. # unchecked = Allows a symbols build to not use the debug # enabled runtime (msvcrt.dll not msvcrtd.dll # or libcmt.lib not libcmtd.lib). -# ucrt= Uses ucrt.lib and libvcruntime.lib, which -# ensures Tcl will run on machines with only the subset -# of the C runtime that is part of the operating system. -# If omitted, builds with VC 14.0 or later will require -# the full C runtime redistributable. # # STATS=compdbg,memdbg,none # Sets optional memory and bytecode compiler debugging code added @@ -448,7 +443,7 @@ cdebug = $(OPTIMIZATIONS) cdebug = !endif !if $(SYMBOLS) -cdebug = $(cdebug) -Zi +cdebug = $(cdebug) -Zi !endif !else if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" ### Warnings are too many, can't support warnings into errors. @@ -461,13 +456,7 @@ cdebug = -Zi -WX $(DEBUGFLAGS) cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\ -!if $(UCRT) -!if $(DEBUG) && !$(UNCHECKED) -crt = -MDd -!else -crt = -MT -!endif -!elseif $(MSVCRT) +!if $(MSVCRT) !if $(DEBUG) && !$(UNCHECKED) crt = -MDd !else @@ -487,6 +476,7 @@ CON_CFLAGS = $(cdebug) $(cflags) $(crt) -DCONSOLE WISH_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) STUB_CFLAGS = $(cflags) $(cdebug) $(TK_DEFINES) + #--------------------------------------------------------------------- # Link flags #--------------------------------------------------------------------- @@ -507,7 +497,7 @@ lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug) lflags = $(lflags) -profile !endif -!if $(UCRT) && !($(DEBUG) && !$(UNCHECKED)) +!if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900 lflags = $(lflags) -nodefaultlib:libucrt.lib !endif @@ -535,8 +525,7 @@ baselibs = kernel32.lib user32.lib baselibs = $(baselibs) bufferoverflowU.lib !endif !endif - -!if $(UCRT) && !($(DEBUG) && !$(UNCHECKED)) +!if $(MSVCRT) && !($(DEBUG) && !$(UNCHECKED)) && $(VCVERSION) >= 1900 baselibs = $(baselibs) ucrt.lib !endif diff --git a/win/rules.vc b/win/rules.vc index 93c450b..a43fac6 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -223,7 +223,6 @@ LOIMPACT = 0 TCL_USE_STATIC_PACKAGES = 0 USE_THREAD_ALLOC = 0 UNCHECKED = 0 -UCRT = 0 !else !if [nmakehlp -f $(OPTS) "static"] !message *** Doing static @@ -303,12 +302,6 @@ UNCHECKED = 1 UNCHECKED = 0 !endif !endif -!if [nmakehlp -f $(OPTS) "ucrt"] && $(VCVERSION) >= 1900 -!message *** Doing UCRT -UCRT = 1 -!else -UCRT = 0 -!endif #---------------------------------------------------------- # Figure-out how to name our intermediate and output directories. diff --git a/win/tcl.m4 b/win/tcl.m4 index 44fd47e..6f10a96 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -783,6 +783,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ EXESUFFIX="\${DBGX}.exe" LIBRARIES="\${SHARED_LIBRARIES}" SHLIB_LD_LIBS='${LIBS}' + case "x`echo \${VisualStudioVersion}`" in + x14*) + lflags="${lflags} -nodefaultlib:libucrt.lib" + ;; + *) + ;; + esac fi # DLLSUFFIX is separate because it is the building block for # users of tclConfig.sh that may build shared or static. @@ -817,6 +824,15 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ fi LIBS="user32.lib advapi32.lib ws2_32.lib" + + case "x`echo \${VisualStudioVersion}`" in + x14*) + LIBS="$LIBS ucrt.lib" + ;; + *) + ;; + esac + if test "$do64bit" != "no" ; then # The space-based-path will work for the Makefile, but will # not work if AC_TRY_COMPILE is called. TEA has the @@ -831,7 +847,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d" # Do not use -O2 for Win64 - this has proved buggy in code gen. CFLAGS_OPTIMIZE="-nologo -O1 ${runtime}" - lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" + lflags="${lflags} -nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 @@ -843,7 +859,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d" # -O2 - create fast code (/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy) CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" - lflags="-nologo" + lflags="${lflags} -nologo" LINKBIN="link" fi -- cgit v0.12 From 7708c070940fa9d780429ace70c7643fb553872a Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 2 Sep 2015 20:27:57 +0000 Subject: Fixed bug [1581435fff] - Documented precedence order in the matching process of the index string --- doc/menu.n | 15 +++++++++------ tests/menu.test | 9 +++++++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/doc/menu.n b/doc/menu.n index 6d0dc8a..1c943f9 100644 --- a/doc/menu.n +++ b/doc/menu.n @@ -285,15 +285,10 @@ operations on the widget. It has the following general form: determine the exact behavior of the command. .PP Many of the widget commands for a menu take as one argument an -indicator of which entry of the menu to operate on. These +indicator of which entry of the menu to operate on. These indicators are called \fIindex\fRes and may be specified in any of the following forms: .TP 12 -\fInumber\fR -Specifies the entry numerically, where 0 corresponds -to the top-most entry of the menu, 1 to the entry below it, and -so on. -.TP 12 \fBactive\fR Indicates the entry that is currently active. If no entry is active then this form is equivalent to \fBnone\fR. This form may @@ -323,6 +318,11 @@ For example, .QW \fB@0\fR indicates the top-most entry in the window. .TP 12 +\fInumber\fR +Specifies the entry numerically, where 0 corresponds +to the top-most entry of the menu, 1 to the entry below it, and +so on. +.TP 12 \fIpattern\fR If the index does not satisfy one of the above forms then this form is used. \fIPattern\fR is pattern-matched against the label of @@ -330,6 +330,9 @@ each entry in the menu, in order from the top down, until a matching entry is found. The rules of \fBTcl_StringMatch\fR are used. .PP +If the index could match more than one of the above forms, then +the form earlier in the above list takes precedence. +.PP The following widget commands are possible for menu widgets: .TP \fIpathName \fBactivate \fIindex\fR diff --git a/tests/menu.test b/tests/menu.test index 3cb47c3..cfe00b9 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -754,8 +754,13 @@ test menu-3.41 {MenuWidgetCmd procedure, "index" option} { catch {destroy .m1} menu .m1 .m1 add command -label "test" - list [catch {.m1 index "test"} msg] $msg [destroy .m1] -} {0 1 {}} + .m1 add command -label "3" + .m1 add command -label "another label" + .m1 add command -label "end" + .m1 add command -label "3a" + .m1 add command -label "final entry" + list [.m1 index "test"] [.m1 index "3"] [.m1 index "3a"] [.m1 index "end"] [destroy .m1] +} {1 3 5 6 {}} test menu-3.42 {MenuWidgetCmd procedure, "insert" option} { catch {destroy .m1} menu .m1 -- cgit v0.12 From f0195b7327bd47beebd87d10978b3a98a5297757 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 10 Sep 2015 14:05:46 +0000 Subject: Remove licenced images (which cannot be used for commercial purposes). See [/artifact/b2a203459daa9c49?ln=69]. Still to be replaced: win/rc/wish.ico and win/rc/lamp.bmp. This partially reverts commit [0fce209405dff92a]. --- library/images/lamp.png | Bin 8203 -> 0 bytes library/images/lamp.svg | 114 ------------------------------------------------ 2 files changed, 114 deletions(-) delete mode 100644 library/images/lamp.png delete mode 100644 library/images/lamp.svg diff --git a/library/images/lamp.png b/library/images/lamp.png deleted file mode 100644 index 5445746..0000000 Binary files a/library/images/lamp.png and /dev/null differ diff --git a/library/images/lamp.svg b/library/images/lamp.svg deleted file mode 100644 index aa34765..0000000 --- a/library/images/lamp.svg +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - image/svg+xml - - Wish - - - - - - - - - - - - - - - - - - - - -- cgit v0.12 From 0925f4bde6aca761cff7aa5fdc61b66192687da5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 11 Sep 2015 12:06:04 +0000 Subject: Experiment, just to have a look how the new icon could look like. --- win/rc/lamp.bmp | Bin 2102 -> 2102 bytes win/rc/wish.ico | Bin 46878 -> 43646 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/win/rc/lamp.bmp b/win/rc/lamp.bmp index 834c0f9..1e2f9d4 100644 Binary files a/win/rc/lamp.bmp and b/win/rc/lamp.bmp differ diff --git a/win/rc/wish.ico b/win/rc/wish.ico index 05cad66..5801fb8 100644 Binary files a/win/rc/wish.ico and b/win/rc/wish.ico differ -- cgit v0.12 From 4b62f1fb163792e9cc42e12ee5e803ae187cb609 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 13 Sep 2015 12:37:10 +0000 Subject: Bug [cc0ba31920] - Make text-9.2.46 pass on Windows 8.1 --- tests/text.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/text.test b/tests/text.test index 53196be..fa00ce3 100644 --- a/tests/text.test +++ b/tests/text.test @@ -726,7 +726,7 @@ test text-9.2.46 {TextWidgetCmd procedure, "count" option} -setup { .mytop.t insert end "Line $i+++Line $i---Line $i///Line $i - This is Line [format %c [expr 64+$i]]\n" } .mytop.t tag configure hidden -elide true - .mytop.t tag add hidden 2.15 3.10 + .mytop.t tag add hidden 2.20 3.10 .mytop.t configure -wrap char lappend res [.mytop.t count -displaylines 2.0 3.0] lappend res [.mytop.t count -displaylines 2.0 3.40] -- cgit v0.12 From 625ff44b4cbd4e2d133d798057e9c68c33f73aaf Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 23 Sep 2015 19:47:25 +0000 Subject: Fixed bug [1501749fff] - Crash on embedded window deletion bound to event --- generic/tkTextWind.c | 16 ++++++++++------ tests/textWind.test | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index 8d1f850..5b511d2 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -1123,6 +1123,16 @@ TkTextEmbWinDisplayProc( &lineX, &windowY, &width, &height); windowX = lineX - chunkPtr->x + x; + /* + * Mark the window as displayed so that it won't get unmapped. + * This needs to be done before the next instruction block because + * Tk_MaintainGeometry/Tk_MapWindow will run event handlers, in + * particular for the event, and if the bound script deletes + * the embedded window its clients will get freed. + */ + + client->displayed = 1; + if (textPtr->tkwin == Tk_Parent(tkwin)) { if ((windowX != Tk_X(tkwin)) || (windowY != Tk_Y(tkwin)) || (Tk_ReqWidth(tkwin) != Tk_Width(tkwin)) @@ -1134,12 +1144,6 @@ TkTextEmbWinDisplayProc( Tk_MaintainGeometry(tkwin, textPtr->tkwin, windowX, windowY, width, height); } - - /* - * Mark the window as displayed so that it won't get unmapped. - */ - - client->displayed = 1; } /* diff --git a/tests/textWind.test b/tests/textWind.test index 79dca50..2e16f7b 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -1023,6 +1023,20 @@ test textWind-17.9 {peer widget window configuration} { set res } {{-window {} {} {} {}} {-window {} {} {} {}} {-window {} {} {} .t.f} {-window {} {} {} .tt.t.f}} +test textWind-18.1 {embedded window deletion triggered by a script bound to } { + catch {destroy .t .f} + pack [text .t] + for {set i 1} {$i < 100} {incr i} {.t insert end "Line $i\n"} + .t window create end -window [frame .f -background red -width 80 -height 80] + .t window create end -window [frame .f2 -background blue -width 80 -height 80] + bind .f {.t delete .f} + update + # this shall not crash (bug 1501749) + after 100 {.t yview end} + tkwait visibility .f2 + update +} {} + catch {destroy .t} option clear -- cgit v0.12 From e2138596ed17444e34d4aacc028486e200cad81f Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 23 Sep 2015 21:29:42 +0000 Subject: [c648c8dad1] Repair PNG reader buffer overflow protections that prevented read of valid PNG image. --- generic/tkImgPNG.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index 9d0fb30..2ee515b 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -1847,6 +1847,13 @@ DecodeLine( if (UnfilterLine(interp, pngPtr) == TCL_ERROR) { return TCL_ERROR; } + if (pngPtr->currentLine >= pngPtr->block.height) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "PNG image data overflow")); + Tcl_SetErrorCode(interp, "TK", "IMAGE", "PNG", "DATA_OVERFLOW", NULL); + return TCL_ERROR; + } + if (pngPtr->interlace) { switch (pngPtr->phase) { @@ -1881,8 +1888,6 @@ DecodeLine( * Calculate offset into pixelPtr for the first pixel of the line. */ - assert(pngPtr->currentLine < pngPtr->block.height); - offset = pngPtr->currentLine * pngPtr->block.pitch; /* @@ -2092,8 +2097,7 @@ ReadIDAT( * Process IDAT contents until there is no more in this chunk. */ - while (chunkSz && !Tcl_ZlibStreamEof(pngPtr->stream) - && pngPtr->currentLine < pngPtr->block.height) { + while (chunkSz && !Tcl_ZlibStreamEof(pngPtr->stream)) { int len1, len2; /* -- cgit v0.12 From 7f3366e5e9ea3a96cb0efb0b6c9d3f5b70d97d5b Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 29 Sep 2015 20:26:29 +0000 Subject: Added -proxybackground option --- doc/panedwindow.n | 2 ++ generic/tkPanedWindow.c | 6 +++++- macosx/tkMacOSXDefault.h | 1 + tests/panedwindow.test | 18 ++++++++++-------- unix/tkUnixDefault.h | 1 + win/tkWinDefault.h | 1 + 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/doc/panedwindow.n b/doc/panedwindow.n index b9df08e..f3c22be 100644 --- a/doc/panedwindow.n +++ b/doc/panedwindow.n @@ -29,6 +29,8 @@ drawn as squares. May be any value accepted by \fBTk_GetPixels\fR. Specifies a desired height for the overall panedwindow widget. May be any value accepted by \fBTk_GetPixels\fR. If an empty string, the widget will be made high enough to allow all contained widgets to have their natural height. +.OP \-proxybackground proxyBackground ProxyBackground +Background color to use when drawing the proxy. .OP \-proxyrelief proxyRelief ProxyRelief Relief to use when drawing the proxy. May be any of the standard Tk relief values. diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index c7d5339..96a4441 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -147,6 +147,7 @@ typedef struct PanedWindow { GC gc; /* Graphics context for copying from * off-screen pixmap onto screen. */ int proxyx, proxyy; /* Proxy x,y coordinates. */ + Tk_3DBorder proxyBackground;/* Background color used to draw proxy. */ int proxyRelief; /* Relief used to draw proxy. */ Slave **slaves; /* Pointer to array of Slaves. */ int numSlaves; /* Number of slaves. */ @@ -299,6 +300,9 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", DEF_PANEDWINDOW_ORIENT, -1, Tk_Offset(PanedWindow, orient), 0, (ClientData) orientStrings, GEOMETRY}, + {TK_OPTION_BORDER, "-proxybackground", "proxyBackground", "ProxyBackground", + DEF_PANEDWINDOW_BG_COLOR, -1, Tk_Offset(PanedWindow, proxyBackground), 0, + (ClientData) DEF_PANEDWINDOW_BG_MONO}, {TK_OPTION_RELIEF, "-proxyrelief", "proxyRelief", "Relief", DEF_PANEDWINDOW_PROXYRELIEF, -1, Tk_Offset(PanedWindow, proxyRelief), 0, 0, 0}, @@ -2773,7 +2777,7 @@ DisplayProxyWindow( * Redraw the widget's background and border. */ - Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->background, 0, 0, + Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->proxyBackground, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), 2, pwPtr->proxyRelief); #ifndef TK_NO_DOUBLE_BUFFERING diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index ad92dc6..ce8af8f 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -409,6 +409,7 @@ #define DEF_PANEDWINDOW_HEIGHT "" #define DEF_PANEDWINDOW_OPAQUERESIZE "1" #define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_PROXYBACKGROUND WHITE #define DEF_PANEDWINDOW_PROXYRELIEF "flat" #define DEF_PANEDWINDOW_RELIEF "flat" #define DEF_PANEDWINDOW_SASHCURSOR "" diff --git a/tests/panedwindow.test b/tests/panedwindow.test index f66b35e..2e800bc 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -32,24 +32,26 @@ foreach {testName testData} { panedwindow-1.9 {-proxyrelief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} - panedwindow-1.10 {-orient + panedwindow-1.10 {-proxybackground + "#f0a0a0" "#f0a0a0" non-existent {unknown color name "non-existent"}} + panedwindow-1.11 {-orient horizontal horizontal badValue {bad orient "badValue": must be horizontal or vertical}} - panedwindow-1.11 {-relief + panedwindow-1.12 {-relief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} - panedwindow-1.12 {-sashcursor + panedwindow-1.13 {-sashcursor arrow arrow badValue {bad cursor spec "badValue"}} - panedwindow-1.13 {-sashpad + panedwindow-1.14 {-sashpad 1.3 1 badValue {bad screen distance "badValue"}} - panedwindow-1.14 {-sashrelief + panedwindow-1.15 {-sashrelief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} - panedwindow-1.15 {-sashwidth + panedwindow-1.16 {-sashwidth 10 10 badValue {bad screen distance "badValue"}} - panedwindow-1.16 {-showhandle + panedwindow-1.17 {-showhandle true 1 foo {expected boolean value but got "foo"}} - panedwindow-1.17 {-width + panedwindow-1.18 {-width 402 402 badValue {bad screen distance "badValue"}} } { lassign $testData optionName goodIn goodOut badIn badOut diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h index 78b10f5..f2cdf4b 100644 --- a/unix/tkUnixDefault.h +++ b/unix/tkUnixDefault.h @@ -367,6 +367,7 @@ #define DEF_PANEDWINDOW_HEIGHT "" #define DEF_PANEDWINDOW_OPAQUERESIZE "1" #define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_PROXYBACKGROUND WHITE #define DEF_PANEDWINDOW_PROXYRELIEF "flat" #define DEF_PANEDWINDOW_RELIEF "flat" #define DEF_PANEDWINDOW_SASHCURSOR "" diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h index 19cbf31..60c098f 100644 --- a/win/tkWinDefault.h +++ b/win/tkWinDefault.h @@ -370,6 +370,7 @@ #define DEF_PANEDWINDOW_HEIGHT "" #define DEF_PANEDWINDOW_OPAQUERESIZE "1" #define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_PROXYBACKGROUND WHITE #define DEF_PANEDWINDOW_PROXYRELIEF "flat" #define DEF_PANEDWINDOW_RELIEF "flat" #define DEF_PANEDWINDOW_SASHCURSOR "" -- cgit v0.12 From f3daa2b6bd7157f5b49e33c196f976baf649a3e2 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 30 Sep 2015 06:23:19 +0000 Subject: Added -proxyborderwidth option --- doc/panedwindow.n | 3 +++ generic/tkPanedWindow.c | 7 ++++++- macosx/tkMacOSXDefault.h | 37 +++++++++++++++++++------------------ tests/panedwindow.test | 18 ++++++++++-------- unix/tkUnixDefault.h | 37 +++++++++++++++++++------------------ win/tkWinDefault.h | 37 +++++++++++++++++++------------------ 6 files changed, 76 insertions(+), 63 deletions(-) diff --git a/doc/panedwindow.n b/doc/panedwindow.n index f3c22be..6263d05 100644 --- a/doc/panedwindow.n +++ b/doc/panedwindow.n @@ -31,6 +31,9 @@ value accepted by \fBTk_GetPixels\fR. If an empty string, the widget will be made high enough to allow all contained widgets to have their natural height. .OP \-proxybackground proxyBackground ProxyBackground Background color to use when drawing the proxy. +.OP \-proxyborderwidth proxyBorderWidth ProxyBorderWidth +Specifies the width of the proxy. May be any value accepted by +\fBTk_GetPixels\fR. .OP \-proxyrelief proxyRelief ProxyRelief Relief to use when drawing the proxy. May be any of the standard Tk relief values. diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 96a4441..244eb09 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -148,6 +148,7 @@ typedef struct PanedWindow { * off-screen pixmap onto screen. */ int proxyx, proxyy; /* Proxy x,y coordinates. */ Tk_3DBorder proxyBackground;/* Background color used to draw proxy. */ + int proxyBorderWidth; /* Borderwidth used to draw proxy. */ int proxyRelief; /* Relief used to draw proxy. */ Slave **slaves; /* Pointer to array of Slaves. */ int numSlaves; /* Number of slaves. */ @@ -303,6 +304,9 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-proxybackground", "proxyBackground", "ProxyBackground", DEF_PANEDWINDOW_BG_COLOR, -1, Tk_Offset(PanedWindow, proxyBackground), 0, (ClientData) DEF_PANEDWINDOW_BG_MONO}, + {TK_OPTION_PIXELS, "-proxyborderwidth", "proxyBorderWidth", "ProxyBorderWidth", + DEF_PANEDWINDOW_PROXYBORDERWIDTH, -1, Tk_Offset(PanedWindow, proxyBorderWidth), + 0, 0, GEOMETRY}, {TK_OPTION_RELIEF, "-proxyrelief", "proxyRelief", "Relief", DEF_PANEDWINDOW_PROXYRELIEF, -1, Tk_Offset(PanedWindow, proxyRelief), 0, 0, 0}, @@ -2778,7 +2782,8 @@ DisplayProxyWindow( */ Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->proxyBackground, 0, 0, - Tk_Width(tkwin), Tk_Height(tkwin), 2, pwPtr->proxyRelief); + Tk_Width(tkwin), Tk_Height(tkwin), pwPtr->proxyBorderWidth, + pwPtr->proxyRelief); #ifndef TK_NO_DOUBLE_BUFFERING /* diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index ce8af8f..0db03bc 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -400,24 +400,25 @@ * Defaults for panedwindows */ -#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG -#define DEF_PANEDWINDOW_BG_MONO WHITE -#define DEF_PANEDWINDOW_BORDERWIDTH "1" -#define DEF_PANEDWINDOW_CURSOR "" -#define DEF_PANEDWINDOW_HANDLEPAD "8" -#define DEF_PANEDWINDOW_HANDLESIZE "8" -#define DEF_PANEDWINDOW_HEIGHT "" -#define DEF_PANEDWINDOW_OPAQUERESIZE "1" -#define DEF_PANEDWINDOW_ORIENT "horizontal" -#define DEF_PANEDWINDOW_PROXYBACKGROUND WHITE -#define DEF_PANEDWINDOW_PROXYRELIEF "flat" -#define DEF_PANEDWINDOW_RELIEF "flat" -#define DEF_PANEDWINDOW_SASHCURSOR "" -#define DEF_PANEDWINDOW_SASHPAD "0" -#define DEF_PANEDWINDOW_SASHRELIEF "flat" -#define DEF_PANEDWINDOW_SASHWIDTH "3" -#define DEF_PANEDWINDOW_SHOWHANDLE "0" -#define DEF_PANEDWINDOW_WIDTH "" +#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG +#define DEF_PANEDWINDOW_BG_MONO WHITE +#define DEF_PANEDWINDOW_BORDERWIDTH "1" +#define DEF_PANEDWINDOW_CURSOR "" +#define DEF_PANEDWINDOW_HANDLEPAD "8" +#define DEF_PANEDWINDOW_HANDLESIZE "8" +#define DEF_PANEDWINDOW_HEIGHT "" +#define DEF_PANEDWINDOW_OPAQUERESIZE "1" +#define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_PROXYBORDERWIDTH "2" +#define DEF_PANEDWINDOW_PROXYBACKGROUND WHITE +#define DEF_PANEDWINDOW_PROXYRELIEF "flat" +#define DEF_PANEDWINDOW_RELIEF "flat" +#define DEF_PANEDWINDOW_SASHCURSOR "" +#define DEF_PANEDWINDOW_SASHPAD "0" +#define DEF_PANEDWINDOW_SASHRELIEF "flat" +#define DEF_PANEDWINDOW_SASHWIDTH "3" +#define DEF_PANEDWINDOW_SHOWHANDLE "0" +#define DEF_PANEDWINDOW_WIDTH "" /* * Defaults for panedwindow panes diff --git a/tests/panedwindow.test b/tests/panedwindow.test index 2e800bc..7620f84 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -34,24 +34,26 @@ foreach {testName testData} { 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} panedwindow-1.10 {-proxybackground "#f0a0a0" "#f0a0a0" non-existent {unknown color name "non-existent"}} - panedwindow-1.11 {-orient + panedwindow-1.11 {-proxyborderwidth + 1.3 1 badValue {bad screen distance "badValue"}} + panedwindow-1.12 {-orient horizontal horizontal badValue {bad orient "badValue": must be horizontal or vertical}} - panedwindow-1.12 {-relief + panedwindow-1.13 {-relief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} - panedwindow-1.13 {-sashcursor + panedwindow-1.14 {-sashcursor arrow arrow badValue {bad cursor spec "badValue"}} - panedwindow-1.14 {-sashpad + panedwindow-1.15 {-sashpad 1.3 1 badValue {bad screen distance "badValue"}} - panedwindow-1.15 {-sashrelief + panedwindow-1.16 {-sashrelief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} - panedwindow-1.16 {-sashwidth + panedwindow-1.17 {-sashwidth 10 10 badValue {bad screen distance "badValue"}} - panedwindow-1.17 {-showhandle + panedwindow-1.18 {-showhandle true 1 foo {expected boolean value but got "foo"}} - panedwindow-1.18 {-width + panedwindow-1.19 {-width 402 402 badValue {bad screen distance "badValue"}} } { lassign $testData optionName goodIn goodOut badIn badOut diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h index f2cdf4b..e5b2598 100644 --- a/unix/tkUnixDefault.h +++ b/unix/tkUnixDefault.h @@ -358,24 +358,25 @@ * Defaults for panedwindows */ -#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG -#define DEF_PANEDWINDOW_BG_MONO WHITE -#define DEF_PANEDWINDOW_BORDERWIDTH "1" -#define DEF_PANEDWINDOW_CURSOR "" -#define DEF_PANEDWINDOW_HANDLEPAD "8" -#define DEF_PANEDWINDOW_HANDLESIZE "8" -#define DEF_PANEDWINDOW_HEIGHT "" -#define DEF_PANEDWINDOW_OPAQUERESIZE "1" -#define DEF_PANEDWINDOW_ORIENT "horizontal" -#define DEF_PANEDWINDOW_PROXYBACKGROUND WHITE -#define DEF_PANEDWINDOW_PROXYRELIEF "flat" -#define DEF_PANEDWINDOW_RELIEF "flat" -#define DEF_PANEDWINDOW_SASHCURSOR "" -#define DEF_PANEDWINDOW_SASHPAD "0" -#define DEF_PANEDWINDOW_SASHRELIEF "flat" -#define DEF_PANEDWINDOW_SASHWIDTH "3" -#define DEF_PANEDWINDOW_SHOWHANDLE "0" -#define DEF_PANEDWINDOW_WIDTH "" +#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG +#define DEF_PANEDWINDOW_BG_MONO WHITE +#define DEF_PANEDWINDOW_BORDERWIDTH "1" +#define DEF_PANEDWINDOW_CURSOR "" +#define DEF_PANEDWINDOW_HANDLEPAD "8" +#define DEF_PANEDWINDOW_HANDLESIZE "8" +#define DEF_PANEDWINDOW_HEIGHT "" +#define DEF_PANEDWINDOW_OPAQUERESIZE "1" +#define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_PROXYBORDERWIDTH "2" +#define DEF_PANEDWINDOW_PROXYBACKGROUND WHITE +#define DEF_PANEDWINDOW_PROXYRELIEF "flat" +#define DEF_PANEDWINDOW_RELIEF "flat" +#define DEF_PANEDWINDOW_SASHCURSOR "" +#define DEF_PANEDWINDOW_SASHPAD "0" +#define DEF_PANEDWINDOW_SASHRELIEF "flat" +#define DEF_PANEDWINDOW_SASHWIDTH "3" +#define DEF_PANEDWINDOW_SHOWHANDLE "0" +#define DEF_PANEDWINDOW_WIDTH "" /* * Defaults for panedwindow panes diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h index 60c098f..8cceb2e 100644 --- a/win/tkWinDefault.h +++ b/win/tkWinDefault.h @@ -361,24 +361,25 @@ * Defaults for panedwindows */ -#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG -#define DEF_PANEDWINDOW_BG_MONO WHITE -#define DEF_PANEDWINDOW_BORDERWIDTH "1" -#define DEF_PANEDWINDOW_CURSOR "" -#define DEF_PANEDWINDOW_HANDLEPAD "8" -#define DEF_PANEDWINDOW_HANDLESIZE "8" -#define DEF_PANEDWINDOW_HEIGHT "" -#define DEF_PANEDWINDOW_OPAQUERESIZE "1" -#define DEF_PANEDWINDOW_ORIENT "horizontal" -#define DEF_PANEDWINDOW_PROXYBACKGROUND WHITE -#define DEF_PANEDWINDOW_PROXYRELIEF "flat" -#define DEF_PANEDWINDOW_RELIEF "flat" -#define DEF_PANEDWINDOW_SASHCURSOR "" -#define DEF_PANEDWINDOW_SASHPAD "0" -#define DEF_PANEDWINDOW_SASHRELIEF "flat" -#define DEF_PANEDWINDOW_SASHWIDTH "3" -#define DEF_PANEDWINDOW_SHOWHANDLE "0" -#define DEF_PANEDWINDOW_WIDTH "" +#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG +#define DEF_PANEDWINDOW_BG_MONO WHITE +#define DEF_PANEDWINDOW_BORDERWIDTH "1" +#define DEF_PANEDWINDOW_CURSOR "" +#define DEF_PANEDWINDOW_HANDLEPAD "8" +#define DEF_PANEDWINDOW_HANDLESIZE "8" +#define DEF_PANEDWINDOW_HEIGHT "" +#define DEF_PANEDWINDOW_OPAQUERESIZE "1" +#define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_PROXYBORDERWIDTH "2" +#define DEF_PANEDWINDOW_PROXYBACKGROUND WHITE +#define DEF_PANEDWINDOW_PROXYRELIEF "flat" +#define DEF_PANEDWINDOW_RELIEF "flat" +#define DEF_PANEDWINDOW_SASHCURSOR "" +#define DEF_PANEDWINDOW_SASHPAD "0" +#define DEF_PANEDWINDOW_SASHRELIEF "flat" +#define DEF_PANEDWINDOW_SASHWIDTH "3" +#define DEF_PANEDWINDOW_SHOWHANDLE "0" +#define DEF_PANEDWINDOW_WIDTH "" /* * Defaults for panedwindow panes -- cgit v0.12 From 6afc58715f8a34458f99236674f46b392be1fb05 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 30 Sep 2015 06:27:15 +0000 Subject: Use correct default value for -proxybackground --- generic/tkPanedWindow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 244eb09..7919728 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -302,7 +302,7 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_PANEDWINDOW_ORIENT, -1, Tk_Offset(PanedWindow, orient), 0, (ClientData) orientStrings, GEOMETRY}, {TK_OPTION_BORDER, "-proxybackground", "proxyBackground", "ProxyBackground", - DEF_PANEDWINDOW_BG_COLOR, -1, Tk_Offset(PanedWindow, proxyBackground), 0, + DEF_PANEDWINDOW_PROXYBACKGROUND, -1, Tk_Offset(PanedWindow, proxyBackground), 0, (ClientData) DEF_PANEDWINDOW_BG_MONO}, {TK_OPTION_PIXELS, "-proxyborderwidth", "proxyBorderWidth", "ProxyBorderWidth", DEF_PANEDWINDOW_PROXYBORDERWIDTH, -1, Tk_Offset(PanedWindow, proxyBorderWidth), -- cgit v0.12 From 310e0cb8c6d028661e1b9b3cc7644386d0f6e25d Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 30 Sep 2015 06:29:04 +0000 Subject: Re-ordered tests of the new three options in alphabetical order, following convention in the rest of the code and tests --- tests/panedwindow.test | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/panedwindow.test b/tests/panedwindow.test index 7620f84..d088cfe 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -29,13 +29,13 @@ foreach {testName testData} { 20 20 badValue {bad screen distance "badValue"}} panedwindow-1.8 {-opaqueresize true 1 foo {expected boolean value but got "foo"}} - panedwindow-1.9 {-proxyrelief - groove groove - 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} - panedwindow-1.10 {-proxybackground + panedwindow-1.9 {-proxybackground "#f0a0a0" "#f0a0a0" non-existent {unknown color name "non-existent"}} - panedwindow-1.11 {-proxyborderwidth + panedwindow-1.10 {-proxyborderwidth 1.3 1 badValue {bad screen distance "badValue"}} + panedwindow-1.11 {-proxyrelief + groove groove + 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} panedwindow-1.12 {-orient horizontal horizontal badValue {bad orient "badValue": must be horizontal or vertical}} -- cgit v0.12 From cf0b763ae6169a3440a7be0f9aa2b756955b6eb4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 30 Sep 2015 09:15:44 +0000 Subject: Bring panedwindow proxy behavior in line with TIP #437 description. --- doc/panedwindow.n | 11 +++++++---- generic/tkPanedWindow.c | 23 +++++++++++++---------- tests/panedwindow.test | 2 +- unix/tkUnixDefault.h | 35 ++++++++++++++++------------------- win/tkWinDefault.h | 35 ++++++++++++++++------------------- 5 files changed, 53 insertions(+), 53 deletions(-) diff --git a/doc/panedwindow.n b/doc/panedwindow.n index 6263d05..9ee79ec 100644 --- a/doc/panedwindow.n +++ b/doc/panedwindow.n @@ -30,13 +30,16 @@ Specifies a desired height for the overall panedwindow widget. May be any value accepted by \fBTk_GetPixels\fR. If an empty string, the widget will be made high enough to allow all contained widgets to have their natural height. .OP \-proxybackground proxyBackground ProxyBackground -Background color to use when drawing the proxy. +Background color to use when drawing the proxy. If an empty string, the +value of the \fB-background\fR option will be used. .OP \-proxyborderwidth proxyBorderWidth ProxyBorderWidth -Specifies the width of the proxy. May be any value accepted by -\fBTk_GetPixels\fR. +Specifies the borderwidth of the proxy. May be any value accepted by +\fBTk_GetPixels\fR. If an empty string, the +value of the \fB-borderwidth\fR option will be used. .OP \-proxyrelief proxyRelief ProxyRelief Relief to use when drawing the proxy. May be any of the standard Tk -relief values. +relief values. If an empty string, the value of the \fB-relief\fR +option will be used. .OP \-opaqueresize opaqueResize OpaqueResize Specifies whether panes should be resized as a sash is moved (true), or if resizing should be deferred until the sash is placed (false). diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 7919728..8699ac3 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -147,9 +147,10 @@ typedef struct PanedWindow { GC gc; /* Graphics context for copying from * off-screen pixmap onto screen. */ int proxyx, proxyy; /* Proxy x,y coordinates. */ - Tk_3DBorder proxyBackground;/* Background color used to draw proxy. */ + Tk_3DBorder proxyBackground;/* Background color used to draw proxy. If NULL, use background. */ + Tcl_Obj *proxyBorderWidthPtr; /* Tcl_Obj rep for proxyBorderWidth, if NULL then use borderWitdh */ int proxyBorderWidth; /* Borderwidth used to draw proxy. */ - int proxyRelief; /* Relief used to draw proxy. */ + int proxyRelief; /* Relief used to draw proxy, if TK_RELIEF_NULL then use relief. */ Slave **slaves; /* Pointer to array of Slaves. */ int numSlaves; /* Number of slaves. */ int sizeofSlaves; /* Number of elements in the slaves array. */ @@ -302,14 +303,14 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_PANEDWINDOW_ORIENT, -1, Tk_Offset(PanedWindow, orient), 0, (ClientData) orientStrings, GEOMETRY}, {TK_OPTION_BORDER, "-proxybackground", "proxyBackground", "ProxyBackground", - DEF_PANEDWINDOW_PROXYBACKGROUND, -1, Tk_Offset(PanedWindow, proxyBackground), 0, + 0, -1, Tk_Offset(PanedWindow, proxyBackground), TK_OPTION_NULL_OK, (ClientData) DEF_PANEDWINDOW_BG_MONO}, {TK_OPTION_PIXELS, "-proxyborderwidth", "proxyBorderWidth", "ProxyBorderWidth", - DEF_PANEDWINDOW_PROXYBORDERWIDTH, -1, Tk_Offset(PanedWindow, proxyBorderWidth), - 0, 0, GEOMETRY}, + 0, Tk_Offset(PanedWindow, proxyBorderWidthPtr), Tk_Offset(PanedWindow, proxyBorderWidth), + TK_OPTION_NULL_OK, 0, GEOMETRY}, {TK_OPTION_RELIEF, "-proxyrelief", "proxyRelief", "Relief", - DEF_PANEDWINDOW_PROXYRELIEF, -1, Tk_Offset(PanedWindow, proxyRelief), - 0, 0, 0}, + 0, -1, Tk_Offset(PanedWindow, proxyRelief), + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_PANEDWINDOW_RELIEF, -1, Tk_Offset(PanedWindow, relief), 0, 0, 0}, {TK_OPTION_CURSOR, "-sashcursor", "sashCursor", "Cursor", @@ -2781,9 +2782,11 @@ DisplayProxyWindow( * Redraw the widget's background and border. */ - Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->proxyBackground, 0, 0, - Tk_Width(tkwin), Tk_Height(tkwin), pwPtr->proxyBorderWidth, - pwPtr->proxyRelief); + Tk_Fill3DRectangle(tkwin, pixmap, + pwPtr->proxyBackground ? pwPtr->proxyBackground : pwPtr->background, + 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), + pwPtr->proxyBorderWidthPtr ? pwPtr->proxyBorderWidth : pwPtr->borderWidth, + (pwPtr->proxyRelief != TK_RELIEF_NULL) ? pwPtr->proxyRelief : pwPtr->relief); #ifndef TK_NO_DOUBLE_BUFFERING /* diff --git a/tests/panedwindow.test b/tests/panedwindow.test index d088cfe..b075e18 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -32,7 +32,7 @@ foreach {testName testData} { panedwindow-1.9 {-proxybackground "#f0a0a0" "#f0a0a0" non-existent {unknown color name "non-existent"}} panedwindow-1.10 {-proxyborderwidth - 1.3 1 badValue {bad screen distance "badValue"}} + 1.3 1.3 badValue {bad screen distance "badValue"}} panedwindow-1.11 {-proxyrelief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h index e5b2598..4eb8778 100644 --- a/unix/tkUnixDefault.h +++ b/unix/tkUnixDefault.h @@ -358,25 +358,22 @@ * Defaults for panedwindows */ -#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG -#define DEF_PANEDWINDOW_BG_MONO WHITE -#define DEF_PANEDWINDOW_BORDERWIDTH "1" -#define DEF_PANEDWINDOW_CURSOR "" -#define DEF_PANEDWINDOW_HANDLEPAD "8" -#define DEF_PANEDWINDOW_HANDLESIZE "8" -#define DEF_PANEDWINDOW_HEIGHT "" -#define DEF_PANEDWINDOW_OPAQUERESIZE "1" -#define DEF_PANEDWINDOW_ORIENT "horizontal" -#define DEF_PANEDWINDOW_PROXYBORDERWIDTH "2" -#define DEF_PANEDWINDOW_PROXYBACKGROUND WHITE -#define DEF_PANEDWINDOW_PROXYRELIEF "flat" -#define DEF_PANEDWINDOW_RELIEF "flat" -#define DEF_PANEDWINDOW_SASHCURSOR "" -#define DEF_PANEDWINDOW_SASHPAD "0" -#define DEF_PANEDWINDOW_SASHRELIEF "flat" -#define DEF_PANEDWINDOW_SASHWIDTH "3" -#define DEF_PANEDWINDOW_SHOWHANDLE "0" -#define DEF_PANEDWINDOW_WIDTH "" +#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG +#define DEF_PANEDWINDOW_BG_MONO WHITE +#define DEF_PANEDWINDOW_BORDERWIDTH "1" +#define DEF_PANEDWINDOW_CURSOR "" +#define DEF_PANEDWINDOW_HANDLEPAD "8" +#define DEF_PANEDWINDOW_HANDLESIZE "8" +#define DEF_PANEDWINDOW_HEIGHT "" +#define DEF_PANEDWINDOW_OPAQUERESIZE "1" +#define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_RELIEF "flat" +#define DEF_PANEDWINDOW_SASHCURSOR "" +#define DEF_PANEDWINDOW_SASHPAD "0" +#define DEF_PANEDWINDOW_SASHRELIEF "flat" +#define DEF_PANEDWINDOW_SASHWIDTH "3" +#define DEF_PANEDWINDOW_SHOWHANDLE "0" +#define DEF_PANEDWINDOW_WIDTH "" /* * Defaults for panedwindow panes diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h index 8cceb2e..a1a76c7 100644 --- a/win/tkWinDefault.h +++ b/win/tkWinDefault.h @@ -361,25 +361,22 @@ * Defaults for panedwindows */ -#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG -#define DEF_PANEDWINDOW_BG_MONO WHITE -#define DEF_PANEDWINDOW_BORDERWIDTH "1" -#define DEF_PANEDWINDOW_CURSOR "" -#define DEF_PANEDWINDOW_HANDLEPAD "8" -#define DEF_PANEDWINDOW_HANDLESIZE "8" -#define DEF_PANEDWINDOW_HEIGHT "" -#define DEF_PANEDWINDOW_OPAQUERESIZE "1" -#define DEF_PANEDWINDOW_ORIENT "horizontal" -#define DEF_PANEDWINDOW_PROXYBORDERWIDTH "2" -#define DEF_PANEDWINDOW_PROXYBACKGROUND WHITE -#define DEF_PANEDWINDOW_PROXYRELIEF "flat" -#define DEF_PANEDWINDOW_RELIEF "flat" -#define DEF_PANEDWINDOW_SASHCURSOR "" -#define DEF_PANEDWINDOW_SASHPAD "0" -#define DEF_PANEDWINDOW_SASHRELIEF "flat" -#define DEF_PANEDWINDOW_SASHWIDTH "3" -#define DEF_PANEDWINDOW_SHOWHANDLE "0" -#define DEF_PANEDWINDOW_WIDTH "" +#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG +#define DEF_PANEDWINDOW_BG_MONO WHITE +#define DEF_PANEDWINDOW_BORDERWIDTH "1" +#define DEF_PANEDWINDOW_CURSOR "" +#define DEF_PANEDWINDOW_HANDLEPAD "8" +#define DEF_PANEDWINDOW_HANDLESIZE "8" +#define DEF_PANEDWINDOW_HEIGHT "" +#define DEF_PANEDWINDOW_OPAQUERESIZE "1" +#define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_RELIEF "flat" +#define DEF_PANEDWINDOW_SASHCURSOR "" +#define DEF_PANEDWINDOW_SASHPAD "0" +#define DEF_PANEDWINDOW_SASHRELIEF "flat" +#define DEF_PANEDWINDOW_SASHWIDTH "3" +#define DEF_PANEDWINDOW_SHOWHANDLE "0" +#define DEF_PANEDWINDOW_WIDTH "" /* * Defaults for panedwindow panes -- cgit v0.12 From 318860717b30126cdcbf60eccf3e6124d9630649 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 30 Sep 2015 09:28:05 +0000 Subject: .... forgot to bring back tkMacOSXDefault.h to original state --- macosx/tkMacOSXDefault.h | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index 0db03bc..0380de9 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -400,25 +400,22 @@ * Defaults for panedwindows */ -#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG -#define DEF_PANEDWINDOW_BG_MONO WHITE -#define DEF_PANEDWINDOW_BORDERWIDTH "1" -#define DEF_PANEDWINDOW_CURSOR "" -#define DEF_PANEDWINDOW_HANDLEPAD "8" -#define DEF_PANEDWINDOW_HANDLESIZE "8" -#define DEF_PANEDWINDOW_HEIGHT "" -#define DEF_PANEDWINDOW_OPAQUERESIZE "1" -#define DEF_PANEDWINDOW_ORIENT "horizontal" -#define DEF_PANEDWINDOW_PROXYBORDERWIDTH "2" -#define DEF_PANEDWINDOW_PROXYBACKGROUND WHITE -#define DEF_PANEDWINDOW_PROXYRELIEF "flat" -#define DEF_PANEDWINDOW_RELIEF "flat" -#define DEF_PANEDWINDOW_SASHCURSOR "" -#define DEF_PANEDWINDOW_SASHPAD "0" -#define DEF_PANEDWINDOW_SASHRELIEF "flat" -#define DEF_PANEDWINDOW_SASHWIDTH "3" -#define DEF_PANEDWINDOW_SHOWHANDLE "0" -#define DEF_PANEDWINDOW_WIDTH "" +#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG +#define DEF_PANEDWINDOW_BG_MONO WHITE +#define DEF_PANEDWINDOW_BORDERWIDTH "1" +#define DEF_PANEDWINDOW_CURSOR "" +#define DEF_PANEDWINDOW_HANDLEPAD "8" +#define DEF_PANEDWINDOW_HANDLESIZE "8" +#define DEF_PANEDWINDOW_HEIGHT "" +#define DEF_PANEDWINDOW_OPAQUERESIZE "1" +#define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_RELIEF "flat" +#define DEF_PANEDWINDOW_SASHCURSOR "" +#define DEF_PANEDWINDOW_SASHPAD "0" +#define DEF_PANEDWINDOW_SASHRELIEF "flat" +#define DEF_PANEDWINDOW_SASHWIDTH "3" +#define DEF_PANEDWINDOW_SHOWHANDLE "0" +#define DEF_PANEDWINDOW_WIDTH "" /* * Defaults for panedwindow panes -- cgit v0.12 From f85821a6b74d6b56588c8f06b242bc5ca703ca5a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 30 Sep 2015 09:39:01 +0000 Subject: Carefull inspection shows that the default for -proxyrelief should be the value of -sashrelief, in order to be 100% compatible with how it behaved before. --- doc/panedwindow.n | 2 +- generic/tkPanedWindow.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/panedwindow.n b/doc/panedwindow.n index 9ee79ec..ce7adc3 100644 --- a/doc/panedwindow.n +++ b/doc/panedwindow.n @@ -38,7 +38,7 @@ Specifies the borderwidth of the proxy. May be any value accepted by value of the \fB-borderwidth\fR option will be used. .OP \-proxyrelief proxyRelief ProxyRelief Relief to use when drawing the proxy. May be any of the standard Tk -relief values. If an empty string, the value of the \fB-relief\fR +relief values. If an empty string, the value of the \fB-sashrelief\fR option will be used. .OP \-opaqueresize opaqueResize OpaqueResize Specifies whether panes should be resized as a sash is moved (true), diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 8699ac3..85180bc 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -2786,7 +2786,7 @@ DisplayProxyWindow( pwPtr->proxyBackground ? pwPtr->proxyBackground : pwPtr->background, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), pwPtr->proxyBorderWidthPtr ? pwPtr->proxyBorderWidth : pwPtr->borderWidth, - (pwPtr->proxyRelief != TK_RELIEF_NULL) ? pwPtr->proxyRelief : pwPtr->relief); + (pwPtr->proxyRelief != TK_RELIEF_NULL) ? pwPtr->proxyRelief : pwPtr->sashRelief); #ifndef TK_NO_DOUBLE_BUFFERING /* -- cgit v0.12 From 018b392075235c25be318596aae86f832a7bdadb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 30 Sep 2015 10:04:55 +0000 Subject: One more suggestion: Use the value of -sashwidth as default for -proxyborderwidth. It's one pixel different from the current behavior (2 -> 3 pixels), but would be consistant with -proxyrelief vs -sashrelief. --- doc/panedwindow.n | 2 +- generic/tkPanedWindow.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/panedwindow.n b/doc/panedwindow.n index ce7adc3..0060dcd 100644 --- a/doc/panedwindow.n +++ b/doc/panedwindow.n @@ -35,7 +35,7 @@ value of the \fB-background\fR option will be used. .OP \-proxyborderwidth proxyBorderWidth ProxyBorderWidth Specifies the borderwidth of the proxy. May be any value accepted by \fBTk_GetPixels\fR. If an empty string, the -value of the \fB-borderwidth\fR option will be used. +value of the \fB-sashwidth\fR option will be used. .OP \-proxyrelief proxyRelief ProxyRelief Relief to use when drawing the proxy. May be any of the standard Tk relief values. If an empty string, the value of the \fB-sashrelief\fR diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 85180bc..159091f 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -2785,7 +2785,7 @@ DisplayProxyWindow( Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->proxyBackground ? pwPtr->proxyBackground : pwPtr->background, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), - pwPtr->proxyBorderWidthPtr ? pwPtr->proxyBorderWidth : pwPtr->borderWidth, + pwPtr->proxyBorderWidthPtr ? pwPtr->proxyBorderWidth : pwPtr->sashWidth, (pwPtr->proxyRelief != TK_RELIEF_NULL) ? pwPtr->proxyRelief : pwPtr->sashRelief); #ifndef TK_NO_DOUBLE_BUFFERING -- cgit v0.12 From ee2ce93b2a9f94bf0fb220792ca75b6bdce7478c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 30 Sep 2015 10:51:28 +0000 Subject: Hm, better keep the TIP as it is, not making it more difficult than it already is. --- doc/panedwindow.n | 3 +-- generic/tkPanedWindow.c | 9 ++++----- macosx/tkMacOSXDefault.h | 1 + unix/tkUnixDefault.h | 1 + win/tkWinDefault.h | 1 + 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/panedwindow.n b/doc/panedwindow.n index 0060dcd..33e1e12 100644 --- a/doc/panedwindow.n +++ b/doc/panedwindow.n @@ -34,8 +34,7 @@ Background color to use when drawing the proxy. If an empty string, the value of the \fB-background\fR option will be used. .OP \-proxyborderwidth proxyBorderWidth ProxyBorderWidth Specifies the borderwidth of the proxy. May be any value accepted by -\fBTk_GetPixels\fR. If an empty string, the -value of the \fB-sashwidth\fR option will be used. +\fBTk_GetPixels\fR. .OP \-proxyrelief proxyRelief ProxyRelief Relief to use when drawing the proxy. May be any of the standard Tk relief values. If an empty string, the value of the \fB-sashrelief\fR diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 159091f..99ed179 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -148,7 +148,7 @@ typedef struct PanedWindow { * off-screen pixmap onto screen. */ int proxyx, proxyy; /* Proxy x,y coordinates. */ Tk_3DBorder proxyBackground;/* Background color used to draw proxy. If NULL, use background. */ - Tcl_Obj *proxyBorderWidthPtr; /* Tcl_Obj rep for proxyBorderWidth, if NULL then use borderWitdh */ + Tcl_Obj *proxyBorderWidthPtr; /* Tcl_Obj rep for proxyBorderWidth */ int proxyBorderWidth; /* Borderwidth used to draw proxy. */ int proxyRelief; /* Relief used to draw proxy, if TK_RELIEF_NULL then use relief. */ Slave **slaves; /* Pointer to array of Slaves. */ @@ -306,8 +306,8 @@ static const Tk_OptionSpec optionSpecs[] = { 0, -1, Tk_Offset(PanedWindow, proxyBackground), TK_OPTION_NULL_OK, (ClientData) DEF_PANEDWINDOW_BG_MONO}, {TK_OPTION_PIXELS, "-proxyborderwidth", "proxyBorderWidth", "ProxyBorderWidth", - 0, Tk_Offset(PanedWindow, proxyBorderWidthPtr), Tk_Offset(PanedWindow, proxyBorderWidth), - TK_OPTION_NULL_OK, 0, GEOMETRY}, + DEF_PANEDWINDOW_PROXYBORDER, Tk_Offset(PanedWindow, proxyBorderWidthPtr), + Tk_Offset(PanedWindow, proxyBorderWidth), 0, 0, GEOMETRY}, {TK_OPTION_RELIEF, "-proxyrelief", "proxyRelief", "Relief", 0, -1, Tk_Offset(PanedWindow, proxyRelief), TK_OPTION_NULL_OK, 0, 0}, @@ -2784,8 +2784,7 @@ DisplayProxyWindow( Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->proxyBackground ? pwPtr->proxyBackground : pwPtr->background, - 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), - pwPtr->proxyBorderWidthPtr ? pwPtr->proxyBorderWidth : pwPtr->sashWidth, + 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), pwPtr->proxyBorderWidth, (pwPtr->proxyRelief != TK_RELIEF_NULL) ? pwPtr->proxyRelief : pwPtr->sashRelief); #ifndef TK_NO_DOUBLE_BUFFERING diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index 0380de9..60d6cda 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -409,6 +409,7 @@ #define DEF_PANEDWINDOW_HEIGHT "" #define DEF_PANEDWINDOW_OPAQUERESIZE "1" #define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_PROXYBORDER "2" #define DEF_PANEDWINDOW_RELIEF "flat" #define DEF_PANEDWINDOW_SASHCURSOR "" #define DEF_PANEDWINDOW_SASHPAD "0" diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h index 4eb8778..a8ecdc1 100644 --- a/unix/tkUnixDefault.h +++ b/unix/tkUnixDefault.h @@ -367,6 +367,7 @@ #define DEF_PANEDWINDOW_HEIGHT "" #define DEF_PANEDWINDOW_OPAQUERESIZE "1" #define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_PROXYBORDER "2" #define DEF_PANEDWINDOW_RELIEF "flat" #define DEF_PANEDWINDOW_SASHCURSOR "" #define DEF_PANEDWINDOW_SASHPAD "0" diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h index a1a76c7..d0bae8f 100644 --- a/win/tkWinDefault.h +++ b/win/tkWinDefault.h @@ -370,6 +370,7 @@ #define DEF_PANEDWINDOW_HEIGHT "" #define DEF_PANEDWINDOW_OPAQUERESIZE "1" #define DEF_PANEDWINDOW_ORIENT "horizontal" +#define DEF_PANEDWINDOW_PROXYBORDER "2" #define DEF_PANEDWINDOW_RELIEF "flat" #define DEF_PANEDWINDOW_SASHCURSOR "" #define DEF_PANEDWINDOW_SASHPAD "0" -- cgit v0.12 From a7bd1b8b54051af0e4a59ca36d6fa8cbbd221487 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 30 Sep 2015 11:16:38 +0000 Subject: Don't limit Universal runtime support to VisualStudio version 14 only, future versions will probably have it as well. --- win/configure | 4 ++-- win/tcl.m4 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/win/configure b/win/configure index 57e0453..c493d8b 100755 --- a/win/configure +++ b/win/configure @@ -3828,7 +3828,7 @@ echo "${ECHO_T}using shared flags" >&6 LIBRARIES="\${SHARED_LIBRARIES}" SHLIB_LD_LIBS='${LIBS}' case "x`echo \${VisualStudioVersion}`" in - x14*) + x1[4-9]*) lflags="${lflags} -nodefaultlib:libucrt.lib" ;; *) @@ -3873,7 +3873,7 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 LIBS="user32.lib advapi32.lib ws2_32.lib" case "x`echo \${VisualStudioVersion}`" in - x14*) + x1[4-9]*) LIBS="$LIBS ucrt.lib" ;; *) diff --git a/win/tcl.m4 b/win/tcl.m4 index 6f10a96..aa3c4b3 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -784,7 +784,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ LIBRARIES="\${SHARED_LIBRARIES}" SHLIB_LD_LIBS='${LIBS}' case "x`echo \${VisualStudioVersion}`" in - x14*) + x1[4-9]*) lflags="${lflags} -nodefaultlib:libucrt.lib" ;; *) @@ -826,7 +826,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ LIBS="user32.lib advapi32.lib ws2_32.lib" case "x`echo \${VisualStudioVersion}`" in - x14*) + x1[4-9]*) LIBS="$LIBS ucrt.lib" ;; *) -- cgit v0.12 From e2f4951c81ba0437d402871c1e5d5064e6c578a2 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 3 Oct 2015 19:32:12 +0000 Subject: Fixed bug [1669632fff] case (i) - autoseparator was missing on --- library/text.tcl | 3 +++ tests/text.test | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/library/text.tcl b/library/text.tcl index 0e43e61..1321334 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -85,6 +85,9 @@ bind Text { } bind Text { %W mark set insert @%x,%y + if {[%W cget -autoseparators]} { + %W edit separator + } } bind Text { tk::TextSetCursor %W insert-1displayindices diff --git a/tests/text.test b/tests/text.test index fa00ce3..e170fb4 100644 --- a/tests/text.test +++ b/tests/text.test @@ -3205,6 +3205,20 @@ test text-25.18 {patch 1469210 - inserting after undo} -setup { } -cleanup { destroy .t } -result 1 +test text-25.19 {patch 1669632 (i) - undo after Contron-1} -setup { + destroy .t +} -body { + text .t -undo 1 + .t insert end foo\nbar + .t edit reset + .t insert 2.2 WORLD + event generate .t -x 1 -y 1 + .t insert insert HELLO + .t edit undo + .t get 2.2 2.7 +} -cleanup { + destroy .t +} -result WORLD test text-26.1 {bug fix - 624372, ControlUtfProc long lines} { destroy .t -- cgit v0.12 From 232769312e8b6d7b1fa4bb3674b8afe660b8b59f Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 3 Oct 2015 19:33:41 +0000 Subject: Typo --- tests/text.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/text.test b/tests/text.test index e170fb4..0ea4a6e 100644 --- a/tests/text.test +++ b/tests/text.test @@ -3205,7 +3205,7 @@ test text-25.18 {patch 1469210 - inserting after undo} -setup { } -cleanup { destroy .t } -result 1 -test text-25.19 {patch 1669632 (i) - undo after Contron-1} -setup { +test text-25.19 {patch 1669632 (i) - undo after Control-1} -setup { destroy .t } -body { text .t -undo 1 -- cgit v0.12 From d842640197e344a68b6bb601ec39f74c1d071be0 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 3 Oct 2015 20:00:57 +0000 Subject: Fixed bug [1669632fff] case (iv) - autoseparator was missing on --- library/text.tcl | 3 +++ tests/text.test | 21 ++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/library/text.tcl b/library/text.tcl index 1321334..396ce1b 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -244,6 +244,9 @@ bind Text { } bind Text { %W tag remove sel 1.0 end + if {[%W cget -autoseparators]} { + %W edit separator + } } bind Text <> { tk_textCut %W diff --git a/tests/text.test b/tests/text.test index 0ea4a6e..661584d 100644 --- a/tests/text.test +++ b/tests/text.test @@ -3205,7 +3205,7 @@ test text-25.18 {patch 1469210 - inserting after undo} -setup { } -cleanup { destroy .t } -result 1 -test text-25.19 {patch 1669632 (i) - undo after Control-1} -setup { +test text-25.19 {patch 1669632 (i) - undo after } -setup { destroy .t } -body { text .t -undo 1 @@ -3219,6 +3219,25 @@ test text-25.19 {patch 1669632 (i) - undo after Control-1} -setup { } -cleanup { destroy .t } -result WORLD +test text-25.20 {patch 1669632 (iv) - undo after } -setup { + destroy .t +} -body { + toplevel .top + pack [text .top.t -undo 1] + .top.t insert end "This is an example text" + .top.t edit reset + .top.t mark set insert 1.5 + .top.t insert 1.5 HELLO + .top.t tag add sel 1.10 1.12 + update + focus -force .top.t + event generate .top.t + .top.t insert insert " WORLD " + .top.t edit undo + .top.t get 1.5 1.10 +} -cleanup { + destroy .top.t .top +} -result HELLO test text-26.1 {bug fix - 624372, ControlUtfProc long lines} { destroy .t -- cgit v0.12 From 2a9d9b8904088e9b63f5c507d775720ce88aa881 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 4 Oct 2015 08:29:59 +0000 Subject: Fixed bug [1669632fff] case (vii) - <> shall not remove separators --- library/text.tcl | 9 +++++++++ tests/text.test | 16 ++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/library/text.tcl b/library/text.tcl index 396ce1b..4a0e2c7 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -346,7 +346,16 @@ bind Text { } bind Text <> { + # An Undo operation may remove the separator at the top of the Undo stack. + # Then the item at the top of the stack gets merged with the subsequent changes. + # Place separators before and after Undo to prevent this. + if {[%W cget -autoseparators]} { + %W edit separator + } catch { %W edit undo } + if {[%W cget -autoseparators]} { + %W edit separator + } } bind Text <> { diff --git a/tests/text.test b/tests/text.test index 661584d..4eeb8e4 100644 --- a/tests/text.test +++ b/tests/text.test @@ -3238,6 +3238,22 @@ test text-25.20 {patch 1669632 (iv) - undo after } -setup { } -cleanup { destroy .top.t .top } -result HELLO +test text-25.21 {patch 1669632 (vii) - <> shall not remove separators} -setup { + destroy .t +} -body { + text .t -undo 1 + .t insert end "This is an example text" + .t edit reset + .t insert 1.5 "WORLD " + event generate .t -x 1 -y 1 + .t insert insert HELLO + event generate .t <> + .t insert insert E + event generate .t <> + .t get 1.0 "1.0 lineend" +} -cleanup { + destroy .t +} -result "This WORLD is an example text" test text-26.1 {bug fix - 624372, ControlUtfProc long lines} { destroy .t -- cgit v0.12 From 1ece15d3c02b97432d14fd339122e8302cc1a483 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 4 Oct 2015 08:31:40 +0000 Subject: Added forgotten comment for case (i) --- library/text.tcl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/text.tcl b/library/text.tcl index 4a0e2c7..080b133 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -85,6 +85,8 @@ bind Text { } bind Text { %W mark set insert @%x,%y + # An operation that moves the insert mark without making it + # one end of the selection must insert an autoseparator if {[%W cget -autoseparators]} { %W edit separator } -- cgit v0.12 From 520dc94723941cbb70de8f216cb8dce3868bfa59 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 4 Oct 2015 08:32:33 +0000 Subject: Added forgotten comment for case (iv) --- library/text.tcl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/text.tcl b/library/text.tcl index 080b133..f973984 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -246,6 +246,8 @@ bind Text { } bind Text { %W tag remove sel 1.0 end + # An operation that clears the selection must insert an autoseparator, + # because the selection operation may have moved the insert mark if {[%W cget -autoseparators]} { %W edit separator } -- cgit v0.12 From 605af9dd39143e83428df6fd8c1f06955da799fa Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 4 Oct 2015 09:04:42 +0000 Subject: Fixed bug [1669632fff] case (v) - <> is atomic --- library/text.tcl | 8 ++++++++ tests/text.test | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/library/text.tcl b/library/text.tcl index f973984..d7c0935 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -262,7 +262,15 @@ bind Text <> { tk_textPaste %W } bind Text <> { + # Make <> an atomic operation on the Undo stack, + # i.e. separate it from other delete operations on either side + if {[%W cget -autoseparators]} { + %W edit separator + } catch {%W delete sel.first sel.last} + if {[%W cget -autoseparators]} { + %W edit separator + } } bind Text <> { if {$tk_strictMotif || ![info exists tk::Priv(mouseMoved)] diff --git a/tests/text.test b/tests/text.test index 4eeb8e4..023aedf 100644 --- a/tests/text.test +++ b/tests/text.test @@ -3254,6 +3254,26 @@ test text-25.21 {patch 1669632 (vii) - <> shall not remove separators} -se } -cleanup { destroy .t } -result "This WORLD is an example text" +test text-25.22 {patch 1669632 (v) - <> is atomic} -setup { + destroy .t +} -body { + toplevel .top + pack [text .top.t -undo 1] + .top.t insert end "This is an example text" + .top.t edit reset + .top.t mark set insert 1.5 + .top.t insert 1.5 "A" + update + focus -force .top.t + event generate .top.t + event generate .top.t + event generate .top.t <> + event generate .top.t + event generate .top.t <> + .top.t get 1.0 "1.0 lineend" +} -cleanup { + destroy .t +} -result "This A an example text" test text-26.1 {bug fix - 624372, ControlUtfProc long lines} { destroy .t -- cgit v0.12 From d18323e55843fd090168c487519968d92c6ebe37 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 4 Oct 2015 13:52:17 +0000 Subject: Fixed -cleanup section in test text-25.22 --- tests/text.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/text.test b/tests/text.test index 023aedf..a85edfa 100644 --- a/tests/text.test +++ b/tests/text.test @@ -3272,7 +3272,7 @@ test text-25.22 {patch 1669632 (v) - <> is atomic} -setup { event generate .top.t <> .top.t get 1.0 "1.0 lineend" } -cleanup { - destroy .t + destroy .top.t .top } -result "This A an example text" test text-26.1 {bug fix - 624372, ControlUtfProc long lines} { -- cgit v0.12 From 69babf2af132856cc0221306450c09b368f89e9c Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 4 Oct 2015 13:55:14 +0000 Subject: Fixed bug [1669632fff] case (vi) - <> is atomic --- library/text.tcl | 9 +++++++++ tests/text.test | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/library/text.tcl b/library/text.tcl index d7c0935..792ee3b 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -1081,9 +1081,18 @@ proc ::tk_textCopy w { proc ::tk_textCut w { if {![catch {set data [$w get sel.first sel.last]}]} { + # make <> an atomic operation on the Undo stack, + # i.e. separate it from other delete operations on either side + set oldSeparator [$w cget -autoseparators] + if {$oldSeparator} { + $w edit separator + } clipboard clear -displayof $w clipboard append -displayof $w $data $w delete sel.first sel.last + if {$oldSeparator} { + $w edit separator + } } } diff --git a/tests/text.test b/tests/text.test index a85edfa..2e5e495 100644 --- a/tests/text.test +++ b/tests/text.test @@ -3274,6 +3274,26 @@ test text-25.22 {patch 1669632 (v) - <> is atomic} -setup { } -cleanup { destroy .top.t .top } -result "This A an example text" + test text-25.23 {patch 1669632 (v) - <> is atomic} -setup { + destroy .t +} -body { + toplevel .top + pack [text .top.t -undo 1] + .top.t insert end "This is an example text" + .top.t edit reset + .top.t mark set insert 1.5 + .top.t insert 1.5 "A" + update + focus -force .top.t + event generate .top.t + event generate .top.t + event generate .top.t <> + event generate .top.t + event generate .top.t <> + .top.t get 1.0 "1.0 lineend" +} -cleanup { + destroy .top.t .top +} -result "This A an example text" test text-26.1 {bug fix - 624372, ControlUtfProc long lines} { destroy .t -- cgit v0.12 From 39a05589d95ac9864792887ef9c223fa8b09fbaa Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 4 Oct 2015 14:07:49 +0000 Subject: Fixed bug [1669632fff] cases (ii) and (iii) - Tolerate a shaky hand using the mouse --- library/text.tcl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/text.tcl b/library/text.tcl index 792ee3b..68ca0f5 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -91,6 +91,10 @@ bind Text { %W edit separator } } +# stop an accidental double click triggering +bind Text { # nothing } +# stop an accidental movement triggering +bind Text { # nothing } bind Text { tk::TextSetCursor %W insert-1displayindices } -- cgit v0.12 From a53de23533cfa1c9481745f1a8c2d65f26a88124 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 5 Oct 2015 09:40:21 +0000 Subject: Use "cygpath -m" in stead of "cygpath -w", so paths (even windows ones) always have forward slashes. Suggested by pooryorick for [http://core.tcl.tk/tclconfig/tktview/06f1692bbe29449ac3f2161ebf9dd153d0349845|TEA], but a good idea anyway --- win/configure | 2 +- win/tcl.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/win/configure b/win/configure index c493d8b..bd48382 100755 --- a/win/configure +++ b/win/configure @@ -3425,7 +3425,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CYGPATH="cygpath -w" + ac_cv_prog_CYGPATH="cygpath -m" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi diff --git a/win/tcl.m4 b/win/tcl.m4 index aa3c4b3..46d3518 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -558,7 +558,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ # Set some defaults (may get changed below) EXTRA_CFLAGS="" - AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) + AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo) SHLIB_SUFFIX=".dll" -- cgit v0.12 From 1a403e858b44dbf3d3a12d896877397894fe3e36 Mon Sep 17 00:00:00 2001 From: ashok Date: Tue, 6 Oct 2015 06:14:34 +0000 Subject: Fix for [46c83f60] (relative paths ignored in tk_getOpenFile/tk_getSaveFile on Vista+). Added tests for -initialdir option. --- tests/winDialog.test | 193 +++++++++++++++++++++++++++++++++++++++++++++++++++ win/tkWinDialog.c | 31 ++++++--- 2 files changed, 213 insertions(+), 11 deletions(-) diff --git a/tests/winDialog.test b/tests/winDialog.test index b7847a5..6b8af59 100644 --- a/tests/winDialog.test +++ b/tests/winDialog.test @@ -339,6 +339,7 @@ test winDialog-5.11 {GetFileName: initial directory} -constraints { } return $x } -result [file join [initialdir] "12x 455"] + test winDialog-5.12 {GetFileName: initial directory: Tcl_TranslateFilename()} -constraints { nt } -body { @@ -346,6 +347,198 @@ test winDialog-5.12 {GetFileName: initial directory: Tcl_TranslateFilename()} -c tk_getOpenFile -initialdir ~12x/455 } -returnCodes error -result {user "12x" doesn't exist} + +test winDialog-5.12.1 {tk_getSaveFile: initial directory: ~} -constraints { + nt testwinevent +} -body { + unset -nocomplain x + start {set x [tk_getSaveFile \ + -initialdir ~ \ + -initialfile "5 12 1" -title Foo]} + then { + Click ok + } + return $x +} -result [file normalize [file join ~ "5 12 1"]] + +test winDialog-5.12.2 {tk_getSaveFile: initial directory: ~user} -constraints { + nt testwinevent DISABLED +} -body { + # Note: this test is currently disabled because of a bug in file normalize + # for names of the form ~xxx that returns the wrong dir on Windows. + # In particular (in Win8 at least) it returns /users/Default instead + # of /users/USERNAME... + + unset -nocomplain x + start {set x [tk_getSaveFile \ + -initialdir ~$::env(USERNAME) \ + -initialfile "5 12 2" -title Foo]} + then { + Click ok + } + return $x +} -result [file normalize [file join ~$::env(USERNAME) "5 12 2"]] + +test winDialog-5.12.3 {tk_getSaveFile: initial directory: .} -constraints { + nt testwinevent +} -body { + # Windows remembers dirs from previous selections so use + # a subdir for this test, not [initialdir] itself + set newdir [tcltest::makeDirectory "5 12 3"] + set cur [pwd] + try { + cd $newdir + unset -nocomplain x + start {set x [tk_getSaveFile \ + -initialdir . \ + -initialfile "testfile" -title Foo]} + then { + Click ok + } + } finally { + cd $cur + } + string equal $x [file join $newdir testfile] +} -result 1 + +test winDialog-5.12.4 {tk_getSaveFile: initial directory: unicode} -constraints { + nt testwinevent +} -body { + set dir [tcltest::makeDirectory "\u0167\u00e9\u015d\u0167"] + unset -nocomplain x + start {set x [tk_getSaveFile \ + -initialdir $dir \ + -initialfile "testfile" -title Foo]} + then { + Click ok + } + string equal $x [file join $dir testfile] +} -result 1 + +test winDialog-5.12.5 {tk_getSaveFile: initial directory: nativename} -constraints { + nt testwinevent +} -body { + unset -nocomplain x + start {set x [tk_getSaveFile \ + -initialdir [file nativename [initialdir]] \ + -initialfile "5 12 5" -title Foo]} + then { + Click ok + } + return $x +} -result [file join [initialdir] "5 12 5"] + +test winDialog-5.12.6 {tk_getSaveFile: initial directory: relative} -constraints { + nt testwinevent +} -body { + # Windows remembers dirs from previous selections so use + # a subdir for this test, not [initialdir] itself + set dir [tcltest::makeDirectory "5 12 6"] + set cur [pwd] + try { + cd [file dirname $dir] + unset -nocomplain x + start {set x [tk_getSaveFile \ + -initialdir "5 12 6" \ + -initialfile "testfile" -title Foo]} + then { + Click ok + } + } finally { + cd $cur + } + string equal $x [file join $dir testfile] +} -result 1 + +test winDialog-5.12.7 {tk_getOpenFile: initial directory: ~} -constraints { + nt testwinevent +} -body { + set fn [file tail [lindex [glob ~/*] 0]] + unset -nocomplain x + start {set x [tk_getOpenFile \ + -initialdir ~ \ + -initialfile $fn -title Foo]} + then { + Click ok + } + string equal $x [file normalize [file join ~ $fn]] +} -result 1 + +test winDialog-5.12.8 {tk_getOpenFile: initial directory: .} -constraints { + nt testwinevent +} -body { + # Windows remembers dirs from previous selections so use + # a subdir for this test, not [initialdir] itself + set newdir [tcltest::makeDirectory "5 12 8"] + set path [tcltest::makeFile "" "testfile" $newdir] + set cur [pwd] + try { + cd $newdir + unset -nocomplain x + start {set x [tk_getOpenFile \ + -initialdir . \ + -initialfile "testfile" -title Foo]} + then { + Click ok + } + } finally { + cd $cur + } + string equal $x $path +} -result 1 + +test winDialog-5.12.9 {tk_getOpenFile: initial directory: unicode} -constraints { + nt testwinevent +} -body { + set dir [tcltest::makeDirectory "\u0167\u00e9\u015d\u0167"] + set path [tcltest::makeFile "" testfile $dir] + unset -nocomplain x + start {set x [tk_getOpenFile \ + -initialdir $dir \ + -initialfile "testfile" -title Foo]} + then { + Click ok + } + string equal $x $path +} -result 1 + +test winDialog-5.12.10 {tk_getOpenFile: initial directory: nativename} -constraints { + nt testwinevent +} -body { + unset -nocomplain x + tcltest::makeFile "" "5 12 10" [initialdir] + start {set x [tk_getOpenFile \ + -initialdir [file nativename [initialdir]] \ + -initialfile "5 12 10" -title Foo]} + then { + Click ok + } + return $x +} -result [file join [initialdir] "5 12 10"] + +test winDialog-5.12.11 {tk_getOpenFile: initial directory: relative} -constraints { + nt testwinevent +} -body { + # Windows remembers dirs from previous selections so use + # a subdir for this test, not [initialdir] itself + set dir [tcltest::makeDirectory "5 12 11"] + set path [tcltest::makeFile "" testfile $dir] + set cur [pwd] + try { + cd [file dirname $dir] + unset -nocomplain x + start {set x [tk_getOpenFile \ + -initialdir [file tail $dir] \ + -initialfile "testfile" -title Foo]} + then { + Click ok + } + } finally { + cd $cur + } + string equal $x $path +} -result 1 + test winDialog-5.13 {GetFileName: initial file} -constraints { nt testwinevent } -body { diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index dc385e3..0188296 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -1388,18 +1388,27 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, } if (Tcl_DStringValue(&optsPtr->utfDirString)[0] != '\0') { - Tcl_DString dirString; - Tcl_WinUtfToTChar(Tcl_DStringValue(&optsPtr->utfDirString), - Tcl_DStringLength(&optsPtr->utfDirString), &dirString); - hr = ShellProcs.SHCreateItemFromParsingName( - (TCHAR *) Tcl_DStringValue(&dirString), NULL, - &IIDIShellItem, (void **) &dirIf); - /* XXX - Note on failure we do not raise error, simply ignore ini dir */ - if (SUCCEEDED(hr)) { - /* Note we use SetFolder, not SetDefaultFolder - see MSDN docs */ - fdlgIf->lpVtbl->SetFolder(fdlgIf, dirIf); /* Ignore errors */ + Tcl_Obj *normPath, *iniDirPath; + iniDirPath = Tcl_NewStringObj(Tcl_DStringValue(&optsPtr->utfDirString), -1); + Tcl_IncrRefCount(iniDirPath); + normPath = Tcl_FSGetNormalizedPath(interp, iniDirPath); + /* XXX - Note on failures do not raise error, simply ignore ini dir */ + if (normPath) { + const WCHAR *nativePath; + Tcl_IncrRefCount(normPath); + nativePath = Tcl_FSGetNativePath(normPath); /* Points INTO normPath*/ + if (nativePath) { + hr = ShellProcs.SHCreateItemFromParsingName( + nativePath, NULL, + &IIDIShellItem, (void **) &dirIf); + if (SUCCEEDED(hr)) { + /* Note we use SetFolder, not SetDefaultFolder - see MSDN */ + fdlgIf->lpVtbl->SetFolder(fdlgIf, dirIf); /* Ignore errors */ + } + } + Tcl_DecrRefCount(normPath); /* ALSO INVALIDATES nativePath !! */ } - Tcl_DStringFree(&dirString); + Tcl_DecrRefCount(iniDirPath); } oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); -- cgit v0.12 From f87593b772ee7134676c3a73f132bd8b8bf592e9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 6 Oct 2015 08:24:18 +0000 Subject: Double '[' and ']', otherwise re-generating "configure" doesn't give the expected result. --- win/tcl.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win/tcl.m4 b/win/tcl.m4 index 46d3518..2795086 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -784,7 +784,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ LIBRARIES="\${SHARED_LIBRARIES}" SHLIB_LD_LIBS='${LIBS}' case "x`echo \${VisualStudioVersion}`" in - x1[4-9]*) + x1[[4-9]]*) lflags="${lflags} -nodefaultlib:libucrt.lib" ;; *) @@ -826,7 +826,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ LIBS="user32.lib advapi32.lib ws2_32.lib" case "x`echo \${VisualStudioVersion}`" in - x1[4-9]*) + x1[[4-9]]*) LIBS="$LIBS ucrt.lib" ;; *) -- cgit v0.12 From 47a8d3de4e7b782b904446dcfe4897a631764254 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 6 Oct 2015 11:46:46 +0000 Subject: Fix [600b72bfbc789]: Unnecessary inclusion of tclInt.h in tkMain.c in Windows build The only thing needed from tclInt.h is the definition of TclIntPlatStubs. Including just a tiny part of this struct is enough to make it compile, without the need for tclInt.h --- generic/tkMain.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/generic/tkMain.c b/generic/tkMain.c index f6f4013..1b21223 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -55,7 +55,16 @@ extern int TkCygwinMainEx(int, char **, Tcl_AppInitProc *, Tcl_Interp *); * to strcmp here. */ #ifdef _WIN32 -# include "tclInt.h" +/* Little hack to eliminate the need for "tclInt.h" here: + Just copy a small portion of TclIntPlatStubs, just + enough to make it work. See [600b72bfbc] */ +typedef struct { + int magic; + void *hooks; + void (*dummy[16]) (void); /* dummy entries 0-15, not used */ + int (*tclpIsAtty) (int fd); /* 16 */ +} TclIntPlatStubs; +extern const TclIntPlatStubs *tclIntPlatStubsPtr; # include "tkWinInt.h" #else # define TCHAR char @@ -108,9 +117,9 @@ static int WinIsTty(int fd) { */ #if !defined(STATIC_BUILD) - if (tclStubsPtr->reserved9 && TclpIsAtty) { + if (tclStubsPtr->reserved9 && tclIntPlatStubsPtr->tclpIsAtty) { /* We are running on Cygwin */ - return TclpIsAtty(fd); + return tclIntPlatStubsPtr->tclpIsAtty(fd); } #endif handle = GetStdHandle(STD_INPUT_HANDLE + fd); -- cgit v0.12 From c7881f1311665010dcf5da4bab4d7a5f3b0ca631 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 6 Oct 2015 15:04:42 +0000 Subject: Link with userenv.lib, because it is now needed by Tcl. --- win/configure | 4 ++-- win/makefile.vc | 2 +- win/tcl.m4 | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/win/configure b/win/configure index 8671721..64aea44 100755 --- a/win/configure +++ b/win/configure @@ -3736,7 +3736,7 @@ echo $ECHO_N "checking compiler flags... $ECHO_C" >&6 if test "${GCC}" = "yes" ; then SHLIB_LD="" SHLIB_LD_LIBS='${LIBS}' - LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32" + LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -luserenv -lws2_32" # mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32" STLIB_LD='${AR} cr' @@ -3952,7 +3952,7 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 fi fi - LIBS="netapi32.lib kernel32.lib user32.lib advapi32.lib ws2_32.lib" + LIBS="netapi32.lib kernel32.lib user32.lib advapi32.lib userenv.lib ws2_32.lib" case "x`echo \${VisualStudioVersion}`" in x1[4-9]*) diff --git a/win/makefile.vc b/win/makefile.vc index 1b55cdf..ae43eb6 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -523,7 +523,7 @@ guilflags = $(lflags) -subsystem:windows tcllibs = $(TCLSTUBLIB) $(TCLIMPLIB) -baselibs = netapi32.lib kernel32.lib user32.lib advapi32.lib ws2_32.lib +baselibs = netapi32.lib kernel32.lib user32.lib advapi32.lib userenv.lib ws2_32.lib # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" diff --git a/win/tcl.m4 b/win/tcl.m4 index 80a5086..db86f6c 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -673,7 +673,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ if test "${GCC}" = "yes" ; then SHLIB_LD="" SHLIB_LD_LIBS='${LIBS}' - LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32" + LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -luserenv -lws2_32" # mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32" STLIB_LD='${AR} cr' @@ -834,7 +834,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ fi fi - LIBS="netapi32.lib kernel32.lib user32.lib advapi32.lib ws2_32.lib" + LIBS="netapi32.lib kernel32.lib user32.lib advapi32.lib userenv.lib ws2_32.lib" case "x`echo \${VisualStudioVersion}`" in x1[[4-9]]*) -- cgit v0.12 From 030aca39c08ef652e36870abdeee1bc2f2566e28 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 6 Oct 2015 22:47:31 +0000 Subject: Added test for bug [2262711fff] - Regexp search fails with Unicode and elide --- tests/text.test | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/text.test b/tests/text.test index fa00ce3..ee75a6c 100644 --- a/tests/text.test +++ b/tests/text.test @@ -2781,6 +2781,24 @@ test text-20.185 {TextSearchCmd, elide up to match} { lappend res [.t2 search -regexp bc 1.0] lappend res [.t2 search -regexp c 1.0] } {{} {} 1.0 2.1 2.0 3.1 2.0 3.0} +test text-20.185.1 {TextSearchCmd, elide up to match, with UTF-8 chars before the match} { + deleteWindows + pack [text .t2] + .t2 tag configure e -elide 0 + .t2 insert end A {} xyz e bb\n + .t2 insert end \u00c4 {} xyz e bb + set res {} + lappend res [.t2 search bb 1.0 "1.0 lineend"] + lappend res [.t2 search bb 2.0 "2.0 lineend"] + lappend res [.t2 search -regexp bb 1.0 "1.0 lineend"] + lappend res [.t2 search -regexp bb 2.0 "2.0 lineend"] + .t2 tag configure e -elide 1 + lappend res [.t2 search bb 1.0 "1.0 lineend"] + lappend res [.t2 search bb 2.0 "2.0 lineend"] + lappend res [.t2 search -regexp bb 1.0 "1.0 lineend"] + lappend res [.t2 search -regexp -elide bb 2.0 "2.0 lineend"] + lappend res [.t2 search -regexp bb 2.0 "2.0 lineend"] +} {1.4 2.4 1.4 2.4 1.4 2.4 1.4 2.4 2.4} test text-20.186 {TextSearchCmd, strict limits} { deleteWindows pack [text .t2] -- cgit v0.12 From 687cdd2ef3948e5acf8a888de2578fa194958bcf Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 6 Oct 2015 22:50:36 +0000 Subject: Fixed bug [2262711fff] - Regexp search fails with Unicode and elide --- generic/tkText.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/generic/tkText.c b/generic/tkText.c index f023509..cb89218 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -4196,7 +4196,11 @@ TextSearchFoundMatch( matchOffset += Tcl_NumUtfChars(segPtr->body.chars, -1); } } else { - leftToScan -= segPtr->size; + if (searchSpecPtr->exact) { + leftToScan -= segPtr->size; + } else { + leftToScan -= Tcl_NumUtfChars(segPtr->body.chars, -1); + } } curIndex.byteIndex += segPtr->size; } -- cgit v0.12 From a330258fc1d11057954a3f1c9ca93f06c10784cd Mon Sep 17 00:00:00 2001 From: ashok Date: Fri, 9 Oct 2015 04:03:31 +0000 Subject: Bug [47af31bd3a] - tk_getSaveFile adds . as extension. Also added more tests for -filetypes and -defaultextension combinations. --- tests/winDialog.test | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++- win/tkWinDialog.c | 25 +++++++---- 2 files changed, 131 insertions(+), 9 deletions(-) diff --git a/tests/winDialog.test b/tests/winDialog.test index 6b8af59..80a025c 100644 --- a/tests/winDialog.test +++ b/tests/winDialog.test @@ -265,6 +265,7 @@ test winDialog-5.6 {GetFileName: valid option, but missing value} -constraints { } -body { tk_getOpenFile -initialdir bar -title } -returnCodes error -result {value for "-title" missing} + test winDialog-5.7 {GetFileName: extension begins with .} -constraints { nt testwinevent } -body { @@ -281,6 +282,116 @@ test winDialog-5.7 {GetFileName: extension begins with .} -constraints { } -cleanup { unset msg } -result bar.foo + +test winDialog-5.7.1 {GetFileName: extension {} } -constraints { + nt testwinevent +} -body { + start {set x [tk_getSaveFile -defaultextension {} -title Save]} + set msg {} + then { + if {[catch {SetText [vista? 0x47C 0x3e9] bar} msg]} { + Click cancel + } else { + Click ok + } + } + set x "[file tail $x]$msg" +} -cleanup { + unset msg +} -result bar + +test winDialog-5.7.2 {GetFileName: extension {} Bug 47af31bd3ac6fbbb33cde1a5bab1e756ff2a6e00 } -constraints { + nt testwinevent +} -body { + start {set x [tk_getSaveFile -filetypes {{All *}} -defaultextension {} -title Save]} + set msg {} + then { + if {[catch {SetText [vista? 0x47C 0x3e9] bar} msg]} { + Click cancel + } else { + Click ok + } + } + set x "[file tail $x]$msg" +} -cleanup { + unset msg +} -result bar + +test winDialog-5.7.3 {GetFileName: extension {} Bug 47af31bd3ac6fbbb33cde1a5bab1e756ff2a6e00 } -constraints { + nt testwinevent +} -body { + start {set x [tk_getSaveFile -filetypes {{All *}} -defaultextension {} -title Save]} + set msg {} + then { + if {[catch {SetText [vista? 0x47C 0x3e9] bar.c} msg]} { + Click cancel + } else { + Click ok + } + } + set x "[file tail $x]$msg" +} -cleanup { + unset msg +} -result bar.c + +test winDialog-5.7.4 {GetFileName: extension {} } -constraints { + nt testwinevent +} -body { + # Although the docs do not explicitly mention, -filetypes seems to + # override -defaultextension + start {set x [tk_getSaveFile -filetypes {{C .c} {Tcl .tcl}} -defaultextension {foo} -title Save]} + set msg {} + then { + if {[catch {SetText [vista? 0x47C 0x3e9] bar} msg]} { + Click cancel + } else { + Click ok + } + } + set x "[file tail $x]$msg" +} -cleanup { + unset msg +} -result bar.c + +test winDialog-5.7.5 {GetFileName: extension {} } -constraints { + nt testwinevent +} -body { + # Although the docs do not explicitly mention, -filetypes seems to + # override -defaultextension + start {set x [tk_getSaveFile -filetypes {{C .c} {Tcl .tcl}} -defaultextension {} -title Save]} + set msg {} + then { + if {[catch {SetText [vista? 0x47C 0x3e9] bar} msg]} { + Click cancel + } else { + Click ok + } + } + set x "[file tail $x]$msg" +} -cleanup { + unset msg +} -result bar.c + + +test winDialog-5.7.6 {GetFileName: All/extension } -constraints { + nt testwinevent +} -body { + # In 8.6.4 this combination resulted in bar.ext.ext which is bad + start {set x [tk_getSaveFile -filetypes {{All *}} -defaultextension {ext} -title Save]} + set msg {} + then { + if {[catch {SetText [vista? 0x47C 0x3e9] bar} msg]} { + Click cancel + } else { + Click ok + } + } + set x "[file tail $x]$msg" +} -cleanup { + unset msg +} -result bar.ext + + test winDialog-5.8 {GetFileName: extension doesn't begin with .} -constraints { nt testwinevent } -body { @@ -362,7 +473,7 @@ test winDialog-5.12.1 {tk_getSaveFile: initial directory: ~} -constraints { } -result [file normalize [file join ~ "5 12 1"]] test winDialog-5.12.2 {tk_getSaveFile: initial directory: ~user} -constraints { - nt testwinevent DISABLED + nt testwinevent } -body { # Note: this test is currently disabled because of a bug in file normalize # for names of the form ~xxx that returns the wrong dir on Windows. @@ -377,7 +488,7 @@ test winDialog-5.12.2 {tk_getSaveFile: initial directory: ~user} -constraints { Click ok } return $x -} -result [file normalize [file join ~$::env(USERNAME) "5 12 2"]] +} -result [file normalize [file join $::env(USERPROFILE) "5 12 2"]] test winDialog-5.12.3 {tk_getSaveFile: initial directory: .} -constraints { nt testwinevent diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index 0188296..d7f63fb 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -1102,7 +1102,7 @@ ParseOFNOptions( for (i = 1; i < objc; i += 2) { int index; const char *string; - Tcl_Obj *valuePtr = objv[i + 1]; + Tcl_Obj *valuePtr; if (Tcl_GetIndexFromObjStruct(interp, objv[i], options, sizeof(struct Options), "option", 0, &index) != TCL_OK) { @@ -1112,19 +1112,25 @@ ParseOFNOptions( */ if (strcmp(Tcl_GetString(objv[i]), "-xpstyle")) goto error_return; - if (Tcl_GetBooleanFromObj(interp, valuePtr, + if (i + 1 == objc) { + Tcl_SetResult(interp, "value for \"-xpstyle\" missing", TCL_STATIC); + Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "VALUE", NULL); + goto error_return; + } + if (Tcl_GetBooleanFromObj(interp, objv[i+1], &optsPtr->forceXPStyle) != TCL_OK) goto error_return; continue; } else if (i + 1 == objc) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "value for \"%s\" missing", options[index].name)); - Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "VALUE", NULL); - goto error_return; + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "value for \"%s\" missing", options[index].name)); + Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "VALUE", NULL); + goto error_return; } + valuePtr = objv[i + 1]; string = Tcl_GetString(valuePtr); switch (options[index].value) { case FILE_DEFAULT: @@ -1185,6 +1191,7 @@ error_return: /* interp should already hold error */ /* On error, we need to clean up anything we might have allocated */ CleanupOFNOptions(optsPtr); return TCL_ERROR; + } @@ -1322,7 +1329,11 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, goto vamoose; if (filterPtr) { - flags |= FOS_STRICTFILETYPES; + /* + * Causes -filetypes {{All *}} -defaultextension ext to return + * foo.ext.ext when foo is typed into the entry box + * flags |= FOS_STRICTFILETYPES; + */ hr = fdlgIf->lpVtbl->SetFileTypes(fdlgIf, nfilters, filterPtr); if (FAILED(hr)) goto vamoose; -- cgit v0.12 From f5d4ffd4633b850b12389d71358c75289cc61b2c Mon Sep 17 00:00:00 2001 From: ashok Date: Fri, 9 Oct 2015 04:44:27 +0000 Subject: Added missing tests for tk_getOpenFile -defaultextension --- tests/winDialog.test | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/winDialog.test b/tests/winDialog.test index 80a025c..49d9c17 100644 --- a/tests/winDialog.test +++ b/tests/winDialog.test @@ -391,6 +391,35 @@ test winDialog-5.7.6 {GetFileName: All/extension } -constraints { unset msg } -result bar.ext +test winDialog-5.7.7 {tk_getOpenFile: -defaultextension} -constraints { + nt testwinevent +} -body { + unset -nocomplain x + tcltest::makeFile "" "5 7 7.ext" [initialdir] + start {set x [tk_getOpenFile \ + -defaultextension ext \ + -initialdir [file nativename [initialdir]] \ + -initialfile "5 7 7" -title Foo]} + then { + Click ok + } + return $x +} -result [file join [initialdir] "5 7 7.ext"] + +test winDialog-5.7.8 {tk_getOpenFile: -defaultextension} -constraints { + nt testwinevent +} -body { + unset -nocomplain x + tcltest::makeFile "" "5 7 8.ext" [initialdir] + start {set x [tk_getOpenFile \ + -defaultextension ext \ + -initialdir [file nativename [initialdir]] \ + -initialfile "5 7 8.ext" -title Foo]} + then { + Click ok + } + return $x +} -result [file join [initialdir] "5 7 8.ext"] test winDialog-5.8 {GetFileName: extension doesn't begin with .} -constraints { nt testwinevent -- cgit v0.12 From 40640915557de5d223efa4edaaa69c843cb138cd Mon Sep 17 00:00:00 2001 From: stu Date: Fri, 9 Oct 2015 13:19:57 +0000 Subject: Tk/OpenBSD/Sparc needs -fPIC. --- unix/configure | 2 +- unix/tcl.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/configure b/unix/configure index 7934d9e..a03d1c0 100755 --- a/unix/configure +++ b/unix/configure @@ -5364,7 +5364,7 @@ fi ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index a6cb41b..f6713e7 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1476,7 +1476,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) -- cgit v0.12 From 496701e1edf870a41c1a4022efbd457a5a73e7fd Mon Sep 17 00:00:00 2001 From: stu Date: Fri, 9 Oct 2015 13:31:49 +0000 Subject: Tk/OpenBSD/Sparc needs -fPIC. --- unix/configure | 14 +++++++------- unix/tcl.m4 | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/unix/configure b/unix/configure index 824d3b4..10e2b48 100755 --- a/unix/configure +++ b/unix/configure @@ -5783,7 +5783,7 @@ fi ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) @@ -10008,7 +10008,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. */ @@ -10016,7 +10016,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 @@ -10043,7 +10043,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 @@ -10057,18 +10057,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; } diff --git a/unix/tcl.m4 b/unix/tcl.m4 index b9f4896..4b9543c 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1500,7 +1500,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ ;; *) case "$arch" in - alpha|sparc64) + alpha|sparc|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) -- cgit v0.12 From 780118cbac5240ba602ff056b5bd34cb6a57046c Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 9 Oct 2015 19:54:29 +0000 Subject: Fixed bug [1815161] - .text count -ypixels wrong until widget is managed --- doc/text.n | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/text.n b/doc/text.n index 76c2467..3633703 100644 --- a/doc/text.n +++ b/doc/text.n @@ -1127,12 +1127,12 @@ each counting option given. Valid counting options are \fB\-chars\fR, \fB\-displaychars\fR, \fB\-displayindices\fR, \fB\-displaylines\fR, \fB\-indices\fR, \fB\-lines\fR, \fB\-xpixels\fR and \fB\-ypixels\fR. The default value, if no option is specified, is \fB\-indices\fR. There is an -additional possible option \fB\-update\fR which is a modifier. If given, -then all subsequent options ensure that any possible out of date -information is recalculated. This currently only has any effect for the -\fI\-ypixels\fR count (which, if \fB\-update\fR is not given, will use the text -widget's current cached value for each line). The count options are -interpreted as follows: +additional possible option \fB\-update\fR which is a modifier. If given (and +if the text widget is managed by a geometry manager), then all subsequent +options ensure that any possible out of date information is recalculated. +This currently only has any effect for the \fI\-ypixels\fR count (which, if +\fB\-update\fR is not given, will use the text widget's current cached value +for each line). The count options are interpreted as follows: .RS .IP \fB\-chars\fR count all characters, whether elided or not. Do not count -- cgit v0.12 From f59d9bb55362d99baf3a6e42b9e567232de14c56 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 9 Oct 2015 19:58:30 +0000 Subject: Fixed bug [1815161] - .text count -ypixels wrong until widget is managed --- doc/text.n | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/text.n b/doc/text.n index 899a402..ed9bc83 100644 --- a/doc/text.n +++ b/doc/text.n @@ -976,11 +976,12 @@ each counting option given. Valid counting options are \fB\-chars\fR, \fB\-displaychars\fR, \fB\-displayindices\fR, \fB\-displaylines\fR, \fB\-indices\fR, \fB\-lines\fR, \fB\-xpixels\fR and \fB\-ypixels\fR. The default value, if no option is specified, is \fB\-indices\fR. There is an -additional possible option \fB\-update\fR which is a modifier. If given, then -all subsequent options ensure that any possible out of date information is -recalculated. This currently only has any effect for the \fB\-ypixels\fR count -(which, if \fB\-update\fR is not given, will use the text widget's current -cached value for each line). The count options are interpreted as follows: +additional possible option \fB\-update\fR which is a modifier. If given (and +if the text widget is managed by a geometry manager), then all subsequent +options ensure that any possible out of date information is recalculated. +This currently only has any effect for the \fB\-ypixels\fR count (which, if +\fB\-update\fR is not given, will use the text widget's current cached value +for each line). The count options are interpreted as follows: .RS .IP \fB\-chars\fR count all characters, whether elided or not. Do not count embedded windows or -- cgit v0.12 From 73f570edce09082a865ef4a9f58569be3b120197 Mon Sep 17 00:00:00 2001 From: ashok Date: Sat, 10 Oct 2015 10:33:16 +0000 Subject: Fix comment in test winDialog-5.12.2 --- tests/winDialog.test | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/winDialog.test b/tests/winDialog.test index 49d9c17..3dc73ac 100644 --- a/tests/winDialog.test +++ b/tests/winDialog.test @@ -504,10 +504,11 @@ test winDialog-5.12.1 {tk_getSaveFile: initial directory: ~} -constraints { test winDialog-5.12.2 {tk_getSaveFile: initial directory: ~user} -constraints { nt testwinevent } -body { - # Note: this test is currently disabled because of a bug in file normalize - # for names of the form ~xxx that returns the wrong dir on Windows. - # In particular (in Win8 at least) it returns /users/Default instead - # of /users/USERNAME... + + # Note: this test will fail on Tcl versions 8.6.4 and earlier due + # to a bug in file normalize for names of the form ~xxx that + # returns the wrong dir on Windows. In particular (in Win8 at + # least) it returned /users/Default instead of /users/USERNAME... unset -nocomplain x start {set x [tk_getSaveFile \ -- cgit v0.12 From e70967071c3cadbe8e53ee3136451edaf78c98c9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 13 Oct 2015 13:47:58 +0000 Subject: Fix [908b78de9a6534d6]: winDialog.test terminates in error --- tests/winDialog.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/winDialog.test b/tests/winDialog.test index 3dc73ac..481ab42 100644 --- a/tests/winDialog.test +++ b/tests/winDialog.test @@ -518,7 +518,7 @@ test winDialog-5.12.2 {tk_getSaveFile: initial directory: ~user} -constraints { Click ok } return $x -} -result [file normalize [file join $::env(USERPROFILE) "5 12 2"]] +} -result [file normalize [file join ~$::env(USERNAME) "5 12 2"]] test winDialog-5.12.3 {tk_getSaveFile: initial directory: .} -constraints { nt testwinevent -- cgit v0.12 From 9d8606e31d73616b890450f60808afbd4355539b Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 16 Oct 2015 20:48:25 +0000 Subject: Fixed bug [1520118fff] - -validate resets to none --- doc/spinbox.n | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/spinbox.n b/doc/spinbox.n index 8ae6161..34b7014 100644 --- a/doc/spinbox.n +++ b/doc/spinbox.n @@ -196,7 +196,7 @@ dangerous to mix. Any problems have been overcome so that using the the spinbox widget. Using the \fBtextVariable\fR for read-only purposes will never cause problems. The danger comes when you try set the \fBtextVariable\fR to something that the \fBvalidateCommand\fR would not -accept, which causes \fBvalidate\fR to become \fInone\fR (the +accept, which causes \fBvalidate\fR to become \fBnone\fR (the \fBinvalidCommand\fR will not be triggered). The same happens when an error occurs evaluating the \fBvalidateCommand\fR. .PP @@ -216,6 +216,16 @@ in the \fBvalidateCommand\fR or \fBinvalidCommand\fR (whichever one you were editing the spinbox widget from). It is also recommended to not set an associated \fBtextVariable\fR during validation, as that can cause the spinbox widget to become out of sync with the \fBtextVariable\fR. +.PP +Also, the \fBvalidate\fR option will set itself to \fBnone\fR when the +spinbox value gets changed because of adjustment of \fBfrom\fR or \fBto\fR +and the \fBvalidateCommand\fR returns false. For instance +.CS + \fIspinbox pathName \-from 1 \-to 10 \-validate all \-vcmd {return 0}\fR +.CE +will in fact set the \fBvalidate\fR option to \fBnone\fR because the default +value for the spinbox gets changed (due to the \fBfrom\fR and \fBto\fR +options) to a value not accepted by the validation script. .SH "WIDGET COMMAND" .PP The \fBspinbox\fR command creates a new Tcl command whose -- cgit v0.12 From 72df3089578116c1b9fdfb15a1c9b1e20a66dc2a Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 18 Oct 2015 21:24:57 +0000 Subject: Proposed fix for [2160206fff] - Panic (Linux) when posting a menu of type menubar --- generic/tkMenu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 49b5935..b35be24 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -934,9 +934,14 @@ MenuWidgetObjCmd( * Tearoff menus are posted differently on Mac and Windows than * non-tearoffs. TkpPostMenu does not actually map the menu's window * on those platforms, and popup menus have to be handled specially. + * Also, menubar menues are not intended to be posted (bug 1567681, + * 2160206). */ - if (menuPtr->menuType != TEAROFF_MENU) { + if (menuPtr->menuType == MENUBAR) { + Tcl_AppendResult(interp, "a menubar menu cannot be posted", NULL); + return TCL_ERROR; + } else if (menuPtr->menuType != TEAROFF_MENU) { result = TkpPostMenu(interp, menuPtr, x, y); } else { result = TkPostTearoffMenu(interp, menuPtr, x, y); -- cgit v0.12 From 6bc08bebbd4985473021dabe1e9a6c9128e58d99 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 19 Oct 2015 20:32:57 +0000 Subject: Robustified text-9.2.46, which failed on Linux Debian 6.0 (bug [cc0ba31920]) --- tests/text.test | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/text.test b/tests/text.test index a58ffc2..0909d2f 100644 --- a/tests/text.test +++ b/tests/text.test @@ -714,22 +714,23 @@ test text-9.2.45 {TextWidgetCmd procedure, "count" option} -setup { } -result {0} test text-9.2.46 {TextWidgetCmd procedure, "count" option} -setup { toplevel .mytop - pack [text .mytop.t] - wm geometry .mytop 100x300+0+0 + pack [text .mytop.t -font TkFixedFont -bd 0 -padx 0 -wrap char] + set spec [font measure TkFixedFont "Line 1+++Line 1---Li"] ; # 20 chars + append spec x300+0+0 + wm geometry .mytop $spec .mytop.t delete 1.0 end update set res {} } -body { for {set i 1} {$i < 5} {incr i} { - # 0 1 2 3 4 - # 012345 678901234 567890123 456789012 34567890123456789 + # 0 1 2 3 4 + # 012345 678901234 567890123 456789012 34567890123456789 .mytop.t insert end "Line $i+++Line $i---Line $i///Line $i - This is Line [format %c [expr 64+$i]]\n" } .mytop.t tag configure hidden -elide true - .mytop.t tag add hidden 2.20 3.10 - .mytop.t configure -wrap char + .mytop.t tag add hidden 2.30 3.10 lappend res [.mytop.t count -displaylines 2.0 3.0] - lappend res [.mytop.t count -displaylines 2.0 3.40] + lappend res [.mytop.t count -displaylines 2.0 3.50] } -cleanup { destroy .mytop } -result {1 3} -- cgit v0.12 From 0d6fe722b85512fe0070d153408bba3e8d725b1a Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 20 Oct 2015 08:28:11 +0000 Subject: Fixed bug [1414025] - Thin insertion cursor not visible in entry --- generic/tkEntry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 6683cdc..f6ff9b9 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -1675,7 +1675,7 @@ DisplayEntry( Tk_CharBbox(entryPtr->textLayout, entryPtr->insertPos, &cursorX, NULL, NULL, NULL); cursorX += entryPtr->layoutX; - cursorX -= (entryPtr->insertWidth)/2; + cursorX -= (entryPtr->insertWidth == 1) ? 1 : (entryPtr->insertWidth)/2; Tk_SetCaretPos(entryPtr->tkwin, cursorX, baseY - fm.ascent, fm.ascent + fm.descent); if (entryPtr->insertPos >= entryPtr->leftIndex && cursorX < xBound) { -- cgit v0.12 From ed0b129f932f0c4247574dec0afc0a0ecb5077a1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 23 Oct 2015 07:21:41 +0000 Subject: Fix [908b78de9a] for OS X/X11 - which apparently doesn't set ::env(USERNAME) - as well. --- tests/winDialog.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/winDialog.test b/tests/winDialog.test index 481ab42..24441cf 100644 --- a/tests/winDialog.test +++ b/tests/winDialog.test @@ -512,13 +512,13 @@ test winDialog-5.12.2 {tk_getSaveFile: initial directory: ~user} -constraints { unset -nocomplain x start {set x [tk_getSaveFile \ - -initialdir ~$::env(USERNAME) \ + -initialdir ~$::tcl_platform(user) \ -initialfile "5 12 2" -title Foo]} then { Click ok } return $x -} -result [file normalize [file join ~$::env(USERNAME) "5 12 2"]] +} -result [file normalize [file join ~$::tcl_platform(user) "5 12 2"]] test winDialog-5.12.3 {tk_getSaveFile: initial directory: .} -constraints { nt testwinevent -- cgit v0.12 From 6aae6c7c27d9bc93bd2b4214f87f73c2ac500976 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 23 Oct 2015 07:43:41 +0000 Subject: Fix [916c1095438eae56]: Tk does not compile because GetVersionExW triggers warnings --- win/tkWinPort.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/win/tkWinPort.h b/win/tkWinPort.h index 8d7778c..b94628e 100644 --- a/win/tkWinPort.h +++ b/win/tkWinPort.h @@ -80,6 +80,13 @@ #define REDO_KEYSYM_LOOKUP /* + * See ticket [916c1095438eae56]: GetVersionExW triggers warnings + */ +#if defined(_MSC_VER) +# pragma warning(disable:4996) +#endif + +/* * The following macro checks to see whether there is buffered * input data available for a stdio FILE. */ -- cgit v0.12 From 02dd303fbbf431e473d72f9a91e00ee432f10705 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 23 Oct 2015 15:35:13 +0000 Subject: Bump to release number 8.5.19 --- README | 2 +- generic/tk.h | 4 ++-- library/tk.tcl | 2 +- unix/configure | 2 +- unix/configure.in | 2 +- unix/tk.spec | 2 +- win/configure | 2 +- win/configure.in | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README b/README index 6fad4bb..4d1dc24 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ README: Tk - This is the Tk 8.5.18 source distribution. + This is the Tk 8.5.19 source distribution. http://sourceforge.net/projects/tcl/files/Tcl/ You can get any source release of Tk from the URL above. diff --git a/generic/tk.h b/generic/tk.h index e356ce5..bf43b41 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -59,10 +59,10 @@ extern "C" { #define TK_MAJOR_VERSION 8 #define TK_MINOR_VERSION 5 #define TK_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TK_RELEASE_SERIAL 18 +#define TK_RELEASE_SERIAL 19 #define TK_VERSION "8.5" -#define TK_PATCH_LEVEL "8.5.18" +#define TK_PATCH_LEVEL "8.5.19" /* * A special definition used to allow this header file to be included from diff --git a/library/tk.tcl b/library/tk.tcl index a9db8cb..64fb6f6 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -15,7 +15,7 @@ package require Tcl 8.5 ;# Guard against [source] in an 8.4- interp before # Insist on running with compatible version of Tcl package require Tcl 8.5.0 # Verify that we have Tk binary and script components from the same release -package require -exact Tk 8.5.18 +package require -exact Tk 8.5.19 # Create a ::tk namespace namespace eval ::tk { diff --git a/unix/configure b/unix/configure index 10e2b48..41380f8 100755 --- a/unix/configure +++ b/unix/configure @@ -1338,7 +1338,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TK_VERSION=8.5 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=5 -TK_PATCH_LEVEL=".18" +TK_PATCH_LEVEL=".19" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" diff --git a/unix/configure.in b/unix/configure.in index bab5d8a..d4a8c28 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -25,7 +25,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ TK_VERSION=8.5 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=5 -TK_PATCH_LEVEL=".18" +TK_PATCH_LEVEL=".19" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" diff --git a/unix/tk.spec b/unix/tk.spec index fd51c52..02bb625 100644 --- a/unix/tk.spec +++ b/unix/tk.spec @@ -4,7 +4,7 @@ Name: tk Summary: Tk graphical toolkit for the Tcl scripting language. -Version: 8.5.18 +Version: 8.5.19 Release: 2 License: BSD Group: Development/Languages diff --git a/win/configure b/win/configure index bd48382..5c16b5b 100755 --- a/win/configure +++ b/win/configure @@ -1312,7 +1312,7 @@ SHELL=/bin/sh TK_VERSION=8.5 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=5 -TK_PATCH_LEVEL=".18" +TK_PATCH_LEVEL=".19" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ diff --git a/win/configure.in b/win/configure.in index 4634bb6..9dd7fb8 100644 --- a/win/configure.in +++ b/win/configure.in @@ -14,7 +14,7 @@ SHELL=/bin/sh TK_VERSION=8.5 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=5 -TK_PATCH_LEVEL=".18" +TK_PATCH_LEVEL=".19" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ -- cgit v0.12 From e70c123f6076f327d0675c187e53f3e9c7e52e3a Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 23 Oct 2015 16:20:08 +0000 Subject: Fixed [ac6ca22363] - ttk/spinbox-1.8.4 test fails on Win7 --- tests/ttk/spinbox.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ttk/spinbox.test b/tests/ttk/spinbox.test index f7741c6..32b77af 100644 --- a/tests/ttk/spinbox.test +++ b/tests/ttk/spinbox.test @@ -143,7 +143,7 @@ test spinbox-1.8.4 "-validate option: " -setup { .sb configure -validate all -validatecommand {lappend ::spinbox_test %P} pack .sb .sb set 50 - focus .sb + focus -force .sb after 500 {set ::spinbox_wait 1} ; vwait ::spinbox_wait set ::spinbox_test } -cleanup { -- cgit v0.12 From cd9cafa8325db1e113f2f38de9285a06eab4f432 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 23 Oct 2015 18:49:37 +0000 Subject: update changes --- changes | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/changes b/changes index d9d34a3..df3ab72 100644 --- a/changes +++ b/changes @@ -6987,3 +6987,48 @@ Tk Cocoa 2.0: App Store enabled (walzer,culler,desmera,owen,nyberg,reincke) *** POTENTIAL INCOMPATIBILITY *** --- Released 8.5.18, March 6, 2015 --- http://core.tcl.tk/tk/ for details + +2015-03-10 (bug) Cocoa: premature image free crash (walzer) + +2015-03-15 (bug) Cocoa: wish launches in front. [focus -force] works (culler) + +2015-04-09 (bug)[e4ed00] [$text index "1.0 display wordstart"] crash (vogel) + +2015-04-09 (bug)[562118] Unicode support of "wordstart" modifier (vogel) + +2015-05-05 (bug)[06c3fc] PNG alpha error corrupted output file (gauthier,porter) + +2015-05-24 (bug)[53f8fc] panedwindow geometry management (vogel) + +2015-05-26 (bug)[1641721] tk_getOpenFile symlink display doubled (nijtmans) + +2015-06-01 (bug)[d7bad5][2368195][3592454][1714535][1292219][3592454] + panedwindow fixes (vogel) + +2015-06-25 (bug)[805cff] Tk_ConfigureWidget() segfault (aspect,nijtmans) + +2015-07-13 (bug)[3f179a] Text widget crash with elided text (vogel) + +2015-07-16 (bug)[2886436] Stop [$text delete] acting before start index (vogel) + +2015-07-28 (bug)[1236306] TraverseToMenu error bound to toplevel destroy (vogel) + +2015-08-20 (bug)[00189c] MSVC 14: semi-static UCRT support (dower,nijtmans) + +2015-09-29 (bug)[1501749] Crash embedded window delete bound to (vogel) + +2015-10-08 (new feature)[TIP 437] New panedwindow options (vogel) + +2015-10-09 (bug)[1669632] [text] autoseparator placement (nash,vogel) + +2015-10-09 (bug)[2262711] [text] RE search Unicode+elided (kaitzschu,vogel) + +2015-10-09 (bug)[1815161] [$text count -ypixels] needs management (vogel) + +2015-10-22 (bug)[1520118] Document spinbox validate expectations (vogel) + +2015-10-22 (bug)[1414025] $entry insertion cursor visibility (vogel) + +Tk Cocoa 2.0: More drawing internals refinements (culler,walzer) + +--- Released 8.5.19, December 1, 2015 --- http://core.tcl.tk/tk/ for details -- cgit v0.12 From 4b830288d02e49fa96ed7b5d20bf8170297abcba Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 25 Oct 2015 19:22:38 +0000 Subject: Make compile with later Visual Studio versions (backported from Tk 8.6) --- win/ttkWinXPTheme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index 80b616d..6359891 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -25,7 +25,7 @@ int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd) { return TCL_OK; } #include #include -#ifdef HAVE_VSSYM32_H +#if defined(HAVE_VSSYM32_H) || _MSC_VER > 1500 # include #else # include -- cgit v0.12 From 2fb7c126ab1a68f237aee91ecd26b5f2eb6e074d Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 25 Oct 2015 19:58:08 +0000 Subject: Added new test to check for error triggering when posting a menu of type menubar --- tests/menu.test | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/menu.test b/tests/menu.test index cfe00b9..c797281 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -2566,6 +2566,15 @@ test menu-36.1 {menu -underline string overruns Bug 1599877} {} { tk::TraverseToMenu . "e" } {} +test menu-37.1 {menubar menues cannot be posted - bug 2160206} {} { + # On Linux the following used to panic + # It now returns an error (on all platforms) + catch {destroy .m} + menu .m -type menubar + list [catch ".m post 1 1" msg] $msg +} {1 {a menubar menu cannot be posted}} + + # cleanup deleteWindows cleanupTests -- cgit v0.12 From 6517ea57da28dce9742a12980122acc1c59a5671 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 25 Oct 2015 22:00:54 +0000 Subject: Fix [477949]: option readfile cannot use multibytes. Implementation adopted from AndroWish, but added support for UTF-8 BOM and added test-case. --- generic/tkOption.c | 13 +++++++++++-- tests/option.file3 | 18 ++++++++++++++++++ tests/option.test | 11 +++++++---- 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100755 tests/option.file3 diff --git a/generic/tkOption.c b/generic/tkOption.c index 91a6cc0..bff799b 100644 --- a/generic/tkOption.c +++ b/generic/tkOption.c @@ -1086,7 +1086,7 @@ ReadOptionFile( char *buffer; int result, bufferSize; Tcl_Channel chan; - Tcl_DString newName; + Tcl_DString newName, optString; /* * Prevent file system access in a safe interpreter. @@ -1136,7 +1136,16 @@ ReadOptionFile( } Tcl_Close(NULL, chan); buffer[bufferSize] = 0; - result = AddFromString(interp, tkwin, buffer, priority); + if ((bufferSize>2) && !memcmp(buffer, "\357\273\277", 3)) { + /* File starts with UTF-8 BOM */ + result = AddFromString(interp, tkwin, buffer+3, priority); + } else { + Tcl_DStringInit(&optString); + Tcl_ExternalToUtfDString(NULL, buffer, bufferSize, &optString); + result = AddFromString(interp, tkwin, Tcl_DStringValue(&optString), + priority); + Tcl_DStringFree(&optString); + } ckfree(buffer); return result; } diff --git a/tests/option.file3 b/tests/option.file3 new file mode 100755 index 0000000..87f41ae --- /dev/null +++ b/tests/option.file3 @@ -0,0 +1,18 @@ +! This file is a sample option (resource) database used to test +! Tk's option-handling capabilities. + +! Comment line \ + with a backslash-newline sequence embedded in it. + +*x1: blue + tktest.x2 : green +*\ +x3 \ + : pur\ +ple +*x 4: brówn +# More comments, this time delimited by hash-marks. + # Comment-line with space. +*x6: +*x9: \ \ \\\101\n +# comment line as last line of file. diff --git a/tests/option.test b/tests/option.test index 1bfcb7c..4668771 100644 --- a/tests/option.test +++ b/tests/option.test @@ -187,6 +187,7 @@ test option-14.12 {error conditions} { set option1 [file join [testsDirectory] option.file1] set option2 [file join [testsDirectory] option.file2] +set option3 [file join [testsDirectory] option.file3] test option-15.1 {database files} { list [catch {option read non-existent} msg] $msg @@ -207,16 +208,18 @@ test option-15.9 {database files} {option get . x3 color} burgundy test option-15.10 {database files} { list [catch {option read $option2} msg] $msg } {1 {missing colon on line 2}} +option read $option3 +test option-15.11 {database files} {option get . {x 4} color} br\xf3wn test option-16.1 {ReadOptionFile} { - set option3 [makeFile {} option.file3] - set file [open $option3 w] + set option4 [makeFile {} option.file3] + set file [open $option4 w] fconfigure $file -translation crlf puts $file "*x7: true\n*x8: false" close $file - option read $option3 userDefault + option read $option4 userDefault set result [list [option get . x7 color] [option get . x8 color]] - removeFile $option3 + removeFile $option4 set result } {true false} -- cgit v0.12 From ac5d8bfc752d831b0fabdbacb052749a8824edc9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 25 Oct 2015 22:54:53 +0000 Subject: Re-generate "configure" --- unix/configure | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/unix/configure b/unix/configure index 10e2b48..afd5bff 100755 --- a/unix/configure +++ b/unix/configure @@ -10008,7 +10008,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 Intrinsic.h. + # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -10016,7 +10016,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 @@ -10043,7 +10043,7 @@ else sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Intrinsic.h"; then + if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi @@ -10057,18 +10057,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="-lXt $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. */ -#include +#include int main () { -XtMalloc (0) +XrmInitialize () ; return 0; } -- cgit v0.12 From 59b3eec3567e7cea0ab68d0ce47b667957fea948 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Mon, 26 Oct 2015 11:23:46 +0000 Subject: Fix for PNG rendering on OS X 10.11; thanks to Stephan Meier for patch --- macosx/tkMacOSXXStubs.c | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index e03260f..a5f1c60 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -863,6 +863,7 @@ XGetImage( int format) { NSBitmapImageRep *bitmap_rep; + NSUInteger bitmap_fmt; XImage * imagePtr = NULL; char * bitmap = NULL; char * image_data=NULL; @@ -881,9 +882,10 @@ XGetImage( } bitmap_rep = BitmapRepFromDrawableRect(d, x, y,width, height); + bitmap_fmt = [bitmap_rep bitmapFormat]; if ( bitmap_rep == Nil || - [bitmap_rep bitmapFormat] != 0 || + (bitmap_fmt != 0 && bitmap_fmt != 1) || [bitmap_rep samplesPerPixel] != 4 || [bitmap_rep isPlanar] != 0 ) { TkMacOSXDbgMsg("XGetImage: Failed to construct NSBitmapRep"); @@ -894,9 +896,8 @@ XGetImage( NSImage* ns_image = [[NSImage alloc]initWithSize:image_size]; [ns_image addRepresentation:bitmap_rep]; - /* Assume premultiplied nonplanar data with 4 bytes per pixel and alpha last.*/ - if ( [bitmap_rep bitmapFormat] == 0 && - [bitmap_rep isPlanar ] == 0 && + /* Assume premultiplied nonplanar data with 4 bytes per pixel.*/ + if ( [bitmap_rep isPlanar ] == 0 && [bitmap_rep samplesPerPixel] == 4 ) { bytes_per_row = [bitmap_rep bytesPerRow]; size = bytes_per_row*height; @@ -906,14 +907,27 @@ XGetImage( bitmap = ckalloc(size); /* Oddly enough, the bitmap has the top row at the beginning, - and the pixels are in BGRA format. + and the pixels are in BGRA or ABGR format. */ - for (row=0, n=0; row Date: Mon, 26 Oct 2015 11:31:06 +0000 Subject: Fix for PNG rendering on OS X 10.11; thanks to Stephan Meier for patch --- macosx/tkMacOSXXStubs.c | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index 0be5416..59c6a56 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -890,6 +890,7 @@ XGetImage( int format) { NSBitmapImageRep *bitmap_rep; + NSUInteger bitmap_fmt; XImage * imagePtr = NULL; char * bitmap = NULL; char * image_data=NULL; @@ -908,9 +909,10 @@ XGetImage( } bitmap_rep = BitmapRepFromDrawableRect(d, x, y,width, height); + bitmap_fmt = [bitmap_rep bitmapFormat]; if ( bitmap_rep == Nil || - [bitmap_rep bitmapFormat] != 0 || + (bitmap_fmt != 0 && bitmap_fmt != 1) || [bitmap_rep samplesPerPixel] != 4 || [bitmap_rep isPlanar] != 0 ) { TkMacOSXDbgMsg("XGetImage: Failed to construct NSBitmapRep"); @@ -921,9 +923,8 @@ XGetImage( NSImage* ns_image = [[NSImage alloc]initWithSize:image_size]; [ns_image addRepresentation:bitmap_rep]; - /* Assume premultiplied nonplanar data with 4 bytes per pixel and alpha last.*/ - if ( [bitmap_rep bitmapFormat] == 0 && - [bitmap_rep isPlanar ] == 0 && +/* Assume premultiplied nonplanar data with 4 bytes per pixel.*/ + if ( [bitmap_rep isPlanar ] == 0 && [bitmap_rep samplesPerPixel] == 4 ) { bytes_per_row = [bitmap_rep bytesPerRow]; size = bytes_per_row*height; @@ -933,18 +934,30 @@ XGetImage( bitmap = ckalloc(size); /* Oddly enough, the bitmap has the top row at the beginning, - and the pixels are in BGRA format. + and the pixels are in BGRA or ABGR format. */ - for (row=0, n=0; row Date: Tue, 27 Oct 2015 20:14:29 +0000 Subject: Added missing word in man event --- doc/event.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/event.n b/doc/event.n index 0a5ced5..85033e9 100644 --- a/doc/event.n +++ b/doc/event.n @@ -424,7 +424,7 @@ the physical event. .PP Bindings on a virtual event may be created before the virtual event exists. Indeed, the virtual event never actually needs to be defined, for instance, -on platforms where the specific virtual event would meaningless or +on platforms where the specific virtual event would be meaningless or ungeneratable. .PP When a definition of a virtual event changes at run time, all windows -- cgit v0.12 From ead20630da62cb8674fea88a385281fd05a0bcd4 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 29 Oct 2015 20:19:21 +0000 Subject: Fixed bug [220854fff] - Trailing tab characters in entry widgets are not displayed --- generic/tkFont.c | 4 ++-- tests/entry.test | 8 ++++++++ tests/font.test | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/generic/tkFont.c b/generic/tkFont.c index 5d2ad43..7ff1ae9 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -2069,14 +2069,14 @@ Tk_ComputeTextLayout( NewChunk(&layoutPtr, &maxChunks, start, 1, curX, newX, baseline)->numDisplayChars = -1; start++; + curX = newX; + flags &= ~TK_AT_LEAST_ONE; if ((start < end) && ((wrapLength <= 0) || (newX <= wrapLength))) { /* * More chars can still fit on this line. */ - curX = newX; - flags &= ~TK_AT_LEAST_ONE; continue; } } else { diff --git a/tests/entry.test b/tests/entry.test index ffdbf45..27acfc1 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -778,6 +778,14 @@ test entry-6.11 {EntryComputeGeometry procedure} win { [expr 8+5*[font measure {helvetica 12} .]] \ [expr 8+5*[font measure {helvetica 12} X]] \ [expr 8+[font measure {helvetica 12} 12345]]] +test entry-6.12 {EntryComputeGeometry procedure} {fonts} { + catch {destroy .e} + entry .e -font $fixed -bd 2 -relief raised -width 20 + pack .e + .e insert end "012\t456\t" + update + list [.e index @81] [.e index @82] [.e index @116] [.e index @117] +} {6 7 7 8} catch {destroy .e} entry .e -width 10 -font $fixed -textvariable contents -xscrollcommand scroll diff --git a/tests/font.test b/tests/font.test index a02cc2e..9ed24dc 100644 --- a/tests/font.test +++ b/tests/font.test @@ -829,7 +829,7 @@ test font-24.10 {Tk_ComputeTextLayout: tab caused break} { lappend x [getsize] .b.l config -wrap 0 set x -} "{[expr $ax*3] $ay} {[expr $ax*3] [expr $ay*2]}" +} "{[expr $ax*8] $ay} {[expr $ax*8] [expr $ay*2]}" test font-24.11 {Tk_ComputeTextLayout: absorb spaces at eol} { set x {} .b.l config -text "000 000" -wrap [expr $ax*5] -- cgit v0.12 From 55fc97d827d04fb3bc87f34f5aba3ded5a7471eb Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 31 Oct 2015 20:30:27 +0000 Subject: Fixed bug [e51941c1b9] - text-9.2.47 fails sometimes --- tests/text.test | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/text.test b/tests/text.test index 0909d2f..7c1731d 100644 --- a/tests/text.test +++ b/tests/text.test @@ -745,6 +745,10 @@ test text-9.2.47 {TextWidgetCmd procedure, "count" option} -setup { .t tag configure hidden -elide true .t tag add hidden 5.7 11.0 update + # next line to be fully sure that asynchronous line heights calculation is + # up-to-date otherwise this test may fail (depending on the computer + # performance), especially when the . toplevel has small height + .t count -update -ypixels 1.0 end set y1 [lindex [.t yview] 1] .t count -displaylines 5.0 11.0 set y2 [lindex [.t yview] 1] -- cgit v0.12 From f265ae7f9741d5710decdabc637b2fa3ac105a0d Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 3 Nov 2015 10:45:05 +0000 Subject: Fixed entry part of bug [542199fff] - Double click on a lone character in an entry does not work --- library/entry.tcl | 10 ++++++++-- tests/event.test | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/library/entry.tcl b/library/entry.tcl index 382cc88..c3e573d 100644 --- a/library/entry.tcl +++ b/library/entry.tcl @@ -373,12 +373,18 @@ proc ::tk::EntryMouseSelect {w x} { } } word { - if {$cur < [$w index anchor]} { + if {$cur < $anchor} { set before [tcl_wordBreakBefore [$w get] $cur] set after [tcl_wordBreakAfter [$w get] [expr {$anchor-1}]] - } else { + } elseif {$cur > $anchor} { set before [tcl_wordBreakBefore [$w get] $anchor] set after [tcl_wordBreakAfter [$w get] [expr {$cur - 1}]] + } else { + if {[$w index @$Priv(pressX)] < $anchor} { + incr anchor -1 + } + set before [tcl_wordBreakBefore [$w get] $anchor] + set after [tcl_wordBreakAfter [$w get] $anchor] } if {$before < 0} { set before 0 diff --git a/tests/event.test b/tests/event.test index fa75610..95be5f4 100644 --- a/tests/event.test +++ b/tests/event.test @@ -705,7 +705,7 @@ test event-7.1(double-click) {A double click on a lone character set result } {1.3 A 1.3 A} test event-7.2(double-click) {A double click on a lone character\ - in an entry widget should select that character} {knownBug} { + in an entry widget should select that character} { destroy .t set t [toplevel .t] set e [entry $t.e] @@ -766,7 +766,7 @@ test event-7.2(double-click) {A double click on a lone character\ lappend result [_get_selection $e] set result -} {3 A 4 A} +} {4 A 4 A} # cleanup -- cgit v0.12 From 79468c974649ac8235e35f8b07d862476c72695e Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 5 Nov 2015 07:06:01 +0000 Subject: Fixed bug [297442da29] - tk_strictMotif not correctly taken into account --- doc/text.n | 5 ++--- library/tk.tcl | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/text.n b/doc/text.n index 3633703..2e9bffc 100644 --- a/doc/text.n +++ b/doc/text.n @@ -2222,9 +2222,8 @@ after copying it to the clipboard. Control-t reverses the order of the two characters to the right of the insertion cursor. .IP [32] -Control-z (and Control-underscore on UNIX when \fBtk_strictMotif\fR is -true) undoes the last edit action if the \fB\-undo\fR option is true. -Does nothing otherwise. +Control-z undoes the last edit action if the \fB\-undo\fR option is +true. Does nothing otherwise. .IP [33] Control-Z (or Control-y on Windows) reapplies the last undone edit action if the \fB\-undo\fR option is true. Does nothing otherwise. diff --git a/library/tk.tcl b/library/tk.tcl index a9db8cb..d045222 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -308,7 +308,6 @@ proc ::tk::EventMotifBindings {n1 dummy dummy} { event $op <> event $op <> event $op <> - event $op <> } #---------------------------------------------------------------------- -- cgit v0.12 From e8a7079f69245ef6d172654bac53c15d27c81c56 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 6 Nov 2015 17:49:38 +0000 Subject: Fixed bug [3601604fff] - [listbox $path -takefocus 0] steals focus --- doc/listbox.n | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/listbox.n b/doc/listbox.n index b2e8e38..642e1f0 100644 --- a/doc/listbox.n +++ b/doc/listbox.n @@ -414,7 +414,7 @@ In \fBbrowse\fR mode it is also possible to drag the selection with button 1. .VS 8.5 On button 1, the listbox will also take focus if it has a \fBnormal\fR -state and \fB\-takefocus\fR is true. +state. .VE 8.5 .PP If the selection mode is \fBmultiple\fR or \fBextended\fR, -- cgit v0.12 From e0a9544076a1f3f079fdd4143ad1214a4cfc4729 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 7 Nov 2015 18:41:19 +0000 Subject: Fix for issues with bitmap rendering and mouse events in Tk-Cocoa; thanks to Marc Culler for patches --- macosx/tkMacOSXDraw.c | 90 +++++++++++++++++++++++++-------------------- macosx/tkMacOSXMouseEvent.c | 58 +++++++++++++++++++++-------- macosx/tkMacOSXPrivate.h | 1 + 3 files changed, 94 insertions(+), 55 deletions(-) diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 5f31a2c..185d65a 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -141,7 +141,7 @@ BitmapRepFromDrawableRect( if ( mac_drawable->flags & TK_IS_PIXMAP ) { /* This means that the MacDrawable is functioning as a Tk Pixmap, so its view - field is NULL. It's context field should point to a CGImage. + field is NULL. */ cg_context = GetCGContextForDrawable(drawable); CGRect image_rect = CGRectMake(x, y, width, height); @@ -199,10 +199,10 @@ XCopyArea( Display *display, /* Display. */ Drawable src, /* Source drawable. */ Drawable dst, /* Destination drawable. */ - GC gc, /* GC to use. */ + GC gc, /* GC to use. */ int src_x, /* X & Y, width & height */ int src_y, /* define the source rectangle */ - unsigned int width, /* that will be copied. */ + unsigned int width, /* that will be copied. */ unsigned int height, int dest_x, /* Dest X & Y on dest rect. */ int dest_y) @@ -282,10 +282,10 @@ XCopyPlane( Display *display, /* Display. */ Drawable src, /* Source drawable. */ Drawable dst, /* Destination drawable. */ - GC gc, /* GC to use. */ + GC gc, /* GC to use. */ int src_x, /* X & Y, width & height */ int src_y, /* define the source rectangle */ - unsigned int width, /* that will be copied. */ + unsigned int width, /* that will be copied. */ unsigned int height, int dest_x, /* Dest X & Y on dest rect. */ int dest_y, @@ -293,6 +293,7 @@ XCopyPlane( { TkMacOSXDrawingContext dc; MacDrawable *srcDraw = (MacDrawable *) src; + MacDrawable *dstDraw = (MacDrawable *) dst; display->request++; if (!width || !height) { @@ -306,33 +307,47 @@ XCopyPlane( if (!TkMacOSXSetupDrawingContext(dst, gc, 1, &dc)) { return; } - if (dc.context) { + CGContextRef context = dc.context; + if (context) { CGImageRef img = TkMacOSXCreateCGImageWithDrawable(src); - if (img) { TkpClipMask *clipPtr = (TkpClipMask *) gc->clip_mask; unsigned long imageBackground = gc->background; - - if (clipPtr && clipPtr->type == TKP_CLIP_PIXMAP && - clipPtr->value.pixmap == src) { - imageBackground = TRANSPARENT_PIXEL << 24; + if (clipPtr && clipPtr->type == TKP_CLIP_PIXMAP){ + CGImageRef mask = TkMacOSXCreateCGImageWithDrawable(clipPtr->value.pixmap); + CGRect rect = CGRectMake(dest_x, dest_y, width, height); + rect = CGRectOffset(rect, dstDraw->xOff, dstDraw->yOff); + CGContextSaveGState(context); + /* Move the origin of the destination to top left. */ + CGContextTranslateCTM(context, 0, rect.origin.y + CGRectGetMaxY(rect)); + CGContextScaleCTM(context, 1, -1); + /* Fill with the background color, clipping to the mask. */ + CGContextClipToMask(context, rect, mask); + TkMacOSXSetColorInContext(gc, gc->background, dc.context); + CGContextFillRect(dc.context, rect); + /* Fill with the foreground color, clipping to the intersection of img and mask. */ + CGContextClipToMask(context, rect, img); + TkMacOSXSetColorInContext(gc, gc->foreground, context); + CGContextFillRect(context, rect); + CGContextRestoreGState(context); + CGImageRelease(mask); + CGImageRelease(img); + } else { + DrawCGImage(dst, gc, dc.context, img, gc->foreground, imageBackground, + CGRectMake(0, 0, srcDraw->size.width, srcDraw->size.height), + CGRectMake(src_x, src_y, width, height), + CGRectMake(dest_x, dest_y, width, height)); + CGImageRelease(img); } - DrawCGImage(dst, gc, dc.context, img, gc->foreground, - imageBackground, CGRectMake(0, 0, - srcDraw->size.width, srcDraw->size.height), - CGRectMake(src_x, src_y, width, height), - CGRectMake(dest_x, dest_y, width, height)); - CFRelease(img); - } else { + } else { /* no image */ TkMacOSXDbgMsg("Invalid source drawable"); } } else { - TkMacOSXDbgMsg("Invalid destination drawable"); + TkMacOSXDbgMsg("Invalid destination drawable - could not get a bitmap context."); } TkMacOSXRestoreDrawingContext(&dc); - } else { - XCopyArea(display, src, dst, gc, src_x, src_y, width, height, dest_x, - dest_y); + } else { /* source drawable is a window, not a Pixmap */ + XCopyArea(display, src, dst, gc, src_x, src_y, width, height, dest_x, dest_y); } } @@ -356,16 +371,16 @@ XCopyPlane( int TkPutImage( unsigned long *colors, /* Unused on Macintosh. */ - int ncolors, /* Unused on Macintosh. */ + int ncolors, /* Unused on Macintosh. */ Display* display, /* Display. */ Drawable d, /* Drawable to place image on. */ - GC gc, /* GC to use. */ + GC gc, /* GC to use. */ XImage* image, /* Image to place. */ int src_x, /* Source X & Y. */ int src_y, int dest_x, /* Destination X & Y. */ int dest_y, - unsigned int width, /* Same width & height for both */ + unsigned int width, /* Same width & height for both */ unsigned int height) /* distination and source. */ { TkMacOSXDrawingContext dc; @@ -431,11 +446,12 @@ CreateCGImageWithXImage( * BW image */ + /* Reverses the sense of the bits */ static const CGFloat decodeWB[2] = {1, 0}; + decode = decodeWB; bitsPerComponent = 1; bitsPerPixel = 1; - decode = decodeWB; if (image->bitmap_bit_order != MSBFirst) { char *srcPtr = image->data + image->xoffset; char *endPtr = srcPtr + len; @@ -445,22 +461,20 @@ CreateCGImageWithXImage( *destPtr++ = xBitReverseTable[(unsigned char)(*(srcPtr++))]; } } else { - data = memcpy(ckalloc(len), image->data + image->xoffset, - len); + data = memcpy(ckalloc(len), image->data + image->xoffset, len); } if (data) { provider = CGDataProviderCreateWithData(data, data, len, releaseData); } if (provider) { img = CGImageMaskCreate(image->width, image->height, bitsPerComponent, - bitsPerPixel, image->bytes_per_line, - provider, decode, 0); + bitsPerPixel, image->bytes_per_line, provider, decode, 0); } } else if (image->format == ZPixmap && image->bits_per_pixel == 32) { /* * Color image */ - + CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); bitsPerComponent = 8; @@ -476,6 +490,7 @@ CreateCGImageWithXImage( img = CGImageCreate(image->width, image->height, bitsPerComponent, bitsPerPixel, image->bytes_per_line, colorspace, bitmapInfo, provider, decode, 0, kCGRenderingIntentDefault); + CFRelease(provider); } if (colorspace) { CFRelease(colorspace); @@ -483,10 +498,6 @@ CreateCGImageWithXImage( } else { TkMacOSXDbgMsg("Unsupported image type"); } - if (provider) { - CFRelease(provider); - } - return img; } @@ -660,8 +671,7 @@ GetCGContextForDrawable( kCGBitmapByteOrderDefault; #endif char *data; - CGRect bounds = CGRectMake(0, 0, macDraw->size.width, - macDraw->size.height); + CGRect bounds = CGRectMake(0, 0, macDraw->size.width, macDraw->size.height); if (macDraw->flags & TK_IS_BW_PIXMAP) { bitsPerPixel = 8; @@ -738,6 +748,7 @@ DrawCGImage( if (CGImageIsMask(image)) { /*CGContextSaveGState(context);*/ if (macDraw->flags & TK_IS_BW_PIXMAP) { + /* Set fill color to black, background comes from the context, or is transparent. */ if (imageBackground != TRANSPARENT_PIXEL << 24) { CGContextClearRect(context, dstBounds); } @@ -750,6 +761,7 @@ DrawCGImage( TkMacOSXSetColorInContext(gc, imageForeground, context); } } + #ifdef TK_MAC_DEBUG_IMAGE_DRAWING CGContextSaveGState(context); CGContextSetLineWidth(context, 1.0); @@ -768,9 +780,9 @@ DrawCGImage( dstBounds.origin.x, dstBounds.origin.y, dstBounds.size.width, dstBounds.size.height); #else /* TK_MAC_DEBUG_IMAGE_DRAWING */ + CGContextSaveGState(context); - CGContextTranslateCTM(context, 0, - dstBounds.origin.y + CGRectGetMaxY(dstBounds)); + CGContextTranslateCTM(context, 0, dstBounds.origin.y + CGRectGetMaxY(dstBounds)); CGContextScaleCTM(context, 1, -1); CGContextDrawImage(context, dstBounds, image); CGContextRestoreGState(context); diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 8c0a2e6..31038b5 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -34,6 +34,18 @@ enum { NSWindowWillMoveEventType = 20 }; +/* + * In OS X 10.6 an NSEvent of type NSMouseMoved would always have a non-Nil + * window attribute when the mouse was inside a window. As of 10.8 this + * behavior had changed. The new behavior was that if the mouse were ever + * moved outside of a window, all subsequent NSMouseMoved NSEvents would have a + * Nil window attribute. To work around this we remember which window the + * mouse is in by saving the window attribute of each NSEvent of type + * NSMouseEntered. If an NSEvent has a Nil window attribute we use our saved + * window. It may be the case that the mouse has actually left the window, but + * this is harmless since Tk will ignore the event in that case. + */ + @implementation TKApplication(TKMouseEvent) - (NSEvent *) tkProcessMouseEvent: (NSEvent *) theEvent { @@ -49,12 +61,11 @@ enum { switch (type) { case NSMouseEntered: + /* Remember which window has the mouse. */ + _windowWithMouse = [theEvent window]; + break; case NSMouseExited: case NSCursorUpdate: -#if 0 - trackingArea = [theEvent trackingArea]; - /* fall through */ -#endif case NSLeftMouseDown: case NSLeftMouseUp: case NSRightMouseDown: @@ -65,14 +76,6 @@ enum { case NSRightMouseDragged: case NSOtherMouseDragged: case NSMouseMoved: -#if 0 - eventNumber = [theEvent eventNumber]; - if (!trackingArea) { - clickCount = [theEvent clickCount]; - buttonNumber = [theEvent buttonNumber]; - } - /* fall through */ -#endif case NSTabletPoint: case NSTabletProximity: case NSScrollWheel: @@ -85,13 +88,36 @@ enum { /* Create an Xevent to add to the Tk queue. */ win = [theEvent window]; NSPoint global, local = [theEvent locationInWindow]; - if (win) { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 + /* convertBaseToScreen and convertScreenToBase were deprecated in 10.7. */ + NSRect pointrect; + pointrect.origin = local; + pointrect.size.width = 0; + pointrect.size.height = 0; +#endif + if (win) { /* local will be in window coordinates. */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 + global = [win convertRectToScreen:pointrect].origin; +#else global = [win convertBaseToScreen:local]; +#endif local.y = [win frame].size.height - local.y; global.y = tkMacOSXZeroScreenHeight - global.y; - } else { - local.y = tkMacOSXZeroScreenHeight - local.y; - global = local; + } else { /* local will be in screen coordinates. */ + if (_windowWithMouse ) { + win = _windowWithMouse; + global = local; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 + local = [win convertRectFromScreen:pointrect].origin; +#else + local = [win convertScreenToBase:local]; +#endif + local.y = [win frame].size.height - local.y; + global.y = tkMacOSXZeroScreenHeight - global.y; + } else { /* We have no window. Use the screen???*/ + local.y = tkMacOSXZeroScreenHeight - local.y; + global = local; + } } Window window = TkMacOSXGetXWindow(win); diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 2de3673..1d20081 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -274,6 +274,7 @@ VISIBILITY_HIDDEN TKMenu *_defaultMainMenu, *_defaultApplicationMenu; NSArray *_defaultApplicationMenuItems, *_defaultWindowsMenuItems; NSArray *_defaultHelpMenuItems; + NSWindow *_windowWithMouse; } @end @interface TKApplication(TKInit) -- cgit v0.12 From 509e52d9d0542fdf3883f95edf264045eba9ba5a Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 7 Nov 2015 18:52:25 +0000 Subject: Fix for issues with bitmap rendering and mouse events in Tk-Cocoa; thanks to Marc Culler for patches --- macosx/tkMacOSXDraw.c | 86 ++++++++++++++++++++++++++------------------- macosx/tkMacOSXMouseEvent.c | 50 +++++++++++++++++++++----- macosx/tkMacOSXPrivate.h | 1 + 3 files changed, 92 insertions(+), 45 deletions(-) diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 3f51d00..7ec7b90 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -141,7 +141,7 @@ BitmapRepFromDrawableRect( if ( mac_drawable->flags & TK_IS_PIXMAP ) { /* This means that the MacDrawable is functioning as a Tk Pixmap, so its view - field is NULL. It's context field should point to a CGImage. + field is NULL. */ cg_context = GetCGContextForDrawable(drawable); CGRect image_rect = CGRectMake(x, y, width, height); @@ -199,10 +199,10 @@ XCopyArea( Display *display, /* Display. */ Drawable src, /* Source drawable. */ Drawable dst, /* Destination drawable. */ - GC gc, /* GC to use. */ + GC gc, /* GC to use. */ int src_x, /* X & Y, width & height */ int src_y, /* define the source rectangle */ - unsigned int width, /* that will be copied. */ + unsigned int width, /* that will be copied. */ unsigned int height, int dest_x, /* Dest X & Y on dest rect. */ int dest_y) @@ -282,10 +282,10 @@ XCopyPlane( Display *display, /* Display. */ Drawable src, /* Source drawable. */ Drawable dst, /* Destination drawable. */ - GC gc, /* GC to use. */ + GC gc, /* GC to use. */ int src_x, /* X & Y, width & height */ int src_y, /* define the source rectangle */ - unsigned int width, /* that will be copied. */ + unsigned int width, /* that will be copied. */ unsigned int height, int dest_x, /* Dest X & Y on dest rect. */ int dest_y, @@ -293,6 +293,7 @@ XCopyPlane( { TkMacOSXDrawingContext dc; MacDrawable *srcDraw = (MacDrawable *) src; + MacDrawable *dstDraw = (MacDrawable *) dst; display->request++; if (!width || !height) { @@ -306,33 +307,47 @@ XCopyPlane( if (!TkMacOSXSetupDrawingContext(dst, gc, 1, &dc)) { return; } - if (dc.context) { + CGContextRef context = dc.context; + if (context) { CGImageRef img = TkMacOSXCreateCGImageWithDrawable(src); - if (img) { TkpClipMask *clipPtr = (TkpClipMask *) gc->clip_mask; unsigned long imageBackground = gc->background; - - if (clipPtr && clipPtr->type == TKP_CLIP_PIXMAP && - clipPtr->value.pixmap == src) { - imageBackground = TRANSPARENT_PIXEL << 24; + if (clipPtr && clipPtr->type == TKP_CLIP_PIXMAP){ + CGImageRef mask = TkMacOSXCreateCGImageWithDrawable(clipPtr->value.pixmap); + CGRect rect = CGRectMake(dest_x, dest_y, width, height); + rect = CGRectOffset(rect, dstDraw->xOff, dstDraw->yOff); + CGContextSaveGState(context); + /* Move the origin of the destination to top left. */ + CGContextTranslateCTM(context, 0, rect.origin.y + CGRectGetMaxY(rect)); + CGContextScaleCTM(context, 1, -1); + /* Fill with the background color, clipping to the mask. */ + CGContextClipToMask(context, rect, mask); + TkMacOSXSetColorInContext(gc, gc->background, dc.context); + CGContextFillRect(dc.context, rect); + /* Fill with the foreground color, clipping to the intersection of img and mask. */ + CGContextClipToMask(context, rect, img); + TkMacOSXSetColorInContext(gc, gc->foreground, context); + CGContextFillRect(context, rect); + CGContextRestoreGState(context); + CGImageRelease(mask); + CGImageRelease(img); + } else { + DrawCGImage(dst, gc, dc.context, img, gc->foreground, imageBackground, + CGRectMake(0, 0, srcDraw->size.width, srcDraw->size.height), + CGRectMake(src_x, src_y, width, height), + CGRectMake(dest_x, dest_y, width, height)); + CGImageRelease(img); } - DrawCGImage(dst, gc, dc.context, img, gc->foreground, - imageBackground, CGRectMake(0, 0, - srcDraw->size.width, srcDraw->size.height), - CGRectMake(src_x, src_y, width, height), - CGRectMake(dest_x, dest_y, width, height)); - CFRelease(img); - } else { + } else { /* no image */ TkMacOSXDbgMsg("Invalid source drawable"); } } else { - TkMacOSXDbgMsg("Invalid destination drawable"); + TkMacOSXDbgMsg("Invalid destination drawable - could not get a bitmap context."); } TkMacOSXRestoreDrawingContext(&dc); - } else { - XCopyArea(display, src, dst, gc, src_x, src_y, width, height, dest_x, - dest_y); + } else { /* source drawable is a window, not a Pixmap */ + XCopyArea(display, src, dst, gc, src_x, src_y, width, height, dest_x, dest_y); } } @@ -356,16 +371,16 @@ XCopyPlane( int TkPutImage( unsigned long *colors, /* Unused on Macintosh. */ - int ncolors, /* Unused on Macintosh. */ + int ncolors, /* Unused on Macintosh. */ Display* display, /* Display. */ Drawable d, /* Drawable to place image on. */ - GC gc, /* GC to use. */ + GC gc, /* GC to use. */ XImage* image, /* Image to place. */ int src_x, /* Source X & Y. */ int src_y, int dest_x, /* Destination X & Y. */ int dest_y, - unsigned int width, /* Same width & height for both */ + unsigned int width, /* Same width & height for both */ unsigned int height) /* distination and source. */ { TkMacOSXDrawingContext dc; @@ -431,11 +446,12 @@ CreateCGImageWithXImage( * BW image */ + /* Reverses the sense of the bits */ static const CGFloat decodeWB[2] = {1, 0}; + decode = decodeWB; bitsPerComponent = 1; bitsPerPixel = 1; - decode = decodeWB; if (image->bitmap_bit_order != MSBFirst) { char *srcPtr = image->data + image->xoffset; char *endPtr = srcPtr + len; @@ -445,22 +461,20 @@ CreateCGImageWithXImage( *destPtr++ = xBitReverseTable[(unsigned char)(*(srcPtr++))]; } } else { - data = memcpy(ckalloc(len), image->data + image->xoffset, - len); + data = memcpy(ckalloc(len), image->data + image->xoffset, len); } if (data) { provider = CGDataProviderCreateWithData(data, data, len, releaseData); } if (provider) { img = CGImageMaskCreate(image->width, image->height, bitsPerComponent, - bitsPerPixel, image->bytes_per_line, - provider, decode, 0); + bitsPerPixel, image->bytes_per_line, provider, decode, 0); } } else if (image->format == ZPixmap && image->bits_per_pixel == 32) { /* * Color image */ - + CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); bitsPerComponent = 8; @@ -476,6 +490,7 @@ CreateCGImageWithXImage( img = CGImageCreate(image->width, image->height, bitsPerComponent, bitsPerPixel, image->bytes_per_line, colorspace, bitmapInfo, provider, decode, 0, kCGRenderingIntentDefault); + CFRelease(provider); } if (colorspace) { CFRelease(colorspace); @@ -483,10 +498,6 @@ CreateCGImageWithXImage( } else { TkMacOSXDbgMsg("Unsupported image type"); } - if (provider) { - CFRelease(provider); - } - return img; } @@ -660,8 +671,7 @@ GetCGContextForDrawable( kCGBitmapByteOrderDefault; #endif char *data; - CGRect bounds = CGRectMake(0, 0, macDraw->size.width, - macDraw->size.height); + CGRect bounds = CGRectMake(0, 0, macDraw->size.width, macDraw->size.height); if (macDraw->flags & TK_IS_BW_PIXMAP) { bitsPerPixel = 8; @@ -738,6 +748,7 @@ DrawCGImage( if (CGImageIsMask(image)) { /*CGContextSaveGState(context);*/ if (macDraw->flags & TK_IS_BW_PIXMAP) { + /* Set fill color to black, background comes from the context, or is transparent. */ if (imageBackground != TRANSPARENT_PIXEL << 24) { CGContextClearRect(context, dstBounds); } @@ -750,6 +761,7 @@ DrawCGImage( TkMacOSXSetColorInContext(gc, imageForeground, context); } } + #ifdef TK_MAC_DEBUG_IMAGE_DRAWING CGContextSaveGState(context); CGContextSetLineWidth(context, 1.0); diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 10a615e..6481fbd 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -34,6 +34,18 @@ enum { NSWindowWillMoveEventType = 20 }; +/* + * In OS X 10.6 an NSEvent of type NSMouseMoved would always have a non-Nil + * window attribute when the mouse was inside a window. As of 10.8 this + * behavior had changed. The new behavior was that if the mouse were ever + * moved outside of a window, all subsequent NSMouseMoved NSEvents would have a + * Nil window attribute. To work around this we remember which window the + * mouse is in by saving the window attribute of each NSEvent of type + * NSMouseEntered. If an NSEvent has a Nil window attribute we use our saved + * window. It may be the case that the mouse has actually left the window, but + * this is harmless since Tk will ignore the event in that case. + */ + @implementation TKApplication(TKMouseEvent) - (NSEvent *)tkProcessMouseEvent:(NSEvent *)theEvent { #ifdef TK_MAC_DEBUG_EVENTS @@ -48,12 +60,11 @@ enum { switch (type) { case NSMouseEntered: + /* Remember which window has the mouse. */ + _windowWithMouse = [theEvent window]; + break; case NSMouseExited: case NSCursorUpdate: -#if 0 - trackingArea = [theEvent trackingArea]; - /* fall through */ -#endif case NSLeftMouseDown: case NSLeftMouseUp: case NSRightMouseDown: @@ -83,13 +94,36 @@ enum { /* Create an Xevent to add to the Tk queue. */ win = [theEvent window]; NSPoint global, local = [theEvent locationInWindow]; - if (win) { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 + /* convertBaseToScreen and convertScreenToBase were deprecated in 10.7. */ + NSRect pointrect; + pointrect.origin = local; + pointrect.size.width = 0; + pointrect.size.height = 0; +#endif + if (win) { /* local will be in window coordinates. */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 + global = [win convertRectToScreen:pointrect].origin; +#else global = [win convertBaseToScreen:local]; +#endif local.y = [win frame].size.height - local.y; global.y = tkMacOSXZeroScreenHeight - global.y; - } else { - local.y = tkMacOSXZeroScreenHeight - local.y; - global = local; + } else { /* local will be in screen coordinates. */ + if (_windowWithMouse ) { + win = _windowWithMouse; + global = local; +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 + local = [win convertRectFromScreen:pointrect].origin; +#else + local = [win convertScreenToBase:local]; +#endif + local.y = [win frame].size.height - local.y; + global.y = tkMacOSXZeroScreenHeight - global.y; + } else { /* We have no window. Use the screen???*/ + local.y = tkMacOSXZeroScreenHeight - local.y; + global = local; + } } Window window = TkMacOSXGetXWindow(win); diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index b93fa18..ff3577d 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -272,6 +272,7 @@ VISIBILITY_HIDDEN TKMenu *_defaultMainMenu, *_defaultApplicationMenu; NSArray *_defaultApplicationMenuItems, *_defaultWindowsMenuItems; NSArray *_defaultHelpMenuItems; + NSWindow *_windowWithMouse; } @end @interface TKApplication(TKInit) -- cgit v0.12 From a7dfb1b21893c1ab01d02b00e7f9e1b7ebd0198c Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sun, 8 Nov 2015 22:01:01 +0000 Subject: Cleanup of last patch to Tk-Cocoa --- macosx/tkMacOSXDraw.c | 2 +- macosx/tkMacOSXKeyEvent.c | 36 +++++++++-------- macosx/tkMacOSXMouseEvent.c | 94 +++++++++++++++++++++++++++++--------------- macosx/tkMacOSXPrivate.h | 20 +++++++++- macosx/tkMacOSXSubwindows.c | 4 -- macosx/tkMacOSXWindowEvent.c | 15 ------- 6 files changed, 101 insertions(+), 70 deletions(-) diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 185d65a..3e12b36 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -1492,7 +1492,7 @@ TkScrollWindow( { Drawable drawable = Tk_WindowId(tkwin); MacDrawable *macDraw = (MacDrawable *) drawable; - NSView *view = TkMacOSXDrawableView(macDraw); + TKContentView *view = (TKContentView *)TkMacOSXDrawableView(macDraw); CGRect srcRect, dstRect; HIShapeRef dmgRgn = NULL, extraRgn = NULL; NSRect bounds, visRect, scrollSrc, scrollDst; diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index df9dd8a..8521beb 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -227,7 +227,7 @@ static unsigned isFunctionKey(unsigned int code); -@implementation TKContentView(TKKeyEvent) +@implementation TKContentView /* implementation (called through interpretKeyEvents:]). */ /* : called when done composing; @@ -293,22 +293,6 @@ static unsigned isFunctionKey(unsigned int code); } -/* delete display of composing characters [not in ] */ -- (void)deleteWorkingText -{ - if (privateWorkingText == nil) - return; - if (NS_KEYLOG) - NSLog(@"deleteWorkingText len = %lu\n", - (unsigned long)[privateWorkingText length]); - [privateWorkingText release]; - privateWorkingText = nil; - processingCompose = NO; - - //PENDING: delete working text -} - - - (BOOL)hasMarkedText { return privateWorkingText != nil; @@ -418,6 +402,24 @@ static unsigned isFunctionKey(unsigned int code); @end +@implementation TKContentView(TKKeyEvent) +/* delete display of composing characters [not in ] */ +- (void)deleteWorkingText +{ + if (privateWorkingText == nil) + return; + if (NS_KEYLOG) + NSLog(@"deleteWorkingText len = %lu\n", + (unsigned long)[privateWorkingText length]); + [privateWorkingText release]; + privateWorkingText = nil; + processingCompose = NO; + + //PENDING: delete working text +} +@end + + /* * Set up basic fields in xevent for keyboard input. diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 31038b5..4046359 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -28,12 +28,53 @@ static int GenerateButtonEvent(MouseEventData *medPtr); static unsigned int ButtonModifiers2State(UInt32 buttonState, UInt32 keyModifiers); +#pragma mark NSWindow(TKMouseEvent) + +/* Conversion of coordinates between window and screen */ +@interface NSWindow(TKWm) +- (NSPoint) convertPointToScreen:(NSPoint)point; +- (NSPoint) convertPointFromScreen:(NSPoint)point; +@end + +@implementation NSWindow(TKMouseEvent) +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 +- (NSPoint) convertPointToScreen: (NSPoint) point +{ + return [self convertBaseToScreen:point]; +} +- (NSPoint) convertPointFromScreen: (NSPoint)point +{ + return [self convertScreenToBase:point]; +} +@end +#else +- (NSPoint) convertPointToScreen: (NSPoint) point +{ + NSRect pointrect; + pointrect.origin = point; + pointrect.size.width = 0; + pointrect.size.height = 0; + return [self convertRectToScreen:pointrect].origin; +} +- (NSPoint) convertPointFromScreen: (NSPoint)point +{ + NSRect pointrect; + pointrect.origin = point; + pointrect.size.width = 0; + pointrect.size.height = 0; + return [self convertRectFromScreen:pointrect].origin; +} +@end +#endif + +#pragma mark - + + #pragma mark TKApplication(TKMouseEvent) enum { NSWindowWillMoveEventType = 20 }; - /* * In OS X 10.6 an NSEvent of type NSMouseMoved would always have a non-Nil * window attribute when the mouse was inside a window. As of 10.8 this @@ -52,8 +93,8 @@ enum { #ifdef TK_MAC_DEBUG_EVENTS TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent); #endif - id win; - NSEventType type = [theEvent type]; + id win; + NSEventType type = [theEvent type]; #if 0 NSTrackingArea *trackingArea = nil; NSInteger eventNumber, clickCount, buttonNumber; @@ -62,7 +103,13 @@ enum { switch (type) { case NSMouseEntered: /* Remember which window has the mouse. */ + if (_windowWithMouse) { + [_windowWithMouse release]; + } _windowWithMouse = [theEvent window]; + if (_windowWithMouse) { + [_windowWithMouse retain]; + } break; case NSMouseExited: case NSCursorUpdate: @@ -87,31 +134,17 @@ enum { /* Create an Xevent to add to the Tk queue. */ win = [theEvent window]; + NSWindow *nswindow = (NSWindow *)win; NSPoint global, local = [theEvent locationInWindow]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 - /* convertBaseToScreen and convertScreenToBase were deprecated in 10.7. */ - NSRect pointrect; - pointrect.origin = local; - pointrect.size.width = 0; - pointrect.size.height = 0; -#endif if (win) { /* local will be in window coordinates. */ -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 - global = [win convertRectToScreen:pointrect].origin; -#else - global = [win convertBaseToScreen:local]; -#endif + global = [nswindow convertPointToScreen: local]; local.y = [win frame].size.height - local.y; global.y = tkMacOSXZeroScreenHeight - global.y; } else { /* local will be in screen coordinates. */ if (_windowWithMouse ) { win = _windowWithMouse; global = local; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 - local = [win convertRectFromScreen:pointrect].origin; -#else - local = [win convertScreenToBase:local]; -#endif + local = [nswindow convertPointFromScreen: local]; local.y = [win frame].size.height - local.y; global.y = tkMacOSXZeroScreenHeight - global.y; } else { /* We have no window. Use the screen???*/ @@ -569,19 +602,18 @@ TkpWarpPointer( } /* - * Tell the OSX core to generate the events to make it happen. This is - * fairly ugly, but means that under most circumstances we'll register all - * the events that would normally be generated correctly. If we use - * CGWarpMouseCursorPosition instead, strange things happen. + * Tell the OSX core to generate the events to make it happen. */ - buttonState = (GetCurrentEvent() && Tk_MacOSXIsAppInFront()) - ? GetCurrentEventButtonState() : GetCurrentButtonState(); - - CGPostMouseEvent(pt, 1 /* generate motion events */, 5, - buttonState&1 ? 1 : 0, buttonState&2 ? 1 : 0, - buttonState&4 ? 1 : 0, buttonState&8 ? 1 : 0, - buttonState&16 ? 1 : 0); + buttonState = [NSEvent pressedMouseButtons]; + CGEventType type = kCGEventMouseMoved; + CGEventRef theEvent = CGEventCreateMouseEvent(NULL, + type, + pt, + buttonState); + CGWarpMouseCursorPosition(pt); + CGEventPost(kCGHIDEventTap, theEvent); + CFRelease(theEvent); } /* diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 1d20081..9cdc27c 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -301,10 +301,10 @@ VISIBILITY_HIDDEN @interface TKContentView : NSView { @private /*Remove private API calls.*/ - #if 0 +#if 0 id _savedSubviews; BOOL _subviewsSetAside; - #endif +#endif NSString *privateWorkingText; } @end @@ -313,6 +313,18 @@ VISIBILITY_HIDDEN - (void) deleteWorkingText; @end +@interface TKContentView(TKWindowEvent) +- (void) drawRect: (NSRect) rect; +- (void) generateExposeEvents: (HIShapeRef) shape; +- (void) generateExposeEvents: (HIShapeRef) shape childrenOnly: (int) childrenOnly; +- (void) viewDidEndLiveResize; +- (void) tkToolbarButton: (id) sender; +- (BOOL) isOpaque; +- (BOOL) wantsDefaultClipping; +- (BOOL) acceptsFirstResponder; +- (void) keyDown: (NSEvent *) theEvent; +@end + VISIBILITY_HIDDEN @interface TKWindow : NSWindow @end @@ -345,4 +357,8 @@ VISIBILITY_HIDDEN keyEquivalentModifierMask:(NSUInteger)keyEquivalentModifierMask; @end +/* Helper functions from tkMacOSXDeprecations.c */ + +extern NSPoint convertWindowToScreen( NSWindow *window, NSPoint point); + #endif /* _TKMACPRIV */ diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 2a88422..72ef39c 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -805,10 +805,6 @@ TkMacOSXUpdateClipRgn( /* * TODO: Here we should handle out of process embedding. */ - } else if (winPtr->wmInfoPtr->attributes & - kWindowResizableAttribute) { - NSWindow *w = TkMacOSXDrawableWindow(winPtr->window); - } macWin->aboveVisRgn = HIShapeCreateCopy(rgn); diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 15e86ca..7f1cf90 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -780,21 +780,6 @@ Tk_MacOSXIsAppInFront(void) * */ -@interface TKContentView(TKWindowEvent) -- (void) drawRect: (NSRect) rect; -- (void) generateExposeEvents: (HIShapeRef) shape; -- (void) generateExposeEvents: (HIShapeRef) shape childrenOnly: (int) childrenOnly; -- (void) viewDidEndLiveResize; -- (void) tkToolbarButton: (id) sender; -- (BOOL) isOpaque; -- (BOOL) wantsDefaultClipping; -- (BOOL) acceptsFirstResponder; -- (void) keyDown: (NSEvent *) theEvent; -@end - -@implementation TKContentView -@end - /*Restrict event processing to Expose events.*/ static Tk_RestrictAction ExposeRestrictProc( -- cgit v0.12 From 65696b5bb7348609c6187600bf18b0d38ffdd219 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sun, 8 Nov 2015 22:02:34 +0000 Subject: Cleanup of last patch to Tk-Cocoa --- macosx/tkMacOSXDraw.c | 2 +- macosx/tkMacOSXKeyEvent.c | 36 +++++++++++----------- macosx/tkMacOSXMouseEvent.c | 73 ++++++++++++++++++++++++++++++++------------ macosx/tkMacOSXPrivate.h | 20 ++++++++++-- macosx/tkMacOSXSubwindows.c | 3 -- macosx/tkMacOSXWindowEvent.c | 15 --------- macosx/tkMacOSXWm.c | 34 ++++++++++----------- macosx/tkMacOSXXStubs.c | 21 +++++++------ 8 files changed, 119 insertions(+), 85 deletions(-) diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 7ec7b90..33c2ef9 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -1491,7 +1491,7 @@ TkScrollWindow( { Drawable drawable = Tk_WindowId(tkwin); MacDrawable *macDraw = (MacDrawable *) drawable; - NSView *view = TkMacOSXDrawableView(macDraw); + TKContentView *view = (TKContentView *)TkMacOSXDrawableView(macDraw); CGRect srcRect, dstRect; HIShapeRef dmgRgn = NULL, extraRgn = NULL; NSRect bounds, visRect, scrollSrc, scrollDst; diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 8e278f7..d21389b 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -227,7 +227,7 @@ static unsigned isFunctionKey(unsigned int code); -@implementation TKContentView(TKKeyEvent) +@implementation TKContentView /* implementation (called through interpretKeyEvents:]). */ /* : called when done composing; @@ -293,22 +293,6 @@ static unsigned isFunctionKey(unsigned int code); } -/* delete display of composing characters [not in ] */ -- (void)deleteWorkingText -{ - if (privateWorkingText == nil) - return; - if (NS_KEYLOG) - NSLog(@"deleteWorkingText len = %lu\n", - (unsigned long)[privateWorkingText length]); - [privateWorkingText release]; - privateWorkingText = nil; - processingCompose = NO; - - //PENDING: delete working text -} - - - (BOOL)hasMarkedText { return privateWorkingText != nil; @@ -418,6 +402,24 @@ static unsigned isFunctionKey(unsigned int code); @end +@implementation TKContentView(TKKeyEvent) +/* delete display of composing characters [not in ] */ +- (void)deleteWorkingText +{ + if (privateWorkingText == nil) + return; + if (NS_KEYLOG) + NSLog(@"deleteWorkingText len = %lu\n", + (unsigned long)[privateWorkingText length]); + [privateWorkingText release]; + privateWorkingText = nil; + processingCompose = NO; + + //PENDING: delete working text +} +@end + + /* * Set up basic fields in xevent for keyboard input. diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 6481fbd..2b9d0bf 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -28,12 +28,53 @@ static int GenerateButtonEvent(MouseEventData *medPtr); static unsigned int ButtonModifiers2State(UInt32 buttonState, UInt32 keyModifiers); +#pragma mark NSWindow(TKMouseEvent) + +/* Conversion of coordinates between window and screen */ +@interface NSWindow(TKWm) +- (NSPoint) convertPointToScreen:(NSPoint)point; +- (NSPoint) convertPointFromScreen:(NSPoint)point; +@end + +@implementation NSWindow(TKMouseEvent) +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 +- (NSPoint) convertPointToScreen: (NSPoint) point +{ + return [self convertBaseToScreen:point]; +} +- (NSPoint) convertPointFromScreen: (NSPoint)point +{ + return [self convertScreenToBase:point]; +} +@end +#else +- (NSPoint) convertPointToScreen: (NSPoint)point +{ + NSRect pointrect; + pointrect.origin = point; + pointrect.size.width = 0; + pointrect.size.height = 0; + return [self convertRectToScreen:pointrect].origin; +} +- (NSPoint) convertPointFromScreen: (NSPoint)point +{ + NSRect pointrect; + pointrect.origin = point; + pointrect.size.width = 0; + pointrect.size.height = 0; + return [self convertRectFromScreen:pointrect].origin; +} +@end +#endif + +#pragma mark - + + #pragma mark TKApplication(TKMouseEvent) enum { NSWindowWillMoveEventType = 20 }; - /* * In OS X 10.6 an NSEvent of type NSMouseMoved would always have a non-Nil * window attribute when the mouse was inside a window. As of 10.8 this @@ -51,8 +92,8 @@ enum { #ifdef TK_MAC_DEBUG_EVENTS TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent); #endif - id win; - NSEventType type = [theEvent type]; + id win; + NSEventType type = [theEvent type]; #if 0 NSTrackingArea *trackingArea = nil; NSInteger eventNumber, clickCount, buttonNumber; @@ -61,7 +102,13 @@ enum { switch (type) { case NSMouseEntered: /* Remember which window has the mouse. */ + if (_windowWithMouse) { + [_windowWithMouse release]; + } _windowWithMouse = [theEvent window]; + if (_windowWithMouse) { + [_windowWithMouse retain]; + } break; case NSMouseExited: case NSCursorUpdate: @@ -93,31 +140,17 @@ enum { /* Create an Xevent to add to the Tk queue. */ win = [theEvent window]; + NSWindow *nswindow = (NSWindow *)win; NSPoint global, local = [theEvent locationInWindow]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 - /* convertBaseToScreen and convertScreenToBase were deprecated in 10.7. */ - NSRect pointrect; - pointrect.origin = local; - pointrect.size.width = 0; - pointrect.size.height = 0; -#endif if (win) { /* local will be in window coordinates. */ -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 - global = [win convertRectToScreen:pointrect].origin; -#else - global = [win convertBaseToScreen:local]; -#endif + global = [nswindow convertPointToScreen: local]; local.y = [win frame].size.height - local.y; global.y = tkMacOSXZeroScreenHeight - global.y; } else { /* local will be in screen coordinates. */ if (_windowWithMouse ) { win = _windowWithMouse; global = local; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 - local = [win convertRectFromScreen:pointrect].origin; -#else - local = [win convertScreenToBase:local]; -#endif + local = [nswindow convertPointFromScreen: local]; local.y = [win frame].size.height - local.y; global.y = tkMacOSXZeroScreenHeight - global.y; } else { /* We have no window. Use the screen???*/ diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index ff3577d..4f96f64 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -299,10 +299,10 @@ VISIBILITY_HIDDEN @interface TKContentView : NSView { @private /*Remove private API calls.*/ - #if 0 +#if 0 id _savedSubviews; BOOL _subviewsSetAside; - #endif +#endif NSString *privateWorkingText; } @end @@ -311,6 +311,18 @@ VISIBILITY_HIDDEN - (void) deleteWorkingText; @end +@interface TKContentView(TKWindowEvent) +- (void) drawRect: (NSRect) rect; +- (void) generateExposeEvents: (HIShapeRef) shape; +- (void) generateExposeEvents: (HIShapeRef) shape childrenOnly: (int) childrenOnly; +- (void) viewDidEndLiveResize; +- (void) tkToolbarButton: (id) sender; +- (BOOL) isOpaque; +- (BOOL) wantsDefaultClipping; +- (BOOL) acceptsFirstResponder; +- (void) keyDown: (NSEvent *) theEvent; +@end + VISIBILITY_HIDDEN @interface TKWindow : NSWindow @end @@ -344,4 +356,8 @@ VISIBILITY_HIDDEN @end +/* Helper functions from tkMacOSXDeprecations.c */ + +extern NSPoint convertWindowToScreen( NSWindow *window, NSPoint point); + #endif /* _TKMACPRIV */ diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 2f500fa..a601c50 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -805,9 +805,6 @@ TkMacOSXUpdateClipRgn( /* * TODO: Here we should handle out of process embedding. */ - } else if (winPtr->wmInfoPtr->attributes & - kWindowResizableAttribute) { - NSWindow *w = TkMacOSXDrawableWindow(winPtr->window); } macWin->aboveVisRgn = HIShapeCreateCopy(rgn); diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index ef3c86b..c028a75 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -782,21 +782,6 @@ Tk_MacOSXIsAppInFront(void) * */ -@interface TKContentView(TKWindowEvent) -- (void) drawRect: (NSRect) rect; -- (void) generateExposeEvents: (HIShapeRef) shape; -- (void) generateExposeEvents: (HIShapeRef) shape childrenOnly: (int) childrenOnly; -- (void) viewDidEndLiveResize; -- (void) tkToolbarButton: (id) sender; -- (BOOL) isOpaque; -- (BOOL) wantsDefaultClipping; -- (BOOL) acceptsFirstResponder; -- (void) keyDown: (NSEvent *) theEvent; -@end - -@implementation TKContentView -@end - /*Restrict event processing to Expose events.*/ static Tk_RestrictAction ExposeRestrictProc( diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 37a1d25..241d70a 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -817,7 +817,7 @@ TkWmDeadWindow( } [pool drain]; } - ckfree(wmPtr); + ckfree((char *)wmPtr); winPtr->wmInfoPtr = NULL; } @@ -5194,22 +5194,22 @@ WmWinStyle( { "moveToActiveSpace", tkMoveToActiveSpaceAttribute }, { "nonActivating", tkNonactivatingPanelAttribute }, { "hud", tkHUDWindowAttribute }, - { "black", NULL }, - { "dark", NULL }, - { "light", NULL }, - { "gray", NULL }, - { "red", NULL }, - { "green", NULL }, - { "blue", NULL }, - { "cyan", NULL }, - { "yellow", NULL }, - { "magenta", NULL }, - { "orange", NULL }, - { "purple", NULL }, - { "brown", NULL }, - { "clear", NULL }, - { "opacity", NULL }, - { "fullscreen", NULL }, + { "black", 0 }, + { "dark", 0 }, + { "light", 0 }, + { "gray", 0 }, + { "red", 0 }, + { "green", 0 }, + { "blue", 0 }, + { "cyan", 0 }, + { "yellow", 0 }, + { "magenta", 0 }, + { "orange", 0 }, + { "purple", 0 }, + { "brown", 0 }, + { "clear", 0 }, + { "opacity", 0 }, + { "fullscreen", 0 }, { NULL } }; diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index 59c6a56..2b9783d 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -911,9 +911,9 @@ XGetImage( bitmap_rep = BitmapRepFromDrawableRect(d, x, y,width, height); bitmap_fmt = [bitmap_rep bitmapFormat]; - if ( bitmap_rep == Nil || - (bitmap_fmt != 0 && bitmap_fmt != 1) || - [bitmap_rep samplesPerPixel] != 4 || + if ( bitmap_rep == Nil || + (bitmap_fmt != 0 && bitmap_fmt != 1) || + [bitmap_rep samplesPerPixel] != 4 || [bitmap_rep isPlanar] != 0 ) { TkMacOSXDbgMsg("XGetImage: Failed to construct NSBitmapRep"); return NULL; @@ -922,8 +922,8 @@ XGetImage( NSSize image_size = NSMakeSize(width, height); NSImage* ns_image = [[NSImage alloc]initWithSize:image_size]; [ns_image addRepresentation:bitmap_rep]; - -/* Assume premultiplied nonplanar data with 4 bytes per pixel.*/ + + /* Assume premultiplied nonplanar data with 4 bytes per pixel.*/ if ( [bitmap_rep isPlanar ] == 0 && [bitmap_rep samplesPerPixel] == 4 ) { bytes_per_row = [bitmap_rep bytesPerRow]; @@ -934,9 +934,9 @@ XGetImage( bitmap = ckalloc(size); /* Oddly enough, the bitmap has the top row at the beginning, - and the pixels are in BGRA or ABGR format. + and the pixels are in BGRA or ABGR format. */ - if (bitmap_fmt == 0) { + if (bitmap_fmt == 0) { /* BGRA */ for (row=0, n=0; row Date: Mon, 9 Nov 2015 11:11:42 +0000 Subject: clean-up end-of-line spacing --- macosx/tkMacOSXDraw.c | 6 +++--- macosx/tkMacOSXMouseEvent.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 33c2ef9..672e266 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -446,7 +446,7 @@ CreateCGImageWithXImage( * BW image */ - /* Reverses the sense of the bits */ + /* Reverses the sense of the bits */ static const CGFloat decodeWB[2] = {1, 0}; decode = decodeWB; @@ -474,7 +474,7 @@ CreateCGImageWithXImage( /* * Color image */ - + CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); bitsPerComponent = 8; @@ -761,7 +761,7 @@ DrawCGImage( TkMacOSXSetColorInContext(gc, imageForeground, context); } } - + #ifdef TK_MAC_DEBUG_IMAGE_DRAWING CGContextSaveGState(context); CGContextSetLineWidth(context, 1.0); diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 2b9d0bf..f4bfb44 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -75,7 +75,7 @@ static unsigned int ButtonModifiers2State(UInt32 buttonState, enum { NSWindowWillMoveEventType = 20 }; -/* +/* * In OS X 10.6 an NSEvent of type NSMouseMoved would always have a non-Nil * window attribute when the mouse was inside a window. As of 10.8 this * behavior had changed. The new behavior was that if the mouse were ever -- cgit v0.12 From 86d9383e5ac170ca8a034085bb778f6fd96b7755 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 9 Nov 2015 15:43:08 +0000 Subject: Fix [5ee8af61e5ef8e233158a43459624f4ecf58a6fe|5ee8af61e5] on Unix: Window embedding can not work on 64-bit Unix and Windows --- unix/tkUnixEmbed.c | 5 ++--- unix/tkUnixXId.c | 20 +++++++++++++++----- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/unix/tkUnixEmbed.c b/unix/tkUnixEmbed.c index 5b5f486..119bc67 100644 --- a/unix/tkUnixEmbed.c +++ b/unix/tkUnixEmbed.c @@ -100,7 +100,7 @@ TkpUseWindow( { TkWindow *winPtr = (TkWindow *) tkwin; TkWindow *usePtr; - int id, anyError; + int anyError; Window parent; Tk_ErrorHandler handler; Container *containerPtr; @@ -113,10 +113,9 @@ TkpUseWindow( "can't modify container after widget is created", NULL); return TCL_ERROR; } - if (Tcl_GetInt(interp, string, &id) != TCL_OK) { + if (TkpScanWindowId(interp, string, &parent) != TCL_OK) { return TCL_ERROR; } - parent = (Window) id; usePtr = (TkWindow *) Tk_IdToWindow(winPtr->display, parent); if (usePtr != NULL) { diff --git a/unix/tkUnixXId.c b/unix/tkUnixXId.c index ca2eb33..444be30 100644 --- a/unix/tkUnixXId.c +++ b/unix/tkUnixXId.c @@ -586,13 +586,23 @@ TkpScanWindowId( CONST char *string, Window *idPtr) { - int value; + int code; + Tcl_Obj obj; - if (Tcl_GetInt(interp, string, &value) != TCL_OK) { - return TCL_ERROR; + obj.refCount = 1; + obj.bytes = (char *) string; /* DANGER?! */ + obj.length = strlen(string); + obj.typePtr = NULL; + + code = Tcl_GetLongFromObj(interp, &obj, (long *)idPtr); + + if (obj.refCount > 1) { + Tcl_Panic("invalid sharing of Tcl_Obj on C stack"); + } + if (obj.typePtr && obj.typePtr->freeIntRepProc) { + obj.typePtr->freeIntRepProc(&obj); } - *idPtr = (Window) value; - return TCL_OK; + return code; } /* -- cgit v0.12 From 2a9fdd77c974171312d269dead962e6dcfc0ab21 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 10 Nov 2015 13:54:09 +0000 Subject: Fix [5ee8af61e5ef8e233158a43459624f4ecf58a6fe|5ee8af61e5] on Win64: Window embedding can not work on 64-bit Unix and Windows --- win/tkWinEmbed.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c index b7f5085..a0670cc 100644 --- a/win/tkWinEmbed.c +++ b/win/tkWinEmbed.c @@ -256,10 +256,13 @@ TkpUseWindow( return TCL_OK; } - if (Tcl_GetInt(interp, string, &id) != TCL_OK) { + if ( +#ifdef _WIN64 + (sscanf(string, "0x%p", &hwnd) != 1) && +#endif + Tcl_GetInt(interp, string, (int *) &hwnd) != TCL_OK) { return TCL_ERROR; } - hwnd = (HWND) INT2PTR(id); if ((HWND)winPtr->privatePtr == hwnd) { return TCL_OK; } -- cgit v0.12 From b4ab9d79f99aab6cfb1014e82271308f4d6184c9 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 10 Nov 2015 18:38:56 +0000 Subject: Typos in comments --- generic/tkTextBTree.c | 2 +- generic/tkTextDisp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c index 36f0ef3..58fc645 100644 --- a/generic/tkTextBTree.c +++ b/generic/tkTextBTree.c @@ -1117,7 +1117,7 @@ TkBTreeInsertChars( /* * I don't believe it's possible for either of the two lines passed to * this function to be the last line of text, but the function is robust - * to that case anyway. (We must never re-calculated the line height of + * to that case anyway. (We must never re-calculate the line height of * the last line). */ diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index fc7b46b..6036222 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2225,7 +2225,7 @@ UpdateDisplayInfo( * Here's a problem: see the tests textDisp-29.2.1-4 * * If the widget is being created, but has not yet been configured it will - * have a maxY of 1 above, and we we won't have examined all the lines + * have a maxY of 1 above, and we won't have examined all the lines * (just the first line, in fact), and so maxOffset will not be a true * reflection of the widget's lines. Therefore we must not overwrite the * original newXPixelOffset in this case. -- cgit v0.12 From b965bde49f462725f54d29e9e8b8008f79fe43b9 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 10 Nov 2015 21:03:04 +0000 Subject: Implementation of TIP #438 - Solution using virtual events --- generic/tkTextDisp.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 6036222..a275b28 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -590,6 +590,8 @@ static int TextGetScrollInfoObj(Tcl_Interp *interp, Tcl_Obj *CONST objv[], double *dblPtr, int *intPtr); static void AsyncUpdateLineMetrics(ClientData clientData); +static void GenerateMetricsEvent(TkText *textPtr, + CONST char *eventname); static void AsyncUpdateYScrollbar(ClientData clientData); static int IsStartOfNotMergedLine(TkText *textPtr, CONST TkTextIndex *indexPtr); @@ -2944,6 +2946,7 @@ AsyncUpdateLineMetrics( if (textPtr->refCount == 0) { ckfree((char *) textPtr); } + GenerateMetricsEvent(textPtr, "MetricsDone"); return; } dInfoPtr->currentMetricUpdateLine = lineNum; @@ -2960,6 +2963,51 @@ AsyncUpdateLineMetrics( /* *---------------------------------------------------------------------- * + * GenerateMetricsEvent -- + * + * Send an event related to the text widget metrics asynchronous update + * Two events are used: + * - <>: the asynchronous update of line metrics is + * currently running + * - <> : the asynchronous update of line metrics is + * over + * This is equivalent to: + * event generate $textWidget <> + * or + * event generate $textWidget <> + * + * Results: + * None + * + * Side effects: + * May force the text window into existence. + * If corresponding bindings are present, they will trigger. + * + *---------------------------------------------------------------------- + */ + +static void +GenerateMetricsEvent( + TkText *textPtr, /* Information about text widget. */ + CONST char *eventname) /* Name of the virtual event to send. */ +{ + union {XEvent general; XVirtualEvent virtual;} event; + + Tk_MakeWindowExist(textPtr->tkwin); + + memset(&event, 0, sizeof(event)); + event.general.xany.type = VirtualEvent; + event.general.xany.serial = NextRequest(Tk_Display(textPtr->tkwin)); + event.general.xany.send_event = False; + event.general.xany.window = Tk_WindowId(textPtr->tkwin); + event.general.xany.display = Tk_Display(textPtr->tkwin); + event.virtual.name = Tk_GetUid(eventname); + Tk_HandleEvent(&event.general); +} + +/* + *---------------------------------------------------------------------- + * * TkTextUpdateLineMetrics -- * * This function updates the pixel height calculations of a range of @@ -3336,6 +3384,7 @@ TextInvalidateLineMetrics( textPtr->refCount++; dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(1, AsyncUpdateLineMetrics, (ClientData) textPtr); + GenerateMetricsEvent(textPtr, "MetricsOutdated"); } } @@ -5040,6 +5089,7 @@ TkTextRelayoutWindow( textPtr->refCount++; dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(1, AsyncUpdateLineMetrics, (ClientData) textPtr); + GenerateMetricsEvent(textPtr, "MetricsOutdated"); } } } -- cgit v0.12 From b9c5c010586da8c59bec01cd2e2d21835ef7916b Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 12 Nov 2015 21:59:18 +0000 Subject: Koen Danckaert's patch to speed up line metrics update --- generic/tkText.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index cb89218..ac56c85 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -572,8 +572,6 @@ CreateWidget( * start,end do not require a total recalculation. */ - TkBTreeAddClient(sharedPtr->tree, textPtr, textPtr->charHeight); - textPtr->state = TK_TEXT_STATE_NORMAL; textPtr->relief = TK_RELIEF_FLAT; textPtr->cursor = None; @@ -583,6 +581,8 @@ CreateWidget( textPtr->prevWidth = Tk_Width(newWin); textPtr->prevHeight = Tk_Height(newWin); + TkBTreeAddClient(sharedPtr->tree, textPtr, textPtr->charHeight); + /* * This will add refCounts to textPtr. */ @@ -2319,6 +2319,7 @@ TextWorldChanged( { Tk_FontMetrics fm; int border; + int oldCharHeight = textPtr->charHeight; textPtr->charWidth = Tk_TextWidth(textPtr->tkfont, "0", 1); if (textPtr->charWidth <= 0) { @@ -2330,6 +2331,9 @@ TextWorldChanged( if (textPtr->charHeight <= 0) { textPtr->charHeight = 1; } + if (textPtr->charHeight != oldCharHeight) { + TkBTreeClientRangeChanged(textPtr, textPtr->charHeight); + } border = textPtr->borderWidth + textPtr->highlightWidth; Tk_GeometryRequest(textPtr->tkwin, textPtr->width * textPtr->charWidth + 2*textPtr->padX + 2*border, -- cgit v0.12 From de27a7c6e4d71115b1757e59735cbece10a62ae5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 12 Nov 2015 22:50:12 +0000 Subject: Moved comment to follow the moved code in previous commit --- generic/tkText.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index ac56c85..6e982b0 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -566,12 +566,6 @@ CreateWidget( textPtr->end = NULL; } - /* - * Register with the B-tree. In some sense it would be best if we could do - * this later (after configuration options), so that any changes to - * start,end do not require a total recalculation. - */ - textPtr->state = TK_TEXT_STATE_NORMAL; textPtr->relief = TK_RELIEF_FLAT; textPtr->cursor = None; @@ -581,6 +575,12 @@ CreateWidget( textPtr->prevWidth = Tk_Width(newWin); textPtr->prevHeight = Tk_Height(newWin); + /* + * Register with the B-tree. In some sense it would be best if we could do + * this later (after configuration options), so that any changes to + * start,end do not require a total recalculation. + */ + TkBTreeAddClient(sharedPtr->tree, textPtr, textPtr->charHeight); /* -- cgit v0.12 From 7e0de4a6b4f19d000e66c01ef7a01ca72a3960da Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Nov 2015 08:44:35 +0000 Subject: Fix [https://www.sqlite.org/src/info/34eb6911afee09e7|34eb6911af], taken over from SQLite: Fix uses of ctype functions (ex: isspace()) on signed characters in test programs and in some obscure extensions. No changes to the core. --- win/nmakehlp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/win/nmakehlp.c b/win/nmakehlp.c index b1a1517..84cf75c 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -606,8 +606,8 @@ SubstituteFile( sp = fopen(substitutions, "rt"); if (sp != NULL) { while (fgets(szBuffer, cbBuffer, sp) != NULL) { - char *ks, *ke, *vs, *ve; - ks = szBuffer; + unsigned char *ks, *ke, *vs, *ve; + ks = (unsigned char*)szBuffer; while (ks && *ks && isspace(*ks)) ++ks; ke = ks; while (ke && *ke && !isspace(*ke)) ++ke; @@ -616,7 +616,7 @@ SubstituteFile( ve = vs; while (ve && *ve && !(*ve == '\r' || *ve == '\n')) ++ve; *ke = 0, *ve = 0; - list_insert(&substPtr, ks, vs); + list_insert(&substPtr, (char*)ks, (char*)vs); } fclose(sp); } -- cgit v0.12 From f6a8214c69fd081220a6401284532d1d373749be Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Nov 2015 14:54:12 +0000 Subject: Fix test-cases textDisp-33.2 and textDisp-33.3 --- tests/textDisp.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/textDisp.test b/tests/textDisp.test index a6bbfd7..9c6af70 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -4104,7 +4104,7 @@ test textDisp-33.2 {one line longer than fits in the widget} { .tt debug 1 set tk_textHeightCalc "" .tt insert 1.0 [string repeat "more wrap + " 1] - after 100 ; update + after 100 ; update idletasks # Nothing should have been recalculated. set tk_textHeightCalc } {} @@ -4184,7 +4184,7 @@ test textDisp-34.1 {Text widgets multi-scrolling problem: Bug 2677890} -setup { return $result } -cleanup { destroy .t1 .sy -} -result {{0.0 1.0} {0.0 1.0} {0.0 1.0} {0.0 0.24}} +} -result {{0.0 0.24} {0.0 0.24} {0.0 0.24} {0.0 0.24}} deleteWindows option clear -- cgit v0.12 From c3b96f601ce76e221a2dbd8fe8d747834c4a48ec Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 14 Nov 2015 00:02:49 +0000 Subject: TIP #438 - [.text yupdate] command added, with corresponding new tests --- generic/tkText.c | 14 ++++++++++++-- tests/text.test | 45 ++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 52 insertions(+), 7 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index cb89218..4d2df7e 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -690,14 +690,14 @@ TextWidgetObjCmd( "bbox", "cget", "compare", "configure", "count", "debug", "delete", "dlineinfo", "dump", "edit", "get", "image", "index", "insert", "mark", "peer", "replace", "scan", "search", "see", "tag", "window", - "xview", "yview", NULL + "xview", "yupdate", "yview", NULL }; enum options { TEXT_BBOX, TEXT_CGET, TEXT_COMPARE, TEXT_CONFIGURE, TEXT_COUNT, TEXT_DEBUG, TEXT_DELETE, TEXT_DLINEINFO, TEXT_DUMP, TEXT_EDIT, TEXT_GET, TEXT_IMAGE, TEXT_INDEX, TEXT_INSERT, TEXT_MARK, TEXT_PEER, TEXT_REPLACE, TEXT_SCAN, TEXT_SEARCH, TEXT_SEE, - TEXT_TAG, TEXT_WINDOW, TEXT_XVIEW, TEXT_YVIEW + TEXT_TAG, TEXT_WINDOW, TEXT_XVIEW, TEXT_YUPDATE, TEXT_YVIEW }; if (objc < 2) { @@ -1494,6 +1494,16 @@ TextWidgetObjCmd( case TEXT_XVIEW: result = TkTextXviewCmd(textPtr, interp, objc, objv); break; + case TEXT_YUPDATE: { + if (objc != 2) { + Tcl_WrongNumArgs(interp, 2, objv, NULL); + result = TCL_ERROR; + goto done; + } + TkTextUpdateLineMetrics(textPtr, 1, + TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr), -1); + break; + } case TEXT_YVIEW: result = TkTextYviewCmd(textPtr, interp, objc, objv); break; diff --git a/tests/text.test b/tests/text.test index 7c1731d..f08431d 100644 --- a/tests/text.test +++ b/tests/text.test @@ -153,7 +153,7 @@ test text-3.1 {TextWidgetCmd procedure, basics} { } {1 {wrong # args: should be ".t option ?arg arg ...?"}} test text-3.2 {TextWidgetCmd procedure} { list [catch {.t gorp 1.0 z 1.2} msg] $msg -} {1 {bad option "gorp": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, or yview}} +} {1 {bad option "gorp": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, yupdate, or yview}} test text-4.1 {TextWidgetCmd procedure, "bbox" option} { list [catch {.t bbox} msg] $msg @@ -221,7 +221,7 @@ test text-6.13 {TextWidgetCmd procedure, "compare" option} { } {1 {bad comparison operator "z": must be <, <=, ==, >=, >, or !=}} test text-6.14 {TextWidgetCmd procedure, "compare" option} { list [catch {.t co 1.0 z 1.2} msg] $msg -} {1 {ambiguous option "co": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, or yview}} +} {1 {ambiguous option "co": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, yupdate, or yview}} # "configure" option is already covered above @@ -230,7 +230,7 @@ test text-7.1 {TextWidgetCmd procedure, "debug" option} { } {1 {wrong # args: should be ".t debug boolean"}} test text-7.2 {TextWidgetCmd procedure, "debug" option} { list [catch {.t de 0 1} msg] $msg -} {1 {ambiguous option "de": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, or yview}} +} {1 {ambiguous option "de": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, yupdate, or yview}} test text-7.3 {TextWidgetCmd procedure, "debug" option} { .t debug true .t deb @@ -901,7 +901,7 @@ test text-10.2 {TextWidgetCmd procedure, "index" option} { } {1 {wrong # args: should be ".t index index"}} test text-10.3 {TextWidgetCmd procedure, "index" option} { list [catch {.t in a b} msg] $msg -} {1 {ambiguous option "in": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, or yview}} +} {1 {ambiguous option "in": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, yupdate, or yview}} test text-10.4 {TextWidgetCmd procedure, "index" option} { list [catch {.t index @xyz} msg] $msg } {1 {bad text index "@xyz"}} @@ -960,7 +960,42 @@ test text-11.10 {TextWidgetCmd procedure, "insert" option} { list [.t get 1.0 1.end] [.t tag ranges bold] [.t tag ranges silly] } {{First second} {1.0 1.5} {1.5 1.12}} -# Edit, mark, scan, search, see, tag, window, xview, and yview actions are tested elsewhere. +test text-11a.1 {TextWidgetCmd procedure, "yupdate" option} { + destroy .yt + text .yt + list [catch {.yt yupdate mytext} msg] $msg +} {1 {wrong # args: should be ".yt yupdate"}} +test text-11a.2 {TextWidgetCmd procedure, "yupdate" option} { + destroy .top.yt .top + toplevel .top + pack [text .top.yt] + set content {} + for {set i 1} {$i < 30} {incr i} { + append content [string repeat "$i " 15] \n + } + .top.yt insert 1.0 $content + # wait for end of line metrics calculation to get correct $fraction1 + # as a reference + .top.yt yupdate + .top.yt yview moveto 1 + set fraction1 [lindex [.top.yt yview] 0] + set res [expr {$fraction1 > 0}] + # first case: do not wait for completion of line metrics calculation + .top.yt delete 1.0 end + .top.yt insert 1.0 $content + .top.yt yview moveto $fraction1 + set fraction2 [lindex [.top.yt yview] 0] + lappend res [expr {$fraction1 == $fraction2}] + # second case: wait for completion of line metrics calculation + .top.yt delete 1.0 end + .top.yt insert 1.0 $content + .top.yt yupdate + .top.yt yview moveto $fraction1 + set fraction2 [lindex [.top.yt yview] 0] + lappend res [expr {$fraction1 == $fraction2}] +} {1 0 1} + +# edit, mark, scan, search, see, tag, window, xview and yview actions are tested elsewhere. test text-12.1 {ConfigureText procedure} { list [catch {.t2 configure -state foobar} msg] $msg -- cgit v0.12 From 4fe451bdce628ec817ecdebadbcd7f46dc967b41 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 14 Nov 2015 09:11:48 +0000 Subject: TIP #438 - [.text pendingyupdate] command added, with corresponding new tests --- generic/tkText.c | 21 +++++++++++++++++---- generic/tkText.h | 1 + generic/tkTextDisp.c | 30 +++++++++++++++++++++++++++++- tests/text.test | 41 ++++++++++++++++++++++++++++++++++++----- 4 files changed, 83 insertions(+), 10 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 4d2df7e..36bb4d4 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -689,15 +689,16 @@ TextWidgetObjCmd( static const char *optionStrings[] = { "bbox", "cget", "compare", "configure", "count", "debug", "delete", "dlineinfo", "dump", "edit", "get", "image", "index", "insert", - "mark", "peer", "replace", "scan", "search", "see", "tag", "window", - "xview", "yupdate", "yview", NULL + "mark", "peer", "pendingyupdate", "replace", "scan", "search", + "see", "tag", "window", "xview", "yupdate", "yview", NULL }; enum options { TEXT_BBOX, TEXT_CGET, TEXT_COMPARE, TEXT_CONFIGURE, TEXT_COUNT, TEXT_DEBUG, TEXT_DELETE, TEXT_DLINEINFO, TEXT_DUMP, TEXT_EDIT, TEXT_GET, TEXT_IMAGE, TEXT_INDEX, TEXT_INSERT, TEXT_MARK, - TEXT_PEER, TEXT_REPLACE, TEXT_SCAN, TEXT_SEARCH, TEXT_SEE, - TEXT_TAG, TEXT_WINDOW, TEXT_XVIEW, TEXT_YUPDATE, TEXT_YVIEW + TEXT_PEER, TEXT_PENDINGYUPDATE, TEXT_REPLACE, TEXT_SCAN, + TEXT_SEARCH, TEXT_SEE, TEXT_TAG, TEXT_WINDOW, TEXT_XVIEW, + TEXT_YUPDATE, TEXT_YVIEW }; if (objc < 2) { @@ -1372,6 +1373,18 @@ TextWidgetObjCmd( case TEXT_PEER: result = TextPeerCmd(textPtr, interp, objc, objv); break; + case TEXT_PENDINGYUPDATE: { + int number; + + if (objc != 2) { + Tcl_WrongNumArgs(interp, 2, objv, NULL); + result = TCL_ERROR; + goto done; + } + number = TkTextPendingyupdate(textPtr); + Tcl_SetObjResult(interp, Tcl_NewIntObj(number)); + break; + } case TEXT_REPLACE: { const TkTextIndex *indexFromPtr, *indexToPtr; diff --git a/generic/tkText.h b/generic/tkText.h index 6f5f153..2d1bcaa 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -1124,6 +1124,7 @@ MODULE_SCOPE int TkTextMarkNameToIndex(TkText *textPtr, MODULE_SCOPE void TkTextMarkSegToIndex(TkText *textPtr, TkTextSegment *markPtr, TkTextIndex *indexPtr); MODULE_SCOPE void TkTextEventuallyRepick(TkText *textPtr); +MODULE_SCOPE int TkTextPendingyupdate(TkText *textPtr); MODULE_SCOPE void TkTextPickCurrent(TkText *textPtr, XEvent *eventPtr); MODULE_SCOPE void TkTextPixelIndex(TkText *textPtr, int x, int y, TkTextIndex *indexPtr, int *nearest); diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 6036222..d740181 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2920,6 +2920,8 @@ AsyncUpdateLineMetrics( lineNum = TkTextUpdateLineMetrics(textPtr, lineNum, dInfoPtr->lastMetricUpdateLine, 256); + dInfoPtr->currentMetricUpdateLine = lineNum; + if (tkTextDebug) { char buffer[2 * TCL_INTEGER_SPACE + 1]; @@ -2946,7 +2948,6 @@ AsyncUpdateLineMetrics( } return; } - dInfoPtr->currentMetricUpdateLine = lineNum; /* * Re-arm the timer. We already have a refCount on the text widget so no @@ -6034,6 +6035,33 @@ TkTextYviewCmd( /* *-------------------------------------------------------------- * + * TkTextPendingyupdate -- + * + * This function computes how many lines are not up-to-date regarding + * asynchronous height calculations. + * + * Results: + * Returns a positive integer corresponding to the number of lines for + * which the height is outdated. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +int +TkTextPendingyupdate( + TkText *textPtr) /* Information about text widget. */ +{ + TextDInfo *dInfoPtr = textPtr->dInfoPtr; + + return (dInfoPtr->lastMetricUpdateLine - dInfoPtr->currentMetricUpdateLine); +} + +/* + *-------------------------------------------------------------- + * * TkTextScanCmd -- * * This function is invoked to process the "scan" option for the widget diff --git a/tests/text.test b/tests/text.test index f08431d..d8ed533 100644 --- a/tests/text.test +++ b/tests/text.test @@ -153,7 +153,7 @@ test text-3.1 {TextWidgetCmd procedure, basics} { } {1 {wrong # args: should be ".t option ?arg arg ...?"}} test text-3.2 {TextWidgetCmd procedure} { list [catch {.t gorp 1.0 z 1.2} msg] $msg -} {1 {bad option "gorp": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, yupdate, or yview}} +} {1 {bad option "gorp": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingyupdate, replace, scan, search, see, tag, window, xview, yupdate, or yview}} test text-4.1 {TextWidgetCmd procedure, "bbox" option} { list [catch {.t bbox} msg] $msg @@ -221,7 +221,7 @@ test text-6.13 {TextWidgetCmd procedure, "compare" option} { } {1 {bad comparison operator "z": must be <, <=, ==, >=, >, or !=}} test text-6.14 {TextWidgetCmd procedure, "compare" option} { list [catch {.t co 1.0 z 1.2} msg] $msg -} {1 {ambiguous option "co": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, yupdate, or yview}} +} {1 {ambiguous option "co": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingyupdate, replace, scan, search, see, tag, window, xview, yupdate, or yview}} # "configure" option is already covered above @@ -230,7 +230,7 @@ test text-7.1 {TextWidgetCmd procedure, "debug" option} { } {1 {wrong # args: should be ".t debug boolean"}} test text-7.2 {TextWidgetCmd procedure, "debug" option} { list [catch {.t de 0 1} msg] $msg -} {1 {ambiguous option "de": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, yupdate, or yview}} +} {1 {ambiguous option "de": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingyupdate, replace, scan, search, see, tag, window, xview, yupdate, or yview}} test text-7.3 {TextWidgetCmd procedure, "debug" option} { .t debug true .t deb @@ -901,7 +901,7 @@ test text-10.2 {TextWidgetCmd procedure, "index" option} { } {1 {wrong # args: should be ".t index index"}} test text-10.3 {TextWidgetCmd procedure, "index" option} { list [catch {.t in a b} msg] $msg -} {1 {ambiguous option "in": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, yupdate, or yview}} +} {1 {ambiguous option "in": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingyupdate, replace, scan, search, see, tag, window, xview, yupdate, or yview}} test text-10.4 {TextWidgetCmd procedure, "index" option} { list [catch {.t index @xyz} msg] $msg } {1 {bad text index "@xyz"}} @@ -994,6 +994,37 @@ test text-11a.2 {TextWidgetCmd procedure, "yupdate" option} { set fraction2 [lindex [.top.yt yview] 0] lappend res [expr {$fraction1 == $fraction2}] } {1 0 1} +test text-11a.11 {TextWidgetCmd procedure, "pendingyupdate" option} { + destroy .yt + text .yt + list [catch {.yt pendingyupdate mytext} msg] $msg +} {1 {wrong # args: should be ".yt pendingyupdate"}} +test text-11a.12 {TextWidgetCmd procedure, "pendingyupdate" option} { + destroy .top.yt .top + toplevel .top + pack [text .top.yt] + set content {} + for {set i 1} {$i < 300} {incr i} { + append content [string repeat "$i " 15] \n + } + .top.yt insert 1.0 $content + update + # wait for end of line metrics calculation to get correct $fraction1 + # as a reference + while {[.top.yt pendingyupdate]} {update} + .top.yt yview moveto 1 + set fraction1 [lindex [.top.yt yview] 0] + set res [expr {$fraction1 > 0}] + .top.yt delete 1.0 end + .top.yt insert 1.0 $content + # ensure the test is relevant + lappend res [expr {[.top.yt pendingyupdate] > 0}] + # asynchronously wait for completion of line metrics calculation + while {[.top.yt pendingyupdate]} {update} + .top.yt yview moveto $fraction1 + set fraction2 [lindex [.top.yt yview] 0] + lappend res [expr {$fraction1 == $fraction2}] +} {1 1 1} # edit, mark, scan, search, see, tag, window, xview and yview actions are tested elsewhere. @@ -3733,7 +3764,7 @@ test text-31.2 {TextWidgetCmd procedure, "peer" option} { list [catch {.t peer names foo} msg] $msg } {1 {wrong # args: should be ".t peer names"}} test text-31.3 {TextWidgetCmd procedure, "peer" option} { - list [catch {.t p names} msg] $msg + list [catch {.t pee names} msg] $msg } {0 {}} test text-31.4 {TextWidgetCmd procedure, "peer" option} { .t peer names -- cgit v0.12 From 8c6ac85de70a9f2ce13eecd5605fb55cfde6d911 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 16 Nov 2015 17:21:36 +0000 Subject: Better test for bug [2677890] since [19960bcef8] breaks relevance/efficiency of the previous version of textDisp-34.1 --- tests/textDisp.test | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/tests/textDisp.test b/tests/textDisp.test index 9c6af70..4c88b38 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -4162,29 +4162,34 @@ test textDisp-33.5 {bold or italic fonts} win { } {italic font measurement ok} destroy .tt -test textDisp-34.1 {Text widgets multi-scrolling problem: Bug 2677890} -setup { - pack [text .t1 -width 10 -yscrollcommand {.sy set}] \ - [ttk::scrollbar .sy -orient vertical -command {.t1 yview}] \ - -side left -fill both - bindtags .sy {}; # No clicky! +test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup { + pack [text .t1] -expand 1 -fill both set txt "" - for {set i 0} {$i < 99} {incr i} { - lappend txt "$i" [list pc $i] "\n" "" + for {set i 1} {$i < 100} {incr i} { + append txt "Line $i\n" } set result {} } -body { - .t1 insert end {*}$txt - update - lappend result [.sy get] - .t1 replace 6.0 6.0+1c "*" - lappend result [.sy get] - after 0 {lappend result [.sy get]} - after 1000 {lappend result [.sy get]} - vwait result;vwait result - return $result + .t1 insert end $txt + .t1 debug 1 + set ge [winfo geometry .] + scan $ge "%dx%d+%d+%d" width height left top + update + .t1 yupdate + set negative 0 + bind .t1 <> { if {%d < 0} {set negative 1} } + # Without the fix for bug 2677890, changing the width of the toplevel + # will launch recomputation of the line heights, but will produce negative + # number of still remaining outdated lines, which is obviously wrong. + # Thus we use this way to check for regression regarding bug 2677890, + # i.e. to check that the fix for this bug really is still in. + wm geometry . "[expr {$width * 2}]x$height+$left+$top" + update + .t1 yupdate + set negative } -cleanup { - destroy .t1 .sy -} -result {{0.0 0.24} {0.0 0.24} {0.0 0.24} {0.0 0.24}} + destroy .t1 +} -result {0} deleteWindows option clear -- cgit v0.12 From 3f3a9160c939098aa881f1b2429f23f883750a87 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 17 Nov 2015 15:20:13 +0000 Subject: Fixed bug [1997299fff] - Tag borderwidth is leaking horizontally --- generic/tkTextDisp.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 6036222..7cf996f 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2540,7 +2540,7 @@ DisplayLineBackground( * current x coordinate? */ int matchRight; /* Does line's style match its neighbor just * to the right of the current x-coord? */ - int minX, maxX, xOffset; + int minX, maxX, xOffset, bw; StyleValues *sValuePtr; Display *display; #ifndef TK_NO_DOUBLE_BUFFERING @@ -2611,16 +2611,25 @@ DisplayLineBackground( rightX = leftX + 32767; } + /* + * Prevent the borders from leaking on adjacent characters, + * which would happen for too large border width. + */ + + bw = sValuePtr->borderWidth; + if (leftX + sValuePtr->borderWidth > rightX) { + bw = rightX - leftX; + } + XFillRectangle(display, pixmap, chunkPtr->stylePtr->bgGC, leftX + xOffset, y, (unsigned int) (rightX - leftX), (unsigned int) dlPtr->height); if (sValuePtr->relief != TK_RELIEF_FLAT) { Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border, - leftX + xOffset, y, sValuePtr->borderWidth, - dlPtr->height, 1, sValuePtr->relief); + leftX + xOffset, y, bw, dlPtr->height, 1, + sValuePtr->relief); Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border, - rightX - sValuePtr->borderWidth + xOffset, - y, sValuePtr->borderWidth, dlPtr->height, 0, + rightX - bw + xOffset, y, bw, dlPtr->height, 0, sValuePtr->relief); } } -- cgit v0.12 From f9deb87502be44e6422e4996e26bf383903fdda1 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 17 Nov 2015 23:52:07 +0000 Subject: More leaking tags fixed, see test script in bug [1997299fff] --- generic/tkTextDisp.c | 52 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 7cf996f..cfe6e7a 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2726,22 +2726,29 @@ DisplayLineBackground( matchRight = (nextPtr2 != NULL) && SAME_BACKGROUND(nextPtr2->stylePtr, chunkPtr->stylePtr); if (matchLeft && !matchRight) { + bw = sValuePtr->borderWidth; + if (rightX2 - sValuePtr->borderWidth < leftX) { + bw = rightX2 - leftX; + } if (sValuePtr->relief != TK_RELIEF_FLAT) { Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border, - rightX2 - sValuePtr->borderWidth + xOffset, y, - sValuePtr->borderWidth, sValuePtr->borderWidth, 0, - sValuePtr->relief); + rightX2 - bw + xOffset, y, bw, + sValuePtr->borderWidth, 0, sValuePtr->relief); } - leftX = rightX2 - sValuePtr->borderWidth; + leftX = rightX2 - bw; leftXIn = 0; } else if (!matchLeft && matchRight && (sValuePtr->relief != TK_RELIEF_FLAT)) { + bw = sValuePtr->borderWidth; + if (rightX2 + sValuePtr->borderWidth > rightX) { + bw = rightX - rightX2; + } Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border, - rightX2 + xOffset, y, sValuePtr->borderWidth, - sValuePtr->borderWidth, 1, sValuePtr->relief); + rightX2 + xOffset, y, bw, sValuePtr->borderWidth, + 1, sValuePtr->relief); Tk_3DHorizontalBevel(textPtr->tkwin, pixmap, sValuePtr->border, - leftX + xOffset, y, rightX2 + sValuePtr->borderWidth - - leftX, sValuePtr->borderWidth, leftXIn, 0, 1, + leftX + xOffset, y, rightX2 + bw - leftX, + sValuePtr->borderWidth, leftXIn, 0, 1, sValuePtr->relief); } @@ -2773,7 +2780,7 @@ DisplayLineBackground( chunkPtr2 = NULL; if (dlPtr->nextPtr != NULL && dlPtr->nextPtr->chunkPtr != NULL) { /* - * Find the chunk in the previous line that covers leftX. + * Find the chunk in the next line that covers leftX. */ nextPtr2 = dlPtr->nextPtr->chunkPtr; @@ -2829,26 +2836,33 @@ DisplayLineBackground( matchRight = (nextPtr2 != NULL) && SAME_BACKGROUND(nextPtr2->stylePtr, chunkPtr->stylePtr); if (matchLeft && !matchRight) { + bw = sValuePtr->borderWidth; + if (rightX2 - sValuePtr->borderWidth < leftX) { + bw = rightX2 - leftX; + } if (sValuePtr->relief != TK_RELIEF_FLAT) { Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border, - rightX2 - sValuePtr->borderWidth + xOffset, + rightX2 - bw + xOffset, y + dlPtr->height - sValuePtr->borderWidth, - sValuePtr->borderWidth, sValuePtr->borderWidth, 0, - sValuePtr->relief); + bw, sValuePtr->borderWidth, 0, sValuePtr->relief); } - leftX = rightX2 - sValuePtr->borderWidth; + leftX = rightX2 - bw; leftXIn = 1; } else if (!matchLeft && matchRight && (sValuePtr->relief != TK_RELIEF_FLAT)) { + bw = sValuePtr->borderWidth; + if (rightX2 + sValuePtr->borderWidth > rightX) { + bw = rightX - rightX2; + } Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border, - rightX2 + xOffset, y + dlPtr->height - - sValuePtr->borderWidth, sValuePtr->borderWidth, + rightX2 + xOffset, + y + dlPtr->height - sValuePtr->borderWidth, bw, sValuePtr->borderWidth, 1, sValuePtr->relief); Tk_3DHorizontalBevel(textPtr->tkwin, pixmap, sValuePtr->border, - leftX + xOffset, y + dlPtr->height - - sValuePtr->borderWidth, rightX2 + sValuePtr->borderWidth - - leftX, sValuePtr->borderWidth, leftXIn, 1, 0, - sValuePtr->relief); + leftX + xOffset, + y + dlPtr->height - sValuePtr->borderWidth, + rightX2 + bw - leftX, sValuePtr->borderWidth, leftXIn, + 1, 0, sValuePtr->relief); } nextChunk2b: -- cgit v0.12 From 617357cee930232f242f3f6345ac828f2ab59b10 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 18 Nov 2015 21:14:04 +0000 Subject: Added visual tests for borders, following bug [1997299fff] --- tests/bevel.tcl | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/tests/bevel.tcl b/tests/bevel.tcl index 950b714..531def0 100644 --- a/tests/bevel.tcl +++ b/tests/bevel.tcl @@ -42,6 +42,7 @@ significance: r - should appear raised u - should appear raised and also slightly offset vertically s - should appear sunken +S - should appear solid n - preceding relief should extend right to end of line. * - should appear "normal" x - extra long lines to allow horizontal scrolling. @@ -125,15 +126,35 @@ foreach i {1 2 3} { .t.t insert end ***** .t.t insert end rrr r1 +font configure TkFixedFont -size 20 +.t.t tag configure sol100 -relief solid -borderwidth 100 \ + -foreground red -font TkFixedFont +.t.t tag configure sol12 -relief solid -borderwidth 12 \ + -foreground red -font TkFixedFont +.t.t tag configure big -font TkFixedFont +set ind [.t.t index end] + +.t.t insert end "\n\nBorders do not leak on the neighbour chars" +.t.t insert end "\nOnly \"S\" is on dark background" +.t.t insert end { + xxx + x} {} S sol100 {x + xxx} + +.t.t insert end "\n\nA very thick border grows toward the inside of the tagged area only" +.t.t insert end "\nOnly \"S\" is on dark background" +.t.t insert end { + xxxx} {} SSSSS sol100 {xxxx + x} {} SSSSSSSSSSSSSSSSSS sol100 {x + xxx} {} SSSSSSSSS sol100 xxxx {} +} +.t.t insert end "\n\nA thinner border is continuous" +.t.t insert end { + xxxx} {} SSSSS sol12 {xxxx + x} {} SSSSSSSSSSSSSSSSSS sol12 {x + xxx} {} SSSSSSSSS sol12 xxxx {} +} - - - - - - - - - +.t.t tag add big $ind end -- cgit v0.12 From f0e7b98adcaa0890c60fdf84c8e9753f8f903a53 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 19 Nov 2015 20:46:40 +0000 Subject: First test-implementation of "$t yupdate -command ". TODO: more testcases and documentation --- generic/tkText.c | 37 +++++++++++++++++++++++++++++-------- generic/tkText.h | 1 + generic/tkTextDisp.c | 13 ++++++++++++- tests/textDisp.test | 18 ++++++++++++++++++ 4 files changed, 60 insertions(+), 9 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 5c7f187..2c4d54c 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -1508,14 +1508,31 @@ TextWidgetObjCmd( result = TkTextXviewCmd(textPtr, interp, objc, objv); break; case TEXT_YUPDATE: { - if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, NULL); - result = TCL_ERROR; - goto done; - } - TkTextUpdateLineMetrics(textPtr, 1, - TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr), -1); - break; + if ((objc == 4) && !strncmp(Tcl_GetString(objv[2]), "-command", objv[3]->length)) { + Tcl_Obj *cmd = objv[3]; + Tcl_IncrRefCount(cmd); + if (TkTextPendingyupdate(textPtr)) { + if (textPtr->linesUpdatedCmd) { + Tcl_DecrRefCount(textPtr->linesUpdatedCmd); + } + textPtr->linesUpdatedCmd = cmd; + } else { + result = Tcl_EvalObjEx(interp, cmd, TCL_EVAL_GLOBAL); + Tcl_DecrRefCount(cmd); + } + break; + } else if (objc != 2) { + Tcl_WrongNumArgs(interp, 2, objv, "?-command command?"); + result = TCL_ERROR; + goto done; + } + if (textPtr->linesUpdatedCmd) { + Tcl_DecrRefCount(textPtr->linesUpdatedCmd); + } + textPtr->linesUpdatedCmd = NULL; + TkTextUpdateLineMetrics(textPtr, 1, + TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr), -1); + break; } case TEXT_YVIEW: result = TkTextYviewCmd(textPtr, interp, objc, objv); @@ -1993,6 +2010,10 @@ DestroyText( textPtr->tkwin = NULL; textPtr->refCount--; Tcl_DeleteCommandFromToken(textPtr->interp, textPtr->widgetCmd); + if (textPtr->linesUpdatedCmd != 0){ + Tcl_DecrRefCount(textPtr->linesUpdatedCmd); + textPtr->linesUpdatedCmd = 0; + } if (textPtr->refCount == 0) { ckfree((char *) textPtr); } diff --git a/generic/tkText.h b/generic/tkText.h index 2d1bcaa..192ab12 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -782,6 +782,7 @@ typedef struct TkText { * statements. */ int autoSeparators; /* Non-zero means the separators will be * inserted automatically. */ + Tcl_Obj *linesUpdatedCmd; /* Command to be executed when lines are up to date */ } TkText; /* diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index ff90520..d31d2f3 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2942,9 +2942,20 @@ AsyncUpdateLineMetrics( /* * We have looped over all lines, so we're done. We must release our * refCount on the widget (the timer token was already set to NULL - * above). + * above). If there is a registered command, run that first. */ + if (textPtr->linesUpdatedCmd != NULL) { + Tcl_Preserve((ClientData)textPtr->interp); + int code = Tcl_EvalObjEx(textPtr->interp, textPtr->linesUpdatedCmd, TCL_EVAL_GLOBAL); + if (code != TCL_OK && code != TCL_CONTINUE + && code != TCL_BREAK) { + Tcl_AddErrorInfo(textPtr->interp, "\n (text yupdate)"); + Tcl_BackgroundError(textPtr->interp); + } + Tcl_Release((ClientData)textPtr->interp); + } + textPtr->refCount--; if (textPtr->refCount == 0) { ckfree((char *) textPtr); diff --git a/tests/textDisp.test b/tests/textDisp.test index 4c88b38..f2b176c 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -4191,6 +4191,24 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup { destroy .t1 } -result {0} +test textDisp-34.2 {text yupdate syntax} -body { +} -body { + pack [text .t1] -expand 1 -fill both + .t1 yupdate foo +} -cleanup { + destroy .t1 +} -returnCodes 1 -result {wrong # args: should be ".t1 yupdate ?-command command?"} + +test textDisp-34.3 {text yupdate syntax} -body { +} -body { + set ::x 0 + pack [text .t1] -expand 1 -fill both + .t1 yupdate -command [list set ::x 1] + set ::x +} -cleanup { + destroy .t1 +} -result {1} + deleteWindows option clear -- cgit v0.12 From d7e64d08df9fe0539c308b04f9a33201faa188f5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 19 Nov 2015 21:04:08 +0000 Subject: better argument checking --- generic/tkText.c | 8 +++++++- tests/textDisp.test | 10 +++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 2c4d54c..9cae716 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -1508,8 +1508,14 @@ TextWidgetObjCmd( result = TkTextXviewCmd(textPtr, interp, objc, objv); break; case TEXT_YUPDATE: { - if ((objc == 4) && !strncmp(Tcl_GetString(objv[2]), "-command", objv[3]->length)) { + if (objc == 4) { Tcl_Obj *cmd = objv[3]; + const char *option = Tcl_GetString(objv[2]); + if (strncmp(option, "-command", objv[2]->length)) { + Tcl_AppendResult(interp, "wrong option \"", option, "\": should be \"-command\"", NULL); + result = TCL_ERROR; + goto done; + } Tcl_IncrRefCount(cmd); if (TkTextPendingyupdate(textPtr)) { if (textPtr->linesUpdatedCmd) { diff --git a/tests/textDisp.test b/tests/textDisp.test index f2b176c..133fcf5 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -4201,9 +4201,17 @@ test textDisp-34.2 {text yupdate syntax} -body { test textDisp-34.3 {text yupdate syntax} -body { } -body { + pack [text .t1] -expand 1 -fill both + .t1 yupdate -comx foo +} -cleanup { + destroy .t1 +} -returnCodes 1 -result {wrong option "-comx": should be "-command"} + +test textDisp-34.4 {text yupdate syntax} -body { +} -body { set ::x 0 pack [text .t1] -expand 1 -fill both - .t1 yupdate -command [list set ::x 1] + .t1 yupdate -comm [list set ::x 1] set ::x } -cleanup { destroy .t1 -- cgit v0.12 From ae5a551ea90e295489c9b93879ddd911615e0536 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 19 Nov 2015 21:41:31 +0000 Subject: Code Formatting --- generic/tkText.c | 54 ++++++++++++++++++++++++++-------------------------- generic/tkText.h | 2 +- generic/tkTextDisp.c | 14 ++++++++------ 3 files changed, 36 insertions(+), 34 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 9cae716..15c6e73 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -1508,36 +1508,36 @@ TextWidgetObjCmd( result = TkTextXviewCmd(textPtr, interp, objc, objv); break; case TEXT_YUPDATE: { - if (objc == 4) { - Tcl_Obj *cmd = objv[3]; - const char *option = Tcl_GetString(objv[2]); - if (strncmp(option, "-command", objv[2]->length)) { - Tcl_AppendResult(interp, "wrong option \"", option, "\": should be \"-command\"", NULL); + if (objc == 4) { + Tcl_Obj *cmd = objv[3]; + const char *option = Tcl_GetString(objv[2]); + if (strncmp(option, "-command", objv[2]->length)) { + Tcl_AppendResult(interp, "wrong option \"", option, "\": should be \"-command\"", NULL); result = TCL_ERROR; goto done; + } + Tcl_IncrRefCount(cmd); + if (TkTextPendingyupdate(textPtr)) { + if (textPtr->afterSyncCmd) { + Tcl_DecrRefCount(textPtr->afterSyncCmd); } - Tcl_IncrRefCount(cmd); - if (TkTextPendingyupdate(textPtr)) { - if (textPtr->linesUpdatedCmd) { - Tcl_DecrRefCount(textPtr->linesUpdatedCmd); - } - textPtr->linesUpdatedCmd = cmd; - } else { + textPtr->afterSyncCmd = cmd; + } else { result = Tcl_EvalObjEx(interp, cmd, TCL_EVAL_GLOBAL); Tcl_DecrRefCount(cmd); - } - break; - } else if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, "?-command command?"); - result = TCL_ERROR; - goto done; - } - if (textPtr->linesUpdatedCmd) { - Tcl_DecrRefCount(textPtr->linesUpdatedCmd); } - textPtr->linesUpdatedCmd = NULL; - TkTextUpdateLineMetrics(textPtr, 1, - TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr), -1); + break; + } else if (objc != 2) { + Tcl_WrongNumArgs(interp, 2, objv, "?-command command?"); + result = TCL_ERROR; + goto done; + } + if (textPtr->afterSyncCmd) { + Tcl_DecrRefCount(textPtr->afterSyncCmd); + } + textPtr->afterSyncCmd = NULL; + TkTextUpdateLineMetrics(textPtr, 1, + TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr), -1); break; } case TEXT_YVIEW: @@ -2016,9 +2016,9 @@ DestroyText( textPtr->tkwin = NULL; textPtr->refCount--; Tcl_DeleteCommandFromToken(textPtr->interp, textPtr->widgetCmd); - if (textPtr->linesUpdatedCmd != 0){ - Tcl_DecrRefCount(textPtr->linesUpdatedCmd); - textPtr->linesUpdatedCmd = 0; + if (textPtr->afterSyncCmd != 0){ + Tcl_DecrRefCount(textPtr->afterSyncCmd); + textPtr->afterSyncCmd = 0; } if (textPtr->refCount == 0) { ckfree((char *) textPtr); diff --git a/generic/tkText.h b/generic/tkText.h index 192ab12..2aa8d59 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -782,7 +782,7 @@ typedef struct TkText { * statements. */ int autoSeparators; /* Non-zero means the separators will be * inserted automatically. */ - Tcl_Obj *linesUpdatedCmd; /* Command to be executed when lines are up to date */ + Tcl_Obj *afterSyncCmd; /* Command to be executed when lines are up to date */ } TkText; /* diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index d31d2f3..a18e2b9 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2945,15 +2945,17 @@ AsyncUpdateLineMetrics( * above). If there is a registered command, run that first. */ - if (textPtr->linesUpdatedCmd != NULL) { - Tcl_Preserve((ClientData)textPtr->interp); - int code = Tcl_EvalObjEx(textPtr->interp, textPtr->linesUpdatedCmd, TCL_EVAL_GLOBAL); - if (code != TCL_OK && code != TCL_CONTINUE + if (textPtr->afterSyncCmd != NULL) { + Tcl_Preserve((ClientData)textPtr->interp); + int code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, TCL_EVAL_GLOBAL); + if (code != TCL_OK && code != TCL_CONTINUE && code != TCL_BREAK) { Tcl_AddErrorInfo(textPtr->interp, "\n (text yupdate)"); Tcl_BackgroundError(textPtr->interp); - } - Tcl_Release((ClientData)textPtr->interp); + } + Tcl_Release((ClientData)textPtr->interp); + Tcl_DecrRefCount(textPtr->afterSyncCmd); + textPtr->afterSyncCmd = 0; } textPtr->refCount--; -- cgit v0.12 From 811bb84daa1769e2840edf52bdc5922d8370d930 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 19 Nov 2015 21:57:36 +0000 Subject: Make it compile with Visual 2008 --- generic/tkTextDisp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index a18e2b9..8f72be0 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2946,8 +2946,8 @@ AsyncUpdateLineMetrics( */ if (textPtr->afterSyncCmd != NULL) { - Tcl_Preserve((ClientData)textPtr->interp); int code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, TCL_EVAL_GLOBAL); + Tcl_Preserve((ClientData)textPtr->interp); if (code != TCL_OK && code != TCL_CONTINUE && code != TCL_BREAK) { Tcl_AddErrorInfo(textPtr->interp, "\n (text yupdate)"); -- cgit v0.12 From 450aa9743dee157400ca5b3227922914f1c434a0 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 19 Nov 2015 21:59:11 +0000 Subject: Tcl_Preserve should be first I guess --- generic/tkTextDisp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 8f72be0..a8a8f85 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2946,8 +2946,9 @@ AsyncUpdateLineMetrics( */ if (textPtr->afterSyncCmd != NULL) { - int code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, TCL_EVAL_GLOBAL); + int code; Tcl_Preserve((ClientData)textPtr->interp); + code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, TCL_EVAL_GLOBAL); if (code != TCL_OK && code != TCL_CONTINUE && code != TCL_BREAK) { Tcl_AddErrorInfo(textPtr->interp, "\n (text yupdate)"); -- cgit v0.12 From a2432ecdb54d15171a3f5f403048743e09305ea5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 19 Nov 2015 22:02:27 +0000 Subject: Rename "yupdate" to "sync" and fix various test-cases --- generic/tkText.c | 50 +++++++++++++++++++++++++------------------------- generic/tkText.h | 2 +- generic/tkTextDisp.c | 24 ++++++++++++------------ tests/text.test | 42 +++++++++++++++++++++--------------------- tests/textDisp.test | 20 ++++++++++---------- 5 files changed, 69 insertions(+), 69 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 15c6e73..9047911 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -689,16 +689,16 @@ TextWidgetObjCmd( static const char *optionStrings[] = { "bbox", "cget", "compare", "configure", "count", "debug", "delete", "dlineinfo", "dump", "edit", "get", "image", "index", "insert", - "mark", "peer", "pendingyupdate", "replace", "scan", "search", - "see", "tag", "window", "xview", "yupdate", "yview", NULL + "mark", "peer", "pendingsync", "replace", "scan", "search", + "see", "sync", "tag", "window", "xview", "yview", NULL }; enum options { TEXT_BBOX, TEXT_CGET, TEXT_COMPARE, TEXT_CONFIGURE, TEXT_COUNT, TEXT_DEBUG, TEXT_DELETE, TEXT_DLINEINFO, TEXT_DUMP, TEXT_EDIT, TEXT_GET, TEXT_IMAGE, TEXT_INDEX, TEXT_INSERT, TEXT_MARK, - TEXT_PEER, TEXT_PENDINGYUPDATE, TEXT_REPLACE, TEXT_SCAN, - TEXT_SEARCH, TEXT_SEE, TEXT_TAG, TEXT_WINDOW, TEXT_XVIEW, - TEXT_YUPDATE, TEXT_YVIEW + TEXT_PEER, TEXT_PENDINGSYNC, TEXT_REPLACE, TEXT_SCAN, + TEXT_SEARCH, TEXT_SEE, TEXT_SYNC, TEXT_TAG, TEXT_WINDOW, + TEXT_XVIEW, TEXT_YVIEW }; if (objc < 2) { @@ -1373,7 +1373,7 @@ TextWidgetObjCmd( case TEXT_PEER: result = TextPeerCmd(textPtr, interp, objc, objv); break; - case TEXT_PENDINGYUPDATE: { + case TEXT_PENDINGSYNC: { int number; if (objc != 2) { @@ -1381,7 +1381,7 @@ TextWidgetObjCmd( result = TCL_ERROR; goto done; } - number = TkTextPendingyupdate(textPtr); + number = TkTextPendingsync(textPtr); Tcl_SetObjResult(interp, Tcl_NewIntObj(number)); break; } @@ -1507,26 +1507,26 @@ TextWidgetObjCmd( case TEXT_XVIEW: result = TkTextXviewCmd(textPtr, interp, objc, objv); break; - case TEXT_YUPDATE: { + case TEXT_SYNC: { if (objc == 4) { - Tcl_Obj *cmd = objv[3]; - const char *option = Tcl_GetString(objv[2]); - if (strncmp(option, "-command", objv[2]->length)) { - Tcl_AppendResult(interp, "wrong option \"", option, "\": should be \"-command\"", NULL); - result = TCL_ERROR; - goto done; - } - Tcl_IncrRefCount(cmd); - if (TkTextPendingyupdate(textPtr)) { - if (textPtr->afterSyncCmd) { - Tcl_DecrRefCount(textPtr->afterSyncCmd); - } - textPtr->afterSyncCmd = cmd; - } else { - result = Tcl_EvalObjEx(interp, cmd, TCL_EVAL_GLOBAL); - Tcl_DecrRefCount(cmd); + Tcl_Obj *cmd = objv[3]; + const char *option = Tcl_GetString(objv[2]); + if (strncmp(option, "-command", objv[2]->length)) { + Tcl_AppendResult(interp, "wrong option \"", option, "\": should be \"-command\"", NULL); + result = TCL_ERROR; + goto done; + } + Tcl_IncrRefCount(cmd); + if (TkTextPendingsync(textPtr)) { + if (textPtr->afterSyncCmd) { + Tcl_DecrRefCount(textPtr->afterSyncCmd); } - break; + textPtr->afterSyncCmd = cmd; + } else { + result = Tcl_EvalObjEx(interp, cmd, TCL_EVAL_GLOBAL); + Tcl_DecrRefCount(cmd); + } + break; } else if (objc != 2) { Tcl_WrongNumArgs(interp, 2, objv, "?-command command?"); result = TCL_ERROR; diff --git a/generic/tkText.h b/generic/tkText.h index 2aa8d59..1c4be68 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -1125,7 +1125,7 @@ MODULE_SCOPE int TkTextMarkNameToIndex(TkText *textPtr, MODULE_SCOPE void TkTextMarkSegToIndex(TkText *textPtr, TkTextSegment *markPtr, TkTextIndex *indexPtr); MODULE_SCOPE void TkTextEventuallyRepick(TkText *textPtr); -MODULE_SCOPE int TkTextPendingyupdate(TkText *textPtr); +MODULE_SCOPE int TkTextPendingsync(TkText *textPtr); MODULE_SCOPE void TkTextPickCurrent(TkText *textPtr, XEvent *eventPtr); MODULE_SCOPE void TkTextPixelIndex(TkText *textPtr, int x, int y, TkTextIndex *indexPtr, int *nearest); diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index a8a8f85..3cee288 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -590,7 +590,7 @@ static int TextGetScrollInfoObj(Tcl_Interp *interp, Tcl_Obj *CONST objv[], double *dblPtr, int *intPtr); static void AsyncUpdateLineMetrics(ClientData clientData); -static void GenerateTextLineHeightsInvalidEvent(TkText *textPtr); +static void GenerateWidgetViewSyncEvent(TkText *textPtr); static void AsyncUpdateYScrollbar(ClientData clientData); static int IsStartOfNotMergedLine(TkText *textPtr, CONST TkTextIndex *indexPtr); @@ -2930,7 +2930,7 @@ AsyncUpdateLineMetrics( LOG("tk_textInvalidateLine", buffer); } - GenerateTextLineHeightsInvalidEvent(textPtr); + GenerateWidgetViewSyncEvent(textPtr); /* * If we're not in the middle of a long-line calculation (metricEpoch==-1) @@ -2942,7 +2942,7 @@ AsyncUpdateLineMetrics( /* * We have looped over all lines, so we're done. We must release our * refCount on the widget (the timer token was already set to NULL - * above). If there is a registered command, run that first. + * above). If there is a registered aftersync command, run that first. */ if (textPtr->afterSyncCmd != NULL) { @@ -2951,7 +2951,7 @@ AsyncUpdateLineMetrics( code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, TCL_EVAL_GLOBAL); if (code != TCL_OK && code != TCL_CONTINUE && code != TCL_BREAK) { - Tcl_AddErrorInfo(textPtr->interp, "\n (text yupdate)"); + Tcl_AddErrorInfo(textPtr->interp, "\n (text sync)"); Tcl_BackgroundError(textPtr->interp); } Tcl_Release((ClientData)textPtr->interp); @@ -2978,12 +2978,12 @@ AsyncUpdateLineMetrics( /* *---------------------------------------------------------------------- * - * GenerateTextLineHeightsInvalidEvent -- + * GenerateWidgetViewSyncEvent -- * - * Send the <> event related to the text widget + * Send the <> event related to the text widget * line metrics asynchronous update. * This is equivalent to: - * event generate $textWidget <> -detail $N + * event generate $textWidget <> -detail $N * where $N is the number of lines for which the height is outdated. * * Results: @@ -2996,7 +2996,7 @@ AsyncUpdateLineMetrics( */ static void -GenerateTextLineHeightsInvalidEvent( +GenerateWidgetViewSyncEvent( TkText *textPtr) /* Information about text widget. */ { union {XEvent general; XVirtualEvent virtual;} event; @@ -3007,8 +3007,8 @@ GenerateTextLineHeightsInvalidEvent( event.general.xany.send_event = False; event.general.xany.window = Tk_WindowId(textPtr->tkwin); event.general.xany.display = Tk_Display(textPtr->tkwin); - event.virtual.name = Tk_GetUid("TextLineHeightsInvalid"); - event.virtual.user_data = Tcl_NewIntObj(TkTextPendingyupdate(textPtr)); + event.virtual.name = Tk_GetUid("WidgetViewSync"); + event.virtual.user_data = Tcl_NewIntObj(TkTextPendingsync(textPtr)); Tk_HandleEvent(&event.general); } @@ -6089,7 +6089,7 @@ TkTextYviewCmd( /* *-------------------------------------------------------------- * - * TkTextPendingyupdate -- + * TkTextPendingsync -- * * This function computes how many lines are not up-to-date regarding * asynchronous height calculations. @@ -6105,7 +6105,7 @@ TkTextYviewCmd( */ int -TkTextPendingyupdate( +TkTextPendingsync( TkText *textPtr) /* Information about text widget. */ { TextDInfo *dInfoPtr = textPtr->dInfoPtr; diff --git a/tests/text.test b/tests/text.test index 7e754e2..3532546 100644 --- a/tests/text.test +++ b/tests/text.test @@ -153,7 +153,7 @@ test text-3.1 {TextWidgetCmd procedure, basics} { } {1 {wrong # args: should be ".t option ?arg arg ...?"}} test text-3.2 {TextWidgetCmd procedure} { list [catch {.t gorp 1.0 z 1.2} msg] $msg -} {1 {bad option "gorp": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingyupdate, replace, scan, search, see, tag, window, xview, yupdate, or yview}} +} {1 {bad option "gorp": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview}} test text-4.1 {TextWidgetCmd procedure, "bbox" option} { list [catch {.t bbox} msg] $msg @@ -221,7 +221,7 @@ test text-6.13 {TextWidgetCmd procedure, "compare" option} { } {1 {bad comparison operator "z": must be <, <=, ==, >=, >, or !=}} test text-6.14 {TextWidgetCmd procedure, "compare" option} { list [catch {.t co 1.0 z 1.2} msg] $msg -} {1 {ambiguous option "co": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingyupdate, replace, scan, search, see, tag, window, xview, yupdate, or yview}} +} {1 {ambiguous option "co": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview}} # "configure" option is already covered above @@ -230,7 +230,7 @@ test text-7.1 {TextWidgetCmd procedure, "debug" option} { } {1 {wrong # args: should be ".t debug boolean"}} test text-7.2 {TextWidgetCmd procedure, "debug" option} { list [catch {.t de 0 1} msg] $msg -} {1 {ambiguous option "de": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingyupdate, replace, scan, search, see, tag, window, xview, yupdate, or yview}} +} {1 {ambiguous option "de": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview}} test text-7.3 {TextWidgetCmd procedure, "debug" option} { .t debug true .t deb @@ -901,7 +901,7 @@ test text-10.2 {TextWidgetCmd procedure, "index" option} { } {1 {wrong # args: should be ".t index index"}} test text-10.3 {TextWidgetCmd procedure, "index" option} { list [catch {.t in a b} msg] $msg -} {1 {ambiguous option "in": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingyupdate, replace, scan, search, see, tag, window, xview, yupdate, or yview}} +} {1 {ambiguous option "in": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, pendingsync, replace, scan, search, see, sync, tag, window, xview, or yview}} test text-10.4 {TextWidgetCmd procedure, "index" option} { list [catch {.t index @xyz} msg] $msg } {1 {bad text index "@xyz"}} @@ -960,12 +960,12 @@ test text-11.10 {TextWidgetCmd procedure, "insert" option} { list [.t get 1.0 1.end] [.t tag ranges bold] [.t tag ranges silly] } {{First second} {1.0 1.5} {1.5 1.12}} -test text-11a.1 {TextWidgetCmd procedure, "yupdate" option} { +test text-11a.1 {TextWidgetCmd procedure, "sync" option} { destroy .yt text .yt - list [catch {.yt yupdate mytext} msg] $msg -} {1 {wrong # args: should be ".yt yupdate"}} -test text-11a.2 {TextWidgetCmd procedure, "yupdate" option} { + list [catch {.yt sync mytext} msg] $msg +} {1 {wrong # args: should be ".yt sync ?-command command?"}} +test text-11a.2 {TextWidgetCmd procedure, "sync" option} { destroy .top.yt .top toplevel .top pack [text .top.yt] @@ -976,7 +976,7 @@ test text-11a.2 {TextWidgetCmd procedure, "yupdate" option} { .top.yt insert 1.0 $content # wait for end of line metrics calculation to get correct $fraction1 # as a reference - .top.yt yupdate + .top.yt sync .top.yt yview moveto 1 set fraction1 [lindex [.top.yt yview] 0] set res [expr {$fraction1 > 0}] @@ -989,17 +989,17 @@ test text-11a.2 {TextWidgetCmd procedure, "yupdate" option} { # second case: wait for completion of line metrics calculation .top.yt delete 1.0 end .top.yt insert 1.0 $content - .top.yt yupdate + .top.yt sync .top.yt yview moveto $fraction1 set fraction2 [lindex [.top.yt yview] 0] lappend res [expr {$fraction1 == $fraction2}] } {1 0 1} -test text-11a.11 {TextWidgetCmd procedure, "pendingyupdate" option} { +test text-11a.11 {TextWidgetCmd procedure, "pendingsync" option} { destroy .yt text .yt - list [catch {.yt pendingyupdate mytext} msg] $msg -} {1 {wrong # args: should be ".yt pendingyupdate"}} -test text-11a.12 {TextWidgetCmd procedure, "pendingyupdate" option} { + list [catch {.yt pendingsync mytext} msg] $msg +} {1 {wrong # args: should be ".yt pendingsync"}} +test text-11a.12 {TextWidgetCmd procedure, "pendingsync" option} { destroy .top.yt .top toplevel .top pack [text .top.yt] @@ -1011,21 +1011,21 @@ test text-11a.12 {TextWidgetCmd procedure, "pendingyupdate" option} { update # wait for end of line metrics calculation to get correct $fraction1 # as a reference - while {[.top.yt pendingyupdate]} {update} + while {[.top.yt pendingsync]} {update} .top.yt yview moveto 1 set fraction1 [lindex [.top.yt yview] 0] set res [expr {$fraction1 > 0}] .top.yt delete 1.0 end .top.yt insert 1.0 $content # ensure the test is relevant - lappend res [expr {[.top.yt pendingyupdate] > 0}] + lappend res [expr {[.top.yt pendingsync] > 0}] # asynchronously wait for completion of line metrics calculation - while {[.top.yt pendingyupdate]} {update} + while {[.top.yt pendingsync]} {update} .top.yt yview moveto $fraction1 set fraction2 [lindex [.top.yt yview] 0] lappend res [expr {$fraction1 == $fraction2}] } {1 1 1} -test text-11a.21 {"<>" event} { +test text-11a.21 {"<>" event} { destroy .top.yt .top toplevel .top pack [text .top.yt] @@ -1035,10 +1035,10 @@ test text-11a.21 {"<>" event} { } .top.yt insert 1.0 $content update - bind .top.yt <> { if {%d == 0} {set yud(%W) 1} } + bind .top.yt <> { if {%d == 0} {set yud(%W) 1} } # wait for end of line metrics calculation to get correct $fraction1 # as a reference - if {[.top.yt pendingyupdate]} {vwait yud(.top.yt)} + if {[.top.yt pendingsync]} {vwait yud(.top.yt)} .top.yt yview moveto 1 set fraction1 [lindex [.top.yt yview] 0] set res [expr {$fraction1 > 0}] @@ -1047,7 +1047,7 @@ test text-11a.21 {"<>" event} { # synchronously wait for completion of line metrics calculation # and ensure the test is relevant set waited 0 - if {[.top.yt pendingyupdate]} {set waited 1 ; vwait yud(.top.yt)} + if {[.top.yt pendingsync]} {set waited 1 ; vwait yud(.top.yt)} lappend res $waited .top.yt yview moveto $fraction1 set fraction2 [lindex [.top.yt yview] 0] diff --git a/tests/textDisp.test b/tests/textDisp.test index 133fcf5..80bdb9d 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -4175,9 +4175,9 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup { set ge [winfo geometry .] scan $ge "%dx%d+%d+%d" width height left top update - .t1 yupdate + .t1 sync set negative 0 - bind .t1 <> { if {%d < 0} {set negative 1} } + bind .t1 <> { if {%d < 0} {set negative 1} } # Without the fix for bug 2677890, changing the width of the toplevel # will launch recomputation of the line heights, but will produce negative # number of still remaining outdated lines, which is obviously wrong. @@ -4185,33 +4185,33 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup { # i.e. to check that the fix for this bug really is still in. wm geometry . "[expr {$width * 2}]x$height+$left+$top" update - .t1 yupdate + .t1 sync set negative } -cleanup { destroy .t1 } -result {0} -test textDisp-34.2 {text yupdate syntax} -body { +test textDisp-34.2 {text sync syntax} -body { } -body { pack [text .t1] -expand 1 -fill both - .t1 yupdate foo + .t1 sync foo } -cleanup { destroy .t1 -} -returnCodes 1 -result {wrong # args: should be ".t1 yupdate ?-command command?"} +} -returnCodes 1 -result {wrong # args: should be ".t1 sync ?-command command?"} -test textDisp-34.3 {text yupdate syntax} -body { +test textDisp-34.3 {text sync syntax} -body { } -body { pack [text .t1] -expand 1 -fill both - .t1 yupdate -comx foo + .t1 sync -comx foo } -cleanup { destroy .t1 } -returnCodes 1 -result {wrong option "-comx": should be "-command"} -test textDisp-34.4 {text yupdate syntax} -body { +test textDisp-34.4 {text sync syntax} -body { } -body { set ::x 0 pack [text .t1] -expand 1 -fill both - .t1 yupdate -comm [list set ::x 1] + .t1 sync -comm [list set ::x 1] set ::x } -cleanup { destroy .t1 -- cgit v0.12 From 1238f724da65d098cb652af93972b4d0ac6e8f72 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 21 Nov 2015 08:43:25 +0000 Subject: Adjusted when <> fires. Also %d now only has boolean value. Implementation in sync with TIP #438 rev. 1.10 --- generic/tkTextDisp.c | 24 +++++++++++++++++------- tests/text.test | 2 +- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 3cee288..d8a17a9 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -590,7 +590,7 @@ static int TextGetScrollInfoObj(Tcl_Interp *interp, Tcl_Obj *CONST objv[], double *dblPtr, int *intPtr); static void AsyncUpdateLineMetrics(ClientData clientData); -static void GenerateWidgetViewSyncEvent(TkText *textPtr); +static void GenerateWidgetViewSyncEvent(TkText *textPtr, Bool InSync); static void AsyncUpdateYScrollbar(ClientData clientData); static int IsStartOfNotMergedLine(TkText *textPtr, CONST TkTextIndex *indexPtr); @@ -2930,8 +2930,6 @@ AsyncUpdateLineMetrics( LOG("tk_textInvalidateLine", buffer); } - GenerateWidgetViewSyncEvent(textPtr); - /* * If we're not in the middle of a long-line calculation (metricEpoch==-1) * and we've reached the last line, then we're done. @@ -2959,6 +2957,14 @@ AsyncUpdateLineMetrics( textPtr->afterSyncCmd = 0; } + /* + * Fire the <> event since the widget view is in sync + * with its internal data (actually it will be after the next trip + * through the event loop, because the widget redraws at idle-time). + */ + + GenerateWidgetViewSyncEvent(textPtr, 1); + textPtr->refCount--; if (textPtr->refCount == 0) { ckfree((char *) textPtr); @@ -2983,8 +2989,9 @@ AsyncUpdateLineMetrics( * Send the <> event related to the text widget * line metrics asynchronous update. * This is equivalent to: - * event generate $textWidget <> -detail $N - * where $N is the number of lines for which the height is outdated. + * event generate $textWidget <> -detail $s + * where $s is the sync status: true (when the widget view is in + * sync with its internal data) or false (when it is not). * * Results: * None @@ -2997,7 +3004,8 @@ AsyncUpdateLineMetrics( static void GenerateWidgetViewSyncEvent( - TkText *textPtr) /* Information about text widget. */ + TkText *textPtr, /* Information about text widget. */ + Bool InSync) /* True if in sync, false otherwise */ { union {XEvent general; XVirtualEvent virtual;} event; @@ -3008,7 +3016,7 @@ GenerateWidgetViewSyncEvent( event.general.xany.window = Tk_WindowId(textPtr->tkwin); event.general.xany.display = Tk_Display(textPtr->tkwin); event.virtual.name = Tk_GetUid("WidgetViewSync"); - event.virtual.user_data = Tcl_NewIntObj(TkTextPendingsync(textPtr)); + event.virtual.user_data = Tcl_NewBooleanObj(InSync); Tk_HandleEvent(&event.general); } @@ -3391,6 +3399,7 @@ TextInvalidateLineMetrics( textPtr->refCount++; dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(1, AsyncUpdateLineMetrics, (ClientData) textPtr); + GenerateWidgetViewSyncEvent(textPtr, 0); } } @@ -5095,6 +5104,7 @@ TkTextRelayoutWindow( textPtr->refCount++; dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(1, AsyncUpdateLineMetrics, (ClientData) textPtr); + GenerateWidgetViewSyncEvent(textPtr, 0); } } } diff --git a/tests/text.test b/tests/text.test index 3532546..3ba85b7 100644 --- a/tests/text.test +++ b/tests/text.test @@ -1035,7 +1035,7 @@ test text-11a.21 {"<>" event} { } .top.yt insert 1.0 $content update - bind .top.yt <> { if {%d == 0} {set yud(%W) 1} } + bind .top.yt <> { if {%d} {set yud(%W) 1} } # wait for end of line metrics calculation to get correct $fraction1 # as a reference if {[.top.yt pendingsync]} {vwait yud(.top.yt)} -- cgit v0.12 From 6da3f989a4249675d97ecad8989d070f87966068 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 21 Nov 2015 09:08:52 +0000 Subject: Improved the tests a bit --- tests/text.test | 55 +++++++++++++++++++++++++++++++++++++++++++---------- tests/textDisp.test | 26 ------------------------- 2 files changed, 45 insertions(+), 36 deletions(-) diff --git a/tests/text.test b/tests/text.test index 3ba85b7..563f61b 100644 --- a/tests/text.test +++ b/tests/text.test @@ -960,13 +960,25 @@ test text-11.10 {TextWidgetCmd procedure, "insert" option} { list [.t get 1.0 1.end] [.t tag ranges bold] [.t tag ranges silly] } {{First second} {1.0 1.5} {1.5 1.12}} -test text-11a.1 {TextWidgetCmd procedure, "sync" option} { +test text-11a.1 {TextWidgetCmd procedure, "sync" option} -setup { destroy .yt +} -body { text .yt list [catch {.yt sync mytext} msg] $msg -} {1 {wrong # args: should be ".yt sync ?-command command?"}} -test text-11a.2 {TextWidgetCmd procedure, "sync" option} { +} -cleanup { + destroy .yt +} -result {1 {wrong # args: should be ".yt sync ?-command command?"}} +test text-11a.2 {TextWidgetCmd procedure, "sync" option with -command} -setup { + destroy .yt +} -body { + text .yt + list [catch {.yt sync -comx foo} msg] $msg +} -cleanup { + destroy .yt +} -result {1 {wrong option "-comx": should be "-command"}} +test text-11a.3 {TextWidgetCmd procedure, "sync" option} -setup { destroy .top.yt .top +} -body { toplevel .top pack [text .top.yt] set content {} @@ -993,14 +1005,31 @@ test text-11a.2 {TextWidgetCmd procedure, "sync" option} { .top.yt yview moveto $fraction1 set fraction2 [lindex [.top.yt yview] 0] lappend res [expr {$fraction1 == $fraction2}] -} {1 0 1} -test text-11a.11 {TextWidgetCmd procedure, "pendingsync" option} { +} -cleanup { + destroy .top.yt .top +} -result {1 0 1} +test text-11a.4 {TextWidgetCmd procedure, "sync" option with -command} -setup { + destroy .yt +} -body { + set ::x 0 + pack [text .yt] -expand 1 -fill both + .yt sync -command [list set ::x 1] + set ::x +} -cleanup { + destroy .yt +} -result {1} + +test text-11a.11 {TextWidgetCmd procedure, "pendingsync" option} -setup { destroy .yt +} -body { text .yt list [catch {.yt pendingsync mytext} msg] $msg -} {1 {wrong # args: should be ".yt pendingsync"}} -test text-11a.12 {TextWidgetCmd procedure, "pendingsync" option} { +} -cleanup { + destroy .yt +} -result {1 {wrong # args: should be ".yt pendingsync"}} +test text-11a.12 {TextWidgetCmd procedure, "pendingsync" option} -setup { destroy .top.yt .top +} -body { toplevel .top pack [text .top.yt] set content {} @@ -1024,9 +1053,13 @@ test text-11a.12 {TextWidgetCmd procedure, "pendingsync" option} { .top.yt yview moveto $fraction1 set fraction2 [lindex [.top.yt yview] 0] lappend res [expr {$fraction1 == $fraction2}] -} {1 1 1} -test text-11a.21 {"<>" event} { +} -cleanup { + destroy .top.yt .top +} -result {1 1 1} + +test text-11a.21 {"<>" event} -setup { destroy .top.yt .top +} -body { toplevel .top pack [text .top.yt] set content {} @@ -1052,7 +1085,9 @@ test text-11a.21 {"<>" event} { .top.yt yview moveto $fraction1 set fraction2 [lindex [.top.yt yview] 0] lappend res [expr {$fraction1 == $fraction2}] -} {1 1 1} +} -cleanup { + destroy .top.yt .top +} -result {1 1 1} # edit, mark, scan, search, see, tag, window, xview and yview actions are tested elsewhere. diff --git a/tests/textDisp.test b/tests/textDisp.test index 80bdb9d..c8264e6 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -4191,32 +4191,6 @@ test textDisp-34.1 {Line heights recalculation problem: bug 2677890} -setup { destroy .t1 } -result {0} -test textDisp-34.2 {text sync syntax} -body { -} -body { - pack [text .t1] -expand 1 -fill both - .t1 sync foo -} -cleanup { - destroy .t1 -} -returnCodes 1 -result {wrong # args: should be ".t1 sync ?-command command?"} - -test textDisp-34.3 {text sync syntax} -body { -} -body { - pack [text .t1] -expand 1 -fill both - .t1 sync -comx foo -} -cleanup { - destroy .t1 -} -returnCodes 1 -result {wrong option "-comx": should be "-command"} - -test textDisp-34.4 {text sync syntax} -body { -} -body { - set ::x 0 - pack [text .t1] -expand 1 -fill both - .t1 sync -comm [list set ::x 1] - set ::x -} -cleanup { - destroy .t1 -} -result {1} - deleteWindows option clear -- cgit v0.12 From b8c501de57829ea58d14a2f24841dec61241230a Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 21 Nov 2015 12:47:31 +0000 Subject: Respect alphabetical order --- generic/tkText.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 9047911..62de1af 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -1498,15 +1498,6 @@ TextWidgetObjCmd( case TEXT_SEE: result = TkTextSeeCmd(textPtr, interp, objc, objv); break; - case TEXT_TAG: - result = TkTextTagCmd(textPtr, interp, objc, objv); - break; - case TEXT_WINDOW: - result = TkTextWindowCmd(textPtr, interp, objc, objv); - break; - case TEXT_XVIEW: - result = TkTextXviewCmd(textPtr, interp, objc, objv); - break; case TEXT_SYNC: { if (objc == 4) { Tcl_Obj *cmd = objv[3]; @@ -1540,6 +1531,15 @@ TextWidgetObjCmd( TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr), -1); break; } + case TEXT_TAG: + result = TkTextTagCmd(textPtr, interp, objc, objv); + break; + case TEXT_WINDOW: + result = TkTextWindowCmd(textPtr, interp, objc, objv); + break; + case TEXT_XVIEW: + result = TkTextXviewCmd(textPtr, interp, objc, objv); + break; case TEXT_YVIEW: result = TkTextYviewCmd(textPtr, interp, objc, objv); break; -- cgit v0.12 From 258c36047d8f5dfd175a0b2cbaab37c1d0406cec Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 22 Nov 2015 20:11:32 +0000 Subject: Use the new sync command instead of the 'count -update' workaround --- tests/text.test | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/text.test b/tests/text.test index 563f61b..dc44293 100644 --- a/tests/text.test +++ b/tests/text.test @@ -745,10 +745,7 @@ test text-9.2.47 {TextWidgetCmd procedure, "count" option} -setup { .t tag configure hidden -elide true .t tag add hidden 5.7 11.0 update - # next line to be fully sure that asynchronous line heights calculation is - # up-to-date otherwise this test may fail (depending on the computer - # performance), especially when the . toplevel has small height - .t count -update -ypixels 1.0 end + .t sync set y1 [lindex [.t yview] 1] .t count -displaylines 5.0 11.0 set y2 [lindex [.t yview] 1] -- cgit v0.12 From 52d9e935fa49fe13831f9e0eddba4e260c88f0f0 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 22 Nov 2015 20:58:13 +0000 Subject: Added test textDisp-35.1 to check for regressions against pach [5b11cf19] --- tests/textDisp.test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/textDisp.test b/tests/textDisp.test index 9c6af70..5508d7c 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -4186,6 +4186,22 @@ test textDisp-34.1 {Text widgets multi-scrolling problem: Bug 2677890} -setup { destroy .t1 .sy } -result {{0.0 0.24} {0.0 0.24} {0.0 0.24} {0.0 0.24}} +test textDisp-35.1 {Init value of charHeight - Dancing scrollbar bug 1499165} -setup { + pack [text .t1] -fill both -expand y -side left + .t insert end "[string repeat a\nb\nc\n 500000]THE END\n" + set res {} +} -body { + .t see 10000.0 + after 300 {set fr1 [.t yview] ; set done 1} + vwait done + after 300 {set fr2 [.t yview] ; set done 1} + vwait done + lappend res [expr {[lindex $fr1 0] == [lindex $fr2 0]}] + lappend res [expr {[lindex $fr1 1] == [lindex $fr2 1]}] +} -cleanup { + destroy .t1 +} -result {1 1} + deleteWindows option clear -- cgit v0.12 From f56728f92c68f0ebbc445ee1e3daeda392780922 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Wed, 25 Nov 2015 03:13:02 +0000 Subject: Remove multiple deprecated internal API calls on OS X; streamline Apple Events implementation; thanks to Marc Culler for extensive patches --- generic/tkText.h | 2 +- macosx/tkMacOSXDialog.c | 179 ++++++++--- macosx/tkMacOSXDraw.c | 2 +- macosx/tkMacOSXFont.c | 18 +- macosx/tkMacOSXHLEvents.c | 747 +++++++++++++++++-------------------------- macosx/tkMacOSXMenu.c | 2 +- macosx/tkMacOSXMouseEvent.c | 116 ++----- macosx/tkMacOSXPrivate.h | 27 +- macosx/tkMacOSXWindowEvent.c | 13 +- macosx/tkMacOSXWm.c | 42 +++ macosx/tkMacOSXXStubs.c | 16 +- 11 files changed, 566 insertions(+), 598 deletions(-) diff --git a/generic/tkText.h b/generic/tkText.h index 99a4888..78a99a9 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -168,7 +168,7 @@ typedef struct TkTextSegment { int size; /* Size of this segment (# of bytes of index * space it occupies). */ union { - char chars[1]; /* Characters that make up character info. + char chars[2]; /* Characters that make up character info. * Actual length varies to hold as many * characters as needed.*/ TkTextToggle toggle; /* Information about tag toggle. */ diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 4b19260..ca17195 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -14,6 +14,17 @@ #include "tkMacOSXPrivate.h" #include "tkFileFilter.h" +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090 +#define modalOK NSOKButton +#define modalCancel NSCancelButton +#else +#define modalOK NSModalResponseOK +#define modalCancel NSModalResponseCancel +#endif +#define modalOther -1 +#define modalError -2 + + static const char *const colorOptionStrings[] = { "-initialcolor", "-parent", "-title", NULL }; @@ -130,6 +141,23 @@ static const short alertNativeButtonIndexAndTypeToButtonIndex[][3] = { [TYPE_YESNO] = {5, 6, 0}, [TYPE_YESNOCANCEL] = {5, 6, 4}, }; + +/* + * Construct a file URL from directory and filename. Either may + * be nil. If both are nil, returns nil. + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED > 1050 +static NSURL *getFileURL(NSString *directory, NSString *filename) { + NSURL *url = nil; + if (directory) { + url = [NSURL fileURLWithPath:directory]; + } + if (filename) { + url = [NSURL URLWithString:filename relativeToURL:url]; + } + return url; +} +#endif #pragma mark TKApplication(TKDialog) @@ -149,12 +177,12 @@ static const short alertNativeButtonIndexAndTypeToButtonIndex[][3] = { if (callbackInfo->multiple) { resultObj = Tcl_NewListObj(0, NULL); - for (NSString *name in [(NSOpenPanel*)panel filenames]) { + for (NSURL *url in [(NSOpenPanel*)panel URLs]) { Tcl_ListObjAppendElement(callbackInfo->interp, resultObj, - Tcl_NewStringObj([name UTF8String], -1)); + Tcl_NewStringObj([[url path] UTF8String], -1)); } } else { - resultObj = Tcl_NewStringObj([[panel filename] UTF8String], -1); + resultObj = Tcl_NewStringObj([[[panel URL]path] UTF8String], -1); } if (callbackInfo->cmdObj) { Tcl_Obj **objv, **tmpv; @@ -189,7 +217,7 @@ static const short alertNativeButtonIndexAndTypeToButtonIndex[][3] = { { AlertCallbackInfo *callbackInfo = contextInfo; - if (returnCode != NSAlertErrorReturn) { + if (returnCode >= NSAlertFirstButtonReturn) { Tcl_Obj *resultObj = Tcl_NewStringObj(alertButtonStrings[ alertNativeButtonIndexAndTypeToButtonIndex[callbackInfo-> typeIndex][returnCode - NSAlertFirstButtonReturn]], -1); @@ -309,7 +337,7 @@ Tk_ChooseColorObjCmd( [colorPanel setColor:initialColor]; } returnCode = [NSApp runModalForWindow:colorPanel]; - if (returnCode == NSOKButton) { + if (returnCode == modalOK) { color = [[colorPanel color] colorUsingColorSpace: [NSColorSpace genericRGBColorSpace]]; numberOfComponents = [color numberOfComponents]; @@ -369,7 +397,7 @@ Tk_GetOpenFileObjCmd( NSWindow *parent; NSMutableArray *fileTypes = nil; NSOpenPanel *panel = [NSOpenPanel openPanel]; - NSInteger returnCode = NSAlertErrorReturn; + NSInteger modalReturnCode = modalError; TkInitFileFilters(&fl); for (i = 1; i < objc; i += 2) { @@ -439,6 +467,7 @@ Tk_GetOpenFileObjCmd( break; } } + [panel setAllowsMultipleSelection:multiple]; if (fl.filters) { fileTypes = [NSMutableArray array]; for (FileFilter *filterPtr = fl.filters; filterPtr; @@ -471,7 +500,7 @@ Tk_GetOpenFileObjCmd( } } } - [panel setAllowsMultipleSelection:multiple]; + [panel setAllowedFileTypes:fileTypes]; if (cmdObj) { callbackInfo = ckalloc(sizeof(FilePanelCallbackInfo)); if (Tcl_IsShared(cmdObj)) { @@ -484,19 +513,37 @@ Tk_GetOpenFileObjCmd( callbackInfo->multiple = multiple; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { - [panel beginSheetForDirectory:directory file:filename types:fileTypes - modalForWindow:parent modalDelegate:NSApp didEndSelector: - @selector(tkFilePanelDidEnd:returnCode:contextInfo:) - contextInfo:callbackInfo]; - returnCode = cmdObj ? NSAlertOtherReturn : - [NSApp runModalForWindow:panel]; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + [panel beginSheetForDirectory:directory + file:filename + types:fileTypes + modalForWindow:parent + modalDelegate:NSApp + didEndSelector: + @selector(tkFilePanelDidEnd:returnCode:contextInfo:) + contextInfo:callbackInfo]; +#else + [panel setAllowedFileTypes:fileTypes]; + [panel setDirectoryURL:getFileURL(directory, filename)]; + [panel beginSheetModalForWindow:parent + completionHandler:^(NSInteger returnCode) + { [NSApp tkFilePanelDidEnd:panel + returnCode:returnCode + contextInfo:callbackInfo ]; } ]; +#endif + modalReturnCode = cmdObj ? modalOther : [NSApp runModalForWindow:panel]; } else { - returnCode = [panel runModalForDirectory:directory file:filename - types:fileTypes]; - [NSApp tkFilePanelDidEnd:panel returnCode:returnCode +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + modalReturnCode = [panel runModalForDirectory:directory + file:filename]; +#else + [panel setDirectoryURL:getFileURL(directory, filename)]; + modalReturnCode = [panel runModal]; +#endif + [NSApp tkFilePanelDidEnd:panel returnCode:modalReturnCode contextInfo:callbackInfo]; } - result = (returnCode != NSAlertErrorReturn) ? TCL_OK : TCL_ERROR; + result = (modalReturnCode != modalError) ? TCL_OK : TCL_ERROR; if (typeVariablePtr && result == TCL_OK) { /* * The -typevariable option is not really supported. @@ -548,7 +595,7 @@ Tk_GetSaveFileObjCmd( NSWindow *parent; NSMutableArray *fileTypes = nil; NSSavePanel *panel = [NSSavePanel savePanel]; - NSInteger returnCode = NSAlertErrorReturn; + NSInteger modalReturnCode = modalError; TkInitFileFilters(&fl); for (i = 1; i < objc; i += 2) { @@ -665,18 +712,34 @@ Tk_GetSaveFileObjCmd( callbackInfo->multiple = 0; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { - [panel beginSheetForDirectory:directory file:filename - modalForWindow:parent modalDelegate:NSApp didEndSelector: - @selector(tkFilePanelDidEnd:returnCode:contextInfo:) - contextInfo:callbackInfo]; - returnCode = cmdObj ? NSAlertOtherReturn : - [NSApp runModalForWindow:panel]; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + [panel beginSheetForDirectory:directory + file:filename + modalForWindow:parent + modalDelegate:NSApp + didEndSelector: + @selector(tkFilePanelDidEnd:returnCode:contextInfo:) + contextInfo:callbackInfo]; +#else + [panel setDirectoryURL:getFileURL(directory, filename)]; + [panel beginSheetModalForWindow:parent + completionHandler:^(NSInteger returnCode) + { [NSApp tkFilePanelDidEnd:panel + returnCode:returnCode + contextInfo:callbackInfo ]; } ]; +#endif + modalReturnCode = cmdObj ? modalOther : [NSApp runModalForWindow:panel]; } else { - returnCode = [panel runModalForDirectory:directory file:filename]; - [NSApp tkFilePanelDidEnd:panel returnCode:returnCode +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + modalReturnCode = [panel runModalForDirectory:directory file:filename]; +#else + [panel setDirectoryURL:getFileURL(directory, filename)]; + modalReturnCode = [panel runModal]; +#endif + [NSApp tkFilePanelDidEnd:panel returnCode:modalReturnCode contextInfo:callbackInfo]; } - result = (returnCode != NSAlertErrorReturn) ? TCL_OK : TCL_ERROR; + result = (modalReturnCode != modalError) ? TCL_OK : TCL_ERROR; end: TkFreeFileFilters(&fl); @@ -719,7 +782,7 @@ Tk_ChooseDirectoryObjCmd( NSString *message, *title; NSWindow *parent; NSOpenPanel *panel = [NSOpenPanel openPanel]; - NSInteger returnCode = NSAlertErrorReturn; + NSInteger modalReturnCode = modalError; for (i = 1; i < objc; i += 2) { if (Tcl_GetIndexFromObjStruct(interp, objv[i], chooseOptionStrings, @@ -787,18 +850,33 @@ Tk_ChooseDirectoryObjCmd( callbackInfo->multiple = 0; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { - [panel beginSheetForDirectory:directory file:filename - modalForWindow:parent modalDelegate:NSApp didEndSelector: - @selector(tkFilePanelDidEnd:returnCode:contextInfo:) +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + [panel beginSheetForDirectory:directory + file:filename + modalForWindow:parent + modalDelegate:NSApp + didEndSelector: @selector(tkFilePanelDidEnd:returnCode:contextInfo:) contextInfo:callbackInfo]; - returnCode = cmdObj ? NSAlertOtherReturn : - [NSApp runModalForWindow:panel]; +#else + [panel setDirectoryURL:getFileURL(directory, filename)]; + [panel beginSheetModalForWindow:parent + completionHandler:^(NSInteger returnCode) + { [NSApp tkFilePanelDidEnd:panel + returnCode:returnCode + contextInfo:callbackInfo ]; } ]; +#endif + modalReturnCode = cmdObj ? modalOther : [NSApp runModalForWindow:panel]; } else { - returnCode = [panel runModalForDirectory:directory file:filename]; - [NSApp tkFilePanelDidEnd:panel returnCode:returnCode +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + modalReturnCode = [panel runModalForDirectory:directory file:nil]; +#else + [panel setDirectoryURL:getFileURL(directory, filename)]; + modalReturnCode = [panel runModal]; +#endif + [NSApp tkFilePanelDidEnd:panel returnCode:modalReturnCode contextInfo:callbackInfo]; } - result = (returnCode != NSAlertErrorReturn) ? TCL_OK : TCL_ERROR; + result = (modalReturnCode != modalError) ? TCL_OK : TCL_ERROR; end: return result; @@ -899,7 +977,7 @@ TkMacOSXStandardAboutPanelObjCmd( Tcl_WrongNumArgs(interp, 1, objv, NULL); return TCL_ERROR; } - [NSApp orderFrontStandardAboutPanelWithOptions:nil]; + [NSApp orderFrontStandardAboutPanelWithOptions:[NSDictionary dictionary]]; return TCL_OK; } @@ -937,7 +1015,7 @@ Tk_MessageBoxObjCmd( NSWindow *parent; NSArray *buttons; NSAlert *alert = [NSAlert new]; - NSInteger returnCode = NSAlertErrorReturn; + NSInteger modalReturnCode = 1; iconIndex = ICON_INFO; typeIndex = TYPE_OK; @@ -1064,17 +1142,26 @@ Tk_MessageBoxObjCmd( callbackInfo->typeIndex = typeIndex; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { - [alert beginSheetModalForWindow:parent modalDelegate:NSApp - didEndSelector:@selector(tkAlertDidEnd:returnCode:contextInfo:) - contextInfo:callbackInfo]; - returnCode = cmdObj ? NSAlertOtherReturn : - [NSApp runModalForWindow:[alert window]]; +#if MAC_OS_X_VERSION_MIN_REQUIRED > 1090 + [alert beginSheetModalForWindow:parent + completionHandler:^(NSModalResponse returnCode) + { [NSApp tkAlertDidEnd:alert + returnCode:returnCode + contextInfo:callbackInfo ]; } ]; +#else + [alert beginSheetModalForWindow:parent + modalDelegate:NSApp + didEndSelector:@selector(tkAlertDidEnd:returnCode:contextInfo:) + contextInfo:callbackInfo]; +#endif + modalReturnCode = cmdObj ? 0 : + [NSApp runModalForWindow:[alert window]]; } else { - returnCode = [alert runModal]; - [NSApp tkAlertDidEnd:alert returnCode:returnCode + modalReturnCode = [alert runModal]; + [NSApp tkAlertDidEnd:alert returnCode:modalReturnCode contextInfo:callbackInfo]; } - result = (returnCode != NSAlertErrorReturn) ? TCL_OK : TCL_ERROR; + result = (modalReturnCode < 1) ? TCL_OK : TCL_ERROR; end: [alert release]; return result; diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 4728fea..ed8c428 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -675,7 +675,7 @@ GetCGContextForDrawable( if (macDraw->flags & TK_IS_BW_PIXMAP) { bitsPerPixel = 8; - bitmapInfo = kCGImageAlphaOnly; + bitmapInfo = (CGBitmapInfo)kCGImageAlphaOnly; } else { colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); bitsPerPixel = 32; diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 45a68f7..54b0fb8 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -15,6 +15,19 @@ #include "tkMacOSXPrivate.h" #include "tkMacOSXFont.h" +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 +#define defaultOrientation kCTFontDefaultOrientation +#define verticalOrientation kCTFontVerticalOrientation +#else +#define defaultOrientation kCTFontOrientationDefault +#define verticalOrientation kCTFontOrientationVertical +#endif +#if MAC_OS_X_VERSION_MIN_REQUIRED < 101100 +#define fixedPitch kCTFontUserFixedPitchFontType +#else +#define fixedPitch kCTFontUIFontUserFixedPitch +#endif + /* #ifdef TK_MAC_DEBUG #define TK_MAC_DEBUG_FONTS @@ -270,7 +283,7 @@ InitFont( fmPtr->fixed = [nsFont advancementForGlyph:glyphs[0]].width == [nsFont advancementForGlyph:glyphs[1]].width; bounds = NSRectFromCGRect(CTFontGetBoundingRectsForGlyphs((CTFontRef) - nsFont, kCTFontDefaultOrientation, ch, boundingRects, nCh)); + nsFont, defaultOrientation, ch, boundingRects, nCh)); kern = [nsFont advancementForGlyph:glyphs[2]].width - [fontPtr->nsFont advancementForGlyph:glyphs[2]].width; } @@ -382,8 +395,7 @@ TkpFontPkgInit( systemFont++; } TkInitFontAttributes(&fa); - nsFont = (NSFont*) CTFontCreateUIFontForLanguage( - kCTFontUserFixedPitchFontType, 11, NULL); + nsFont = (NSFont*) CTFontCreateUIFontForLanguage(fixedPitch, 11, NULL); if (nsFont) { GetTkFontAttributesForNSFont(nsFont, &fa); CFRelease(nsFont); diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c index daf860f..47033b0 100644 --- a/macosx/tkMacOSXHLEvents.c +++ b/macosx/tkMacOSXHLEvents.c @@ -7,12 +7,15 @@ * Copyright (c) 1995-1997 Sun Microsystems, Inc. * Copyright 2001-2009, Apple Inc. * Copyright (c) 2006-2009 Daniel A. Steffen + * Copyright (c) 2015 Marc Culler * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkMacOSXPrivate.h" +#include +#define URL_MAX_LENGTH (17 + MAXPATHLEN) /* * This is a Tcl_Event structure that the Quit AppleEvent handler uses to @@ -30,154 +33,32 @@ typedef struct KillEvent { * Static functions used only in this file. */ -static OSErr QuitHandler(const AppleEvent *event, - AppleEvent *reply, SRefCon handlerRefcon); -static OSErr OappHandler(const AppleEvent *event, - AppleEvent *reply, SRefCon handlerRefcon); -static OSErr RappHandler(const AppleEvent *event, - AppleEvent *reply, SRefCon handlerRefcon); -static OSErr OdocHandler(const AppleEvent *event, - AppleEvent *reply, SRefCon handlerRefcon); -static OSErr PrintHandler(const AppleEvent *event, - AppleEvent *reply, SRefCon handlerRefcon); -static OSErr ScriptHandler(const AppleEvent *event, - AppleEvent *reply, SRefCon handlerRefcon); -static OSErr PrefsHandler(const AppleEvent *event, - AppleEvent *reply, SRefCon handlerRefcon); -static int MissedAnyParameters(const AppleEvent *theEvent); -static int ReallyKillMe(Tcl_Event *eventPtr, int flags); -static OSStatus FSRefToDString(const FSRef *fsref, Tcl_DString *ds); +static void tkMacOSXProcessFiles(NSAppleEventDescriptor* event, + NSAppleEventDescriptor* replyEvent, + Tcl_Interp *interp, + char* procedure); +static int MissedAnyParameters(const AppleEvent *theEvent); +static int ReallyKillMe(Tcl_Event *eventPtr, int flags); #pragma mark TKApplication(TKHLEvents) @implementation TKApplication(TKHLEvents) - (void) terminate: (id) sender { - QuitHandler(NULL, NULL, (SRefCon) _eventInterp); + [self handleQuitApplicationEvent:Nil withReplyEvent:Nil]; } - (void) preferences: (id) sender { - PrefsHandler(NULL, NULL, (SRefCon) _eventInterp); + [self handleShowPreferencesEvent:Nil withReplyEvent:Nil]; } -@end - -#pragma mark - - -/* - *---------------------------------------------------------------------- - * - * TkMacOSXInitAppleEvents -- - * - * Initilize the Apple Events on the Macintosh. This registers the core - * event handlers. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -void -TkMacOSXInitAppleEvents( - Tcl_Interp *interp) /* Interp to handle basic events. */ +- (void) handleQuitApplicationEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent { - AEEventHandlerUPP OappHandlerUPP, RappHandlerUPP, OdocHandlerUPP; - AEEventHandlerUPP PrintHandlerUPP, QuitHandlerUPP, ScriptHandlerUPP; - AEEventHandlerUPP PrefsHandlerUPP; - static Boolean initialized = FALSE; - - if (!initialized) { - initialized = TRUE; - - /* - * Install event handlers for the core apple events. - */ - - QuitHandlerUPP = NewAEEventHandlerUPP(QuitHandler); - ChkErr(AEInstallEventHandler, kCoreEventClass, kAEQuitApplication, - QuitHandlerUPP, (SRefCon) interp, false); - - OappHandlerUPP = NewAEEventHandlerUPP(OappHandler); - ChkErr(AEInstallEventHandler, kCoreEventClass, kAEOpenApplication, - OappHandlerUPP, (SRefCon) interp, false); - - RappHandlerUPP = NewAEEventHandlerUPP(RappHandler); - ChkErr(AEInstallEventHandler, kCoreEventClass, kAEReopenApplication, - RappHandlerUPP, (SRefCon) interp, false); - - OdocHandlerUPP = NewAEEventHandlerUPP(OdocHandler); - ChkErr(AEInstallEventHandler, kCoreEventClass, kAEOpenDocuments, - OdocHandlerUPP, (SRefCon) interp, false); - - PrintHandlerUPP = NewAEEventHandlerUPP(PrintHandler); - ChkErr(AEInstallEventHandler, kCoreEventClass, kAEPrintDocuments, - PrintHandlerUPP, (SRefCon) interp, false); - - PrefsHandlerUPP = NewAEEventHandlerUPP(PrefsHandler); - ChkErr(AEInstallEventHandler, kCoreEventClass, kAEShowPreferences, - PrefsHandlerUPP, (SRefCon) interp, false); - - if (interp) { - ScriptHandlerUPP = NewAEEventHandlerUPP(ScriptHandler); - ChkErr(AEInstallEventHandler, kAEMiscStandards, kAEDoScript, - ScriptHandlerUPP, (SRefCon) interp, false); - } - } -} - -/* - *---------------------------------------------------------------------- - * - * TkMacOSXDoHLEvent -- - * - * Dispatch incomming highlevel events. - * - * Results: - * None. - * - * Side effects: - * Depends on the incoming event. - * - *---------------------------------------------------------------------- - */ - -int -TkMacOSXDoHLEvent( - void *theEvent) -{ - return AEProcessAppleEvent((EventRecord *)theEvent); -} - -/* - *---------------------------------------------------------------------- - * - * QuitHandler -- - * - * This is the 'quit' core Apple event handler. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static OSErr -QuitHandler( - const AppleEvent *event, - AppleEvent *reply, - SRefCon handlerRefcon) -{ - Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; KillEvent *eventPtr; - if (interp) { + if (_eventInterp) { /* * Call the exit command from the event loop, since you are not * supposed to call ExitToShell in an Apple Event Handler. We put this @@ -188,233 +69,221 @@ QuitHandler( eventPtr = ckalloc(sizeof(KillEvent)); eventPtr->header.proc = ReallyKillMe; - eventPtr->interp = interp; + eventPtr->interp = _eventInterp; Tcl_QueueEvent((Tcl_Event *) eventPtr, TCL_QUEUE_HEAD); } - return noErr; } - -/* - *---------------------------------------------------------------------- - * - * OappHandler -- - * - * This is the 'oapp' core Apple event handler. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static OSErr -OappHandler( - const AppleEvent *event, - AppleEvent *reply, - SRefCon handlerRefcon) +- (void) handleOpenApplicationEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent { - Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; + Tcl_Interp *interp = _eventInterp; if (interp && - Tcl_FindCommand(interp, "::tk::mac::OpenApplication", NULL, 0)){ - int code = Tcl_EvalEx(interp, "::tk::mac::OpenApplication", -1, TCL_EVAL_GLOBAL); + Tcl_FindCommand(_eventInterp, "::tk::mac::OpenApplication", NULL, 0)){ + int code = Tcl_EvalEx(_eventInterp, "::tk::mac::OpenApplication", + -1, TCL_EVAL_GLOBAL); if (code != TCL_OK) { - Tcl_BackgroundException(interp, code); + Tcl_BackgroundException(_eventInterp, code); } } - return noErr; } - -/* - *---------------------------------------------------------------------- - * - * RappHandler -- - * - * This is the 'rapp' core Apple event handler. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static OSErr -RappHandler( - const AppleEvent *event, - AppleEvent *reply, - SRefCon handlerRefcon) +- (void) handleReopenApplicationEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent { - Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090 ProcessSerialNumber thePSN = {0, kCurrentProcess}; - OSStatus err = ChkErr(SetFrontProcess, &thePSN); - - if (interp && Tcl_FindCommand(interp, + SetFrontProcess(&thePSN); +#else + [[NSApplication sharedApplication] activateIgnoringOtherApps: YES]; +#endif + if (_eventInterp && Tcl_FindCommand(_eventInterp, "::tk::mac::ReopenApplication", NULL, 0)) { - int code = Tcl_EvalEx(interp, "::tk::mac::ReopenApplication", -1, TCL_EVAL_GLOBAL); + int code = Tcl_EvalEx(_eventInterp, "::tk::mac::ReopenApplication", + -1, TCL_EVAL_GLOBAL); if (code != TCL_OK){ - Tcl_BackgroundException(interp, code); + Tcl_BackgroundException(_eventInterp, code); } } - return err; } - -/* - *---------------------------------------------------------------------- - * - * PrefsHandler -- - * - * This is the 'pref' core Apple event handler. Called when the user - * selects 'Preferences...' in MacOS X - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static OSErr -PrefsHandler( - const AppleEvent *event, - AppleEvent *reply, - SRefCon handlerRefcon) +- (void) handleShowPreferencesEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent { - Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; - - if (interp && - Tcl_FindCommand(interp, "::tk::mac::ShowPreferences", NULL, 0)){ - int code = Tcl_EvalEx(interp, "::tk::mac::ShowPreferences", -1, TCL_EVAL_GLOBAL); + if (_eventInterp && + Tcl_FindCommand(_eventInterp, "::tk::mac::ShowPreferences", NULL, 0)){ + int code = Tcl_EvalEx(_eventInterp, "::tk::mac::ShowPreferences", + -1, TCL_EVAL_GLOBAL); if (code != TCL_OK) { - Tcl_BackgroundException(interp, code); + Tcl_BackgroundException(_eventInterp, code); } } - return noErr; } - -/* - *---------------------------------------------------------------------- - * - * OdocHandler -- - * - * This is the 'odoc' core Apple event handler. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static OSErr -OdocHandler( - const AppleEvent *event, - AppleEvent *reply, - SRefCon handlerRefcon) +- (void) handleOpenDocumentsEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent { - Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; - AEDescList fileSpecList; - FSRef file; - DescType type; - Size actual; - long count, index; - AEKeyword keyword; - Tcl_DString command, pathName; - int code; + tkMacOSXProcessFiles(event, replyEvent, _eventInterp, "::tk::mac::OpenDocument"); +} - /* - * Don't bother if we don't have an interp or the open document procedure - * doesn't exist. - */ +- (void) handlePrintDocumentsEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent +{ + tkMacOSXProcessFiles(event, replyEvent, _eventInterp, "::tk::mac::PrintDocument"); +} - if (!interp || - !Tcl_FindCommand(interp, "::tk::mac::OpenDocument", NULL, 0)) { - return noErr; - } +- (void) handleDoScriptEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent +{ + OSStatus err; + const AEDesc *theDesc = nil; + DescType type = 0, initialType = 0; + Size actual; + int tclErr = -1; + char URLBuffer[1 + URL_MAX_LENGTH]; + char errString[128]; + char typeString[5]; /* - * If we get any errors while retrieving our parameters we just return with - * no error. + * The DoScript event receives one parameter that should be text data or a + * fileURL. */ - if (ChkErr(AEGetParamDesc, event, keyDirectObject, typeAEList, - &fileSpecList) != noErr) { - return noErr; + theDesc = [event aeDesc]; + if (theDesc == nil) { + return; } - if (MissedAnyParameters(event) != noErr) { - return noErr; + + err = AEGetParamPtr(theDesc, keyDirectObject, typeWildCard, &initialType, + NULL, 0, NULL); + if (err != noErr) { + sprintf(errString, "AEDoScriptHandler: GetParamDesc error %d", (int)err); + AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyErrorString, typeChar, + errString, strlen(errString)); + return; } - if (ChkErr(AECountItems, &fileSpecList, &count) != noErr) { - return noErr; + + if (MissedAnyParameters((AppleEvent*)theDesc)) { + sprintf(errString, "AEDoScriptHandler: extra parameters"); + AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyErrorString, typeChar, + errString, strlen(errString)); + return; } - /* - * Convert our parameters into a script to evaluate, skipping things that - * we can't handle right. - */ - - Tcl_DStringInit(&command); - Tcl_DStringAppend(&command, "::tk::mac::OpenDocument", -1); - for (index = 1; index <= count; index++) { - if (ChkErr(AEGetNthPtr, &fileSpecList, index, typeFSRef, &keyword, - &type, (Ptr) &file, sizeof(FSRef), &actual) != noErr) { - continue; + if (initialType == typeFileURL || initialType == typeAlias) { + /* + * The descriptor can be coerced to a file url. Source the file, or + * pass the path as a string argument to ::tk::mac::DoScriptFile if + * that procedure exists. + */ + err = AEGetParamPtr(theDesc, keyDirectObject, typeFileURL, &type, + (Ptr) URLBuffer, URL_MAX_LENGTH, &actual); + if (err == noErr && actual > 0){ + URLBuffer[actual] = '\0'; + NSString *urlString = [NSString stringWithUTF8String:(char*)URLBuffer]; + NSURL *fileURL = [NSURL URLWithString:urlString]; + Tcl_DString command; + Tcl_DStringInit(&command); + if (Tcl_FindCommand(_eventInterp, "::tk::mac::DoScriptFile", NULL, 0)){ + Tcl_DStringAppend(&command, "::tk::mac::DoScriptFile", -1); + } else { + Tcl_DStringAppend(&command, "source", -1); + } + Tcl_DStringAppendElement(&command, [[fileURL path] UTF8String]); + tclErr = Tcl_EvalEx(_eventInterp, Tcl_DStringValue(&command), + Tcl_DStringLength(&command), TCL_EVAL_GLOBAL); } - - if (ChkErr(FSRefToDString, &file, &pathName) == noErr) { - Tcl_DStringAppendElement(&command, Tcl_DStringValue(&pathName)); - Tcl_DStringFree(&pathName); + } else if (noErr == AEGetParamPtr(theDesc, keyDirectObject, typeUTF8Text, &type, + NULL, 0, &actual)) { + if (actual > 0) { + /* + * The descriptor can be coerced to UTF8 text. Evaluate as Tcl, or + * or pass the text as a string argument to ::tk::mac::DoScriptText + * if that procedure exists. + */ + char *data = ckalloc(actual + 1); + if (noErr == AEGetParamPtr(theDesc, keyDirectObject, typeUTF8Text, &type, + data, actual, NULL)) { + if (Tcl_FindCommand(_eventInterp, "::tk::mac::DoScriptText", NULL, 0)){ + Tcl_DString command; + Tcl_DStringInit(&command); + Tcl_DStringAppend(&command, "::tk::mac::DoScriptText", -1); + Tcl_DStringAppendElement(&command, data); + tclErr = Tcl_EvalEx(_eventInterp, Tcl_DStringValue(&command), + Tcl_DStringLength(&command), TCL_EVAL_GLOBAL); + } else { + tclErr = Tcl_EvalEx(_eventInterp, data, actual, TCL_EVAL_GLOBAL); + } + } + ckfree(data); + } + } else { + /* + * The descriptor can not be coerced to a fileURL or UTF8 text. + */ + for (int i = 0; i < 4; i++) { + typeString[i] = ((char*)&initialType)[3-i]; } + typeString[4] = '\0'; + sprintf(errString, "AEDoScriptHandler: invalid script type '%s', " + "must be coercable to 'furl' or 'utf8'", typeString); + AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyErrorString, typeChar, errString, + strlen(errString)); } - /* - * Now handle the event by evaluating a script. + * If we ran some Tcl code, put the result in the reply. */ - - code = Tcl_EvalEx(interp, Tcl_DStringValue(&command), - Tcl_DStringLength(&command), TCL_EVAL_GLOBAL); - if (code != TCL_OK) { - Tcl_BackgroundException(interp, code); + if (tclErr >= 0) { + int reslen; + const char *result = + Tcl_GetStringFromObj(Tcl_GetObjResult(_eventInterp), &reslen); + if (tclErr == TCL_OK) { + AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyDirectObject, typeChar, + result, reslen); + } else { + AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyErrorString, typeChar, + result, reslen); + AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyErrorNumber, typeSInt32, + (Ptr) &tclErr,sizeof(int)); + } } - Tcl_DStringFree(&command); - return noErr; + return; } - +@end + +#pragma mark - + /* *---------------------------------------------------------------------- * - * PrintHandler -- + * TkMacOSXProcessFiles -- * - * This is the 'pdoc' core Apple event handler. + * Extract a list of fileURLs from an AppleEvent and call the specified + * procedure with the file paths as arguments. * * Results: * None. * * Side effects: - * None. + * The event is handled by running the procedure. * *---------------------------------------------------------------------- */ -static OSErr -PrintHandler( - const AppleEvent * event, - AppleEvent * reply, - SRefCon handlerRefcon) +static void +tkMacOSXProcessFiles( + NSAppleEventDescriptor* event, + NSAppleEventDescriptor* replyEvent, + Tcl_Interp *interp, + char* procedure) { - Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; - AEDescList fileSpecList; - FSRef file; + Tcl_Encoding utf8 = Tcl_GetEncoding(NULL, "utf-8"); + const AEDesc *fileSpecDesc = nil; + AEDesc contents; + char URLString[1 + URL_MAX_LENGTH]; + NSURL *fileURL; DescType type; Size actual; long count, index; @@ -423,47 +292,67 @@ PrintHandler( int code; /* - * Don't bother if we don't have an interp or the print document procedure - * doesn't exist. + * Do nothing if we don't have an interpreter or the procedure doesn't exist. */ - if (!interp || - !Tcl_FindCommand(interp, "::tk::mac::PrintDocument", NULL, 0)) { - return noErr; + if (!interp || !Tcl_FindCommand(interp, procedure, NULL, 0)) { + return; } - + + fileSpecDesc = [event aeDesc]; + if (fileSpecDesc == nil ) { + return; + } + /* - * If we get any errors while retrieving our parameters we just return with - * no error. + * The AppleEvent's descriptor should either contain a value of + * typeObjectSpecifier or typeAEList. In the first case, the descriptor + * can be treated as a list of size 1 containing a value which can be + * coerced into a fileURL. In the second case we want to work with the list + * itself. Values in the list will be coerced into fileURL's if possible; + * otherwise they will be ignored. */ - - if (ChkErr(AEGetParamDesc, event, keyDirectObject, typeAEList, - &fileSpecList) != noErr) { - return noErr; - } - if (ChkErr(MissedAnyParameters, event) != noErr) { - return noErr; + + /* Get a copy of the AppleEvent's descriptor. */ + AEGetParamDesc(fileSpecDesc, keyDirectObject, typeWildCard, &contents); + if (contents.descriptorType == typeAEList) { + fileSpecDesc = &contents; } - if (ChkErr(AECountItems, &fileSpecList, &count) != noErr) { - return noErr; + + if (AECountItems(fileSpecDesc, &count) != noErr) { + AEDisposeDesc(&contents); + return; } - + + /* + * Construct a Tcl command which calls the procedure, passing the + * paths contained in the AppleEvent as arguments. + */ + Tcl_DStringInit(&command); - Tcl_DStringAppend(&command, "::tk::mac::PrintDocument", -1); + Tcl_DStringAppend(&command, procedure, -1); + for (index = 1; index <= count; index++) { - if (ChkErr(AEGetNthPtr, &fileSpecList, index, typeFSRef, &keyword, - &type, (Ptr) &file, sizeof(FSRef), &actual) != noErr) { + if (noErr != AEGetNthPtr(fileSpecDesc, index, typeFileURL, &keyword, + &type, (Ptr) URLString, URL_MAX_LENGTH, &actual)) { continue; } - - if (ChkErr(FSRefToDString, &file, &pathName) == noErr) { - Tcl_DStringAppendElement(&command, Tcl_DStringValue(&pathName)); - Tcl_DStringFree(&pathName); + if (type != typeFileURL) { + continue; + } + URLString[actual] = '\0'; + fileURL = [NSURL URLWithString:[NSString stringWithUTF8String:(char*)URLString]]; + if (fileURL == nil) { + continue; } + Tcl_ExternalToUtfDString(utf8, [[fileURL path] UTF8String], -1, &pathName); + Tcl_DStringAppendElement(&command, Tcl_DStringValue(&pathName)); + Tcl_DStringFree(&pathName); } + AEDisposeDesc(&contents); /* - * Now handle the event by evaluating a script. + * Handle the event by evaluating the Tcl expression we constructed. */ code = Tcl_EvalEx(interp, Tcl_DStringValue(&command), @@ -472,18 +361,19 @@ PrintHandler( Tcl_BackgroundException(interp, code); } Tcl_DStringFree(&command); - return noErr; + return; } /* *---------------------------------------------------------------------- * - * ScriptHandler -- + * TkMacOSXInitAppleEvents -- * - * This handler process the script event. + * Register AppleEvent handlers with the NSAppleEventManager for + * this NSApplication. * * Results: - * Schedules the given event to be processed. + * None. * * Side effects: * None. @@ -491,112 +381,91 @@ PrintHandler( *---------------------------------------------------------------------- */ -static OSErr -ScriptHandler( - const AppleEvent *event, - AppleEvent *reply, - SRefCon handlerRefcon) +void +TkMacOSXInitAppleEvents( + Tcl_Interp *interp) /* not used */ { - OSStatus theErr; - AEDescList theDesc; - Size size; - int tclErr = -1; - Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; - char errString[128]; + NSAppleEventManager *aeManager = [NSAppleEventManager sharedAppleEventManager]; + static Boolean initialized = FALSE; - /* - * The do script event receives one parameter that should be data or a - * file. - */ + if (!initialized) { + initialized = TRUE; - theErr = AEGetParamDesc(event, keyDirectObject, typeWildCard, - &theDesc); - if (theErr != noErr) { - sprintf(errString, "AEDoScriptHandler: GetParamDesc error %d", - (int)theErr); - theErr = AEPutParamPtr(reply, keyErrorString, typeChar, errString, - strlen(errString)); - } else if (MissedAnyParameters(event)) { - /* - * Return error if parameter is missing. - */ + [aeManager setEventHandler:NSApp + andSelector:@selector(handleQuitApplicationEvent:withReplyEvent:) + forEventClass:kCoreEventClass andEventID:kAEQuitApplication]; - sprintf(errString, "AEDoScriptHandler: extra parameters"); - AEPutParamPtr(reply, keyErrorString, typeChar, errString, - strlen(errString)); - theErr = -1771; - } else if (theDesc.descriptorType == (DescType) typeAlias && - AEGetParamPtr(event, keyDirectObject, typeFSRef, NULL, NULL, - 0, &size) == noErr && size == sizeof(FSRef)) { - /* - * We've had a file sent to us. Source it. - */ + [aeManager setEventHandler:NSApp + andSelector:@selector(handleOpenApplicationEvent:withReplyEvent:) + forEventClass:kCoreEventClass andEventID:kAEOpenApplication]; - FSRef file; - theErr = AEGetParamPtr(event, keyDirectObject, typeFSRef, NULL, &file, - size, NULL); - if (theErr == noErr) { - Tcl_DString scriptName; + [aeManager setEventHandler:NSApp + andSelector:@selector(handleReopenApplicationEvent:withReplyEvent:) + forEventClass:kCoreEventClass andEventID:kAEReopenApplication]; - theErr = FSRefToDString(&file, &scriptName); - if (theErr == noErr) { - Tcl_Obj *pathName = - Tcl_NewStringObj(Tcl_DStringValue(&scriptName), -1); - Tcl_DStringFree(&scriptName); + [aeManager setEventHandler:NSApp + andSelector:@selector(handleShowPreferencesEvent:withReplyEvent:) + forEventClass:kCoreEventClass andEventID:kAEShowPreferences]; - tclErr = Tcl_FSEvalFile(interp, pathName); - Tcl_DecrRefCount(pathName); - } else { - sprintf(errString, "AEDoScriptHandler: file not found"); - AEPutParamPtr(reply, keyErrorString, typeChar, errString, - strlen(errString)); - } - } - } else if (AEGetParamPtr(event, keyDirectObject, typeUTF8Text, NULL, NULL, - 0, &size) == noErr && size) { - /* - * We've had some data sent to us. Evaluate it. - */ + [aeManager setEventHandler:NSApp + andSelector:@selector(handleOpenDocumentsEvent:withReplyEvent:) + forEventClass:kCoreEventClass andEventID:kAEOpenDocuments]; - char *data = ckalloc(size + 1); - theErr = AEGetParamPtr(event, keyDirectObject, typeUTF8Text, NULL, data, - size, NULL); - if (theErr == noErr) { - tclErr = Tcl_EvalEx(interp, data, size, TCL_EVAL_GLOBAL); - } - } else { - /* - * Umm, don't recognize what we've got... - */ + [aeManager setEventHandler:NSApp + andSelector:@selector(handleOpenDocumentsEvent:withReplyEvent:) + forEventClass:kCoreEventClass andEventID:kAEPrintDocuments]; - sprintf(errString, "AEDoScriptHandler: invalid script type '%-4.4s', " - "must be 'alis' or coercable to 'utf8'", - (char*) &theDesc.descriptorType); - AEPutParamPtr(reply, keyErrorString, typeChar, errString, - strlen(errString)); - theErr = -1770; + [aeManager setEventHandler:NSApp + andSelector:@selector(handleDoScriptEvent:withReplyEvent:) + forEventClass:kAEMiscStandards andEventID:kAEDoScript]; } +} + +/* + *---------------------------------------------------------------------- + * + * TkMacOSXDoHLEvent -- + * + * Dispatch an AppleEvent. + * + * Results: + * None. + * + * Side effects: + * Depend on the AppleEvent. + * + *---------------------------------------------------------------------- + */ - /* - * If we actually go to run Tcl code - put the result in the reply. +int +TkMacOSXDoHLEvent( + void *theEvent) +{ + /* According to the NSAppleEventManager reference: + * "The theReply parameter always specifies a reply Apple event, never + * nil. However, the handler should not fill out the reply if the + * descriptor type for the reply event is typeNull, indicating the sender + * does not want a reply." + * The specified way to build such a non-nil descriptor is used here. But + * on OSX 10.11, the compiler nonetheless generates a warning. I am + * supressing the warning here -- maybe the warnings will stop in a future + * compiler release. */ +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnonnull" +#endif - if (tclErr >= 0) { - int reslen; - const char *result = - Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &reslen); + NSAppleEventDescriptor* theReply = [NSAppleEventDescriptor nullDescriptor]; + NSAppleEventManager *aeManager = [NSAppleEventManager sharedAppleEventManager]; - if (tclErr == TCL_OK) { - AEPutParamPtr(reply, keyDirectObject, typeChar, result, reslen); - } else { - AEPutParamPtr(reply, keyErrorString, typeChar, result, reslen); - AEPutParamPtr(reply, keyErrorNumber, typeSInt32, (Ptr) &tclErr, - sizeof(int)); - } - } + return [aeManager dispatchRawAppleEvent:(const AppleEvent*)theEvent + withRawReply: (AppleEvent *)theReply + handlerRefCon: (SRefCon)0]; - AEDisposeDesc(&theDesc); - return theErr; +#ifdef __clang__ +#pragma clang diagnostic pop +#endif } /* @@ -604,8 +473,8 @@ ScriptHandler( * * ReallyKillMe -- * - * This proc tries to kill the shell by running exit, called from an - * event scheduled by the "Quit" AppleEvent handler. + * This procedure tries to kill the shell by running exit, called from + * an event scheduled by the "Quit" AppleEvent handler. * * Results: * Runs the "exit" command which might kill the shell. @@ -665,37 +534,7 @@ MissedAnyParameters( return (err != errAEDescNotFound); } -/* - *---------------------------------------------------------------------- - * - * FSRefToDString -- - * - * Get a POSIX path from an FSRef. - * - * Results: - * In the parameter ds. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static OSStatus -FSRefToDString( - const FSRef *fsref, - Tcl_DString *ds) -{ - UInt8 fileName[PATH_MAX+1]; - OSStatus err; - err = ChkErr(FSRefMakePath, fsref, fileName, sizeof(fileName)); - if (err == noErr) { - Tcl_ExternalToUtfDString(NULL, (char*) fileName, -1, ds); - } - return err; -} - /* * Local Variables: * mode: objc diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index ed22640..0c078ce 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -792,7 +792,7 @@ TkpPostMenu( NSRect frame = NSMakeRect(x + 9, tkMacOSXZeroScreenHeight - y - 9, 1, 1); frame.origin = [view convertPoint: - [win convertScreenToBase:frame.origin] fromView:nil]; + [win convertPointFromScreen:frame.origin] fromView:nil]; NSMenu *menu = (NSMenu *) menuPtr->platformData; NSPopUpButtonCell *popUpButtonCell = [[NSPopUpButtonCell alloc] diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index 1fdbc52..c4197f7 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -26,49 +26,7 @@ typedef struct { static int GenerateButtonEvent(MouseEventData *medPtr); static unsigned int ButtonModifiers2State(UInt32 buttonState, - UInt32 keyModifiers); - -#pragma mark NSWindow(TKMouseEvent) - -/* Conversion of coordinates between window and screen */ -@interface NSWindow(TKWm) -- (NSPoint) convertPointToScreen:(NSPoint)point; -- (NSPoint) convertPointFromScreen:(NSPoint)point; -@end - -@implementation NSWindow(TKMouseEvent) -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 -- (NSPoint) convertPointToScreen: (NSPoint) point -{ - return [self convertBaseToScreen:point]; -} -- (NSPoint) convertPointFromScreen: (NSPoint)point -{ - return [self convertScreenToBase:point]; -} -@end -#else -- (NSPoint) convertPointToScreen: (NSPoint) point -{ - NSRect pointrect; - pointrect.origin = point; - pointrect.size.width = 0; - pointrect.size.height = 0; - return [self convertRectToScreen:pointrect].origin; -} -- (NSPoint) convertPointFromScreen: (NSPoint)point -{ - NSRect pointrect; - pointrect.origin = point; - pointrect.size.width = 0; - pointrect.size.height = 0; - return [self convertRectFromScreen:pointrect].origin; -} -@end -#endif - -#pragma mark - - + UInt32 keyModifiers); #pragma mark TKApplication(TKMouseEvent) @@ -77,14 +35,12 @@ enum { }; /* * In OS X 10.6 an NSEvent of type NSMouseMoved would always have a non-Nil - * window attribute when the mouse was inside a window. As of 10.8 this - * behavior had changed. The new behavior was that if the mouse were ever - * moved outside of a window, all subsequent NSMouseMoved NSEvents would have a - * Nil window attribute. To work around this we remember which window the - * mouse is in by saving the window attribute of each NSEvent of type - * NSMouseEntered. If an NSEvent has a Nil window attribute we use our saved - * window. It may be the case that the mouse has actually left the window, but - * this is harmless since Tk will ignore the event in that case. + * window attribute pointing to the active window. As of 10.8 this behavior + * had changed. The new behavior was that if the mouse were ever moved outside + * of a window, all subsequent NSMouseMoved NSEvents would have a Nil window + * attribute. To work around this the TKApplication remembers the last non-Nil + * window that it received in a mouse event. If it receives an NSEvent with a + * Nil window attribute then the saved window is used. */ @implementation TKApplication(TKMouseEvent) @@ -93,24 +49,14 @@ enum { #ifdef TK_MAC_DEBUG_EVENTS TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent); #endif - id win; - NSEventType type = [theEvent type]; + NSWindow* eventWindow = [theEvent window]; + NSEventType eventType = [theEvent type]; #if 0 NSTrackingArea *trackingArea = nil; NSInteger eventNumber, clickCount, buttonNumber; #endif - - switch (type) { + switch (eventType) { case NSMouseEntered: - /* Remember which window has the mouse. */ - if (_windowWithMouse) { - [_windowWithMouse release]; - } - _windowWithMouse = [theEvent window]; - if (_windowWithMouse) { - [_windowWithMouse retain]; - } - break; case NSMouseExited: case NSCursorUpdate: case NSLeftMouseDown: @@ -127,25 +73,31 @@ enum { case NSTabletProximity: case NSScrollWheel: break; - default: /* Unrecognized mouse event. */ return theEvent; } + /* Remember the window in case we need it next time. */ + if (eventWindow && eventWindow != _windowWithMouse) { + if (_windowWithMouse) { + [_windowWithMouse release]; + } + _windowWithMouse = eventWindow; + [_windowWithMouse retain]; + } + /* Create an Xevent to add to the Tk queue. */ - win = [theEvent window]; - NSWindow *nswindow = (NSWindow *)win; NSPoint global, local = [theEvent locationInWindow]; - if (win) { /* local will be in window coordinates. */ - global = [nswindow convertPointToScreen: local]; - local.y = [win frame].size.height - local.y; + if (eventWindow) { /* local will be in window coordinates. */ + global = [eventWindow convertPointToScreen: local]; + local.y = [eventWindow frame].size.height - local.y; global.y = tkMacOSXZeroScreenHeight - global.y; } else { /* local will be in screen coordinates. */ if (_windowWithMouse ) { - win = _windowWithMouse; + eventWindow = _windowWithMouse; global = local; - local = [nswindow convertPointFromScreen: local]; - local.y = [win frame].size.height - local.y; + local = [eventWindow convertPointFromScreen: local]; + local.y = [eventWindow frame].size.height - local.y; global.y = tkMacOSXZeroScreenHeight - global.y; } else { /* We have no window. Use the screen???*/ local.y = tkMacOSXZeroScreenHeight - local.y; @@ -153,7 +105,7 @@ enum { } } - Window window = TkMacOSXGetXWindow(win); + Window window = TkMacOSXGetXWindow(eventWindow); Tk_Window tkwin = window ? Tk_IdToWindow(TkGetDisplayList()->display, window) : NULL; if (!tkwin) { @@ -181,7 +133,7 @@ enum { if (err == noErr) { state |= (buttons & ((1<<5) - 1)) << 8; } else if (button < 5) { - switch (type) { + switch (eventType) { case NSLeftMouseDown: case NSRightMouseDown: case NSLeftMouseDragged: @@ -218,12 +170,12 @@ enum { state |= Mod4Mask; } - if (type != NSScrollWheel) { + if (eventType != NSScrollWheel) { #ifdef TK_MAC_DEBUG_EVENTS TKLog(@"UpdatePointer %p x %f.0 y %f.0 %d", tkwin, global.x, global.y, state); #endif Tk_UpdatePointer(tkwin, global.x, global.y, state); - } else { + } else { /* handle scroll wheel event */ CGFloat delta; int coarseDelta; XEvent xEvent; @@ -239,7 +191,8 @@ enum { delta = [theEvent deltaY]; if (delta != 0.0) { - coarseDelta = (delta > -1.0 && delta < 1.0) ? (signbit(delta) ? -1 : 1) : lround(delta); + coarseDelta = (delta > -1.0 && delta < 1.0) ? + (signbit(delta) ? -1 : 1) : lround(delta); xEvent.xbutton.state = state; xEvent.xkey.keycode = coarseDelta; xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); @@ -247,7 +200,8 @@ enum { } delta = [theEvent deltaX]; if (delta != 0.0) { - coarseDelta = (delta > -1.0 && delta < 1.0) ? (signbit(delta) ? -1 : 1) : lround(delta); + coarseDelta = (delta > -1.0 && delta < 1.0) ? + (signbit(delta) ? -1 : 1) : lround(delta); xEvent.xbutton.state = state | ShiftMask; xEvent.xkey.keycode = coarseDelta; xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); @@ -418,7 +372,7 @@ XQueryPointer( if (win) { NSPoint local; - local = [win convertScreenToBase:global]; + local = [win convertPointFromScreen:global]; local.y = [win frame].size.height - local.y; if (macWin->winPtr && macWin->winPtr->wmInfoPtr) { local.x -= macWin->winPtr->wmInfoPtr->xInParent; @@ -516,7 +470,7 @@ TkGenerateButtonEvent( if (win) { NSPoint local = NSMakePoint(x, tkMacOSXZeroScreenHeight - y); - local = [win convertScreenToBase:local]; + local = [win convertPointFromScreen:local]; local.y = [win frame].size.height - local.y; if (macWin->winPtr && macWin->winPtr->wmInfoPtr) { local.x -= macWin->winPtr->wmInfoPtr->xInParent; diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 9cdc27c..d0a52ee 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -296,6 +296,24 @@ VISIBILITY_HIDDEN - (void)tkProvidePasteboard:(TkDisplay *)dispPtr; - (void)tkCheckPasteboard; @end +@interface TKApplication(TKHLEvents) +- (void) terminate: (id) sender; +- (void) preferences: (id) sender; +- (void) handleQuitApplicationEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent; +- (void) handleOpenApplicationEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent; +- (void) handleReopenApplicationEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent; +- (void) handleShowPreferencesEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent; +- (void) handleOpenDocumentsEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent; +- (void) handlePrintDocumentsEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent; +- (void) handleDoScriptEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent; +@end VISIBILITY_HIDDEN @interface TKContentView : NSView { @@ -329,6 +347,11 @@ VISIBILITY_HIDDEN @interface TKWindow : NSWindow @end +@interface NSWindow(TKWm) +- (NSPoint) convertPointToScreen:(NSPoint)point; +- (NSPoint) convertPointFromScreen:(NSPoint)point; +@end + #pragma mark NSMenu & NSMenuItem Utilities @interface NSMenu(TKUtils) @@ -357,8 +380,4 @@ VISIBILITY_HIDDEN keyEquivalentModifierMask:(NSUInteger)keyEquivalentModifierMask; @end -/* Helper functions from tkMacOSXDeprecations.c */ - -extern NSPoint convertWindowToScreen( NSWindow *window, NSPoint point); - #endif /* _TKMACPRIV */ diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 7f1cf90..851358d 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -745,15 +745,16 @@ TkWmProtocolEventProc( int Tk_MacOSXIsAppInFront(void) { - OSStatus err; - ProcessSerialNumber frontPsn, ourPsn = {0, kCurrentProcess}; Boolean isFrontProcess = true; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + ProcessSerialNumber frontPsn, ourPsn = {0, kCurrentProcess}; - err = ChkErr(GetFrontProcess, &frontPsn); - if (err == noErr) { - ChkErr(SameProcess, &frontPsn, &ourPsn, &isFrontProcess); + if (noErr == GetFrontProcess(&frontPsn)){ + SameProcess(&frontPsn, &ourPsn, &isFrontProcess); } - +#else + isFrontProcess = [NSRunningApplication currentApplication].active; +#endif return (isFrontProcess == true); } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 417f130..fb58904 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -196,6 +196,48 @@ static int tkMacOSXWmAttrNotifyVal = 0; static Tcl_HashTable windowTable; static int windowHashInit = false; + + +#pragma mark NSWindow(TKWm) + +/* + * Conversion of coordinates between window and screen. + */ + +@implementation NSWindow(TKWm) +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 +- (NSPoint) convertPointToScreen: (NSPoint) point +{ + return [self convertBaseToScreen:point]; +} +- (NSPoint) convertPointFromScreen: (NSPoint)point +{ + return [self convertScreenToBase:point]; +} +@end +#else +- (NSPoint) convertPointToScreen: (NSPoint) point +{ + NSRect pointrect; + pointrect.origin = point; + pointrect.size.width = 0; + pointrect.size.height = 0; + return [self convertRectToScreen:pointrect].origin; +} +- (NSPoint) convertPointFromScreen: (NSPoint)point +{ + NSRect pointrect; + pointrect.origin = point; + pointrect.size.width = 0; + pointrect.size.height = 0; + return [self convertRectFromScreen:pointrect].origin; +} +@end +#endif + +#pragma mark - + + /* * Forward declarations for procedures defined in this file: */ diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index a5f1c60..e87bb39 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -181,7 +181,21 @@ TkpOpenDisplay( NSAppKitVersionNumber); } display->vendor = vendor; - Gestalt(gestaltSystemVersion, (SInt32 *) &display->release); + { + int major, minor, patch; + +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 + Gestalt(gestaltSystemVersionMajor, (SInt32*)&major); + Gestalt(gestaltSystemVersionMinor, (SInt32*)&minor); + Gestalt(gestaltSystemVersionBugFix, (SInt32*)&patch); +#else + NSOperatingSystemVersion systemVersion = [[NSProcessInfo processInfo] operatingSystemVersion]; + major = systemVersion.majorVersion; + minor = systemVersion.minorVersion; + patch = systemVersion.patchVersion; +#endif + display->release = major << 16 | minor << 8 | patch; + } /* * These screen bits never change -- cgit v0.12 -- cgit v0.12 From 44411926e57b5c15f9910dcdcde14c666571645e Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Wed, 25 Nov 2015 03:19:19 +0000 Subject: Remove multiple deprecated internal API calls on OS X; streamline Apple Events implementation; thanks to Marc Culler for extensive patches --- generic/tkImgPhoto.c | 6 +- macosx/tkMacOSXDialog.c | 386 ++++++++++++++-------- macosx/tkMacOSXDraw.c | 2 +- macosx/tkMacOSXFont.c | 18 +- macosx/tkMacOSXHLEvents.c | 756 +++++++++++++++++-------------------------- macosx/tkMacOSXMenu.c | 2 +- macosx/tkMacOSXMouseEvent.c | 107 +++--- macosx/tkMacOSXPrivate.h | 28 +- macosx/tkMacOSXWindowEvent.c | 13 +- macosx/tkMacOSXWm.c | 42 +++ macosx/tkMacOSXXStubs.c | 16 +- 11 files changed, 685 insertions(+), 691 deletions(-) diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 780b0c2..47aa523 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -2454,7 +2454,11 @@ ImgPhotoGet( } XFree((char *) visInfoPtr); - sprintf(buf, ((mono) ? "%d": "%d/%d/%d"), nRed, nGreen, nBlue); + if (mono) { + sprintf(buf, "%d", nRed); + } else { + sprintf(buf, "%d/%d/%d", nRed, nGreen, nBlue); + } instancePtr->defaultPalette = Tk_GetUid(buf); /* diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index b5ff48b..9cd9cf3 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -7,24 +7,34 @@ * Copyright 2001-2009, Apple Inc. * Copyright (c) 2006-2009 Daniel A. Steffen * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - */ + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. + */ #include "tkMacOSXPrivate.h" #include "tkFileFilter.h" +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090 +#define modalOK NSOKButton +#define modalCancel NSCancelButton +#else +#define modalOK NSModalResponseOK +#define modalCancel NSModalResponseCancel +#endif +#define modalOther -1 +#define modalError -2 + static int TkBackgroundEvalObjv(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv, int flags); -static const char *colorOptionStrings[] = { +static const char *const colorOptionStrings[] = { "-initialcolor", "-parent", "-title", NULL }; enum colorOptions { COLOR_INITIAL, COLOR_PARENT, COLOR_TITLE }; -static const char *openOptionStrings[] = { +static const char *const openOptionStrings[] = { "-defaultextension", "-filetypes", "-initialdir", "-initialfile", "-message", "-multiple", "-parent", "-title", "-typevariable", "-command", NULL @@ -34,7 +44,7 @@ enum openOptions { OPEN_MESSAGE, OPEN_MULTIPLE, OPEN_PARENT, OPEN_TITLE, OPEN_TYPEVARIABLE, OPEN_COMMAND, }; -static const char *saveOptionStrings[] = { +static const char *const saveOptionStrings[] = { "-defaultextension", "-filetypes", "-initialdir", "-initialfile", "-message", "-parent", "-title", "-typevariable", "-command", "-confirmoverwrite", NULL @@ -44,7 +54,7 @@ enum saveOptions { SAVE_MESSAGE, SAVE_PARENT, SAVE_TITLE, SAVE_TYPEVARIABLE, SAVE_COMMAND, SAVE_CONFIRMOW }; -static const char *chooseOptionStrings[] = { +static const char *const chooseOptionStrings[] = { "-initialdir", "-message", "-mustexist", "-parent", "-title", "-command", NULL }; @@ -58,7 +68,7 @@ typedef struct { int multiple; } FilePanelCallbackInfo; -static const char *alertOptionStrings[] = { +static const char *const alertOptionStrings[] = { "-default", "-detail", "-icon", "-message", "-parent", "-title", "-type", "-command", NULL }; @@ -71,7 +81,7 @@ typedef struct { Tcl_Obj *cmdObj; int typeIndex; } AlertCallbackInfo; -static const char *alertTypeStrings[] = { +static const char *const alertTypeStrings[] = { "abortretryignore", "ok", "okcancel", "retrycancel", "yesno", "yesnocancel", NULL }; @@ -79,13 +89,13 @@ enum alertTypeOptions { TYPE_ABORTRETRYIGNORE, TYPE_OK, TYPE_OKCANCEL, TYPE_RETRYCANCEL, TYPE_YESNO, TYPE_YESNOCANCEL }; -static const char *alertIconStrings[] = { +static const char *const alertIconStrings[] = { "error", "info", "question", "warning", NULL }; enum alertIconOptions { ICON_ERROR, ICON_INFO, ICON_QUESTION, ICON_WARNING }; -static const char *alertButtonStrings[] = { +static const char *const alertButtonStrings[] = { "abort", "retry", "ignore", "ok", "cancel", "yes", "no", NULL }; @@ -105,9 +115,9 @@ static const NSAlertStyle alertStyles[] = { }; /* - * Need to map from 'alertButtonStrings' and its corresponding integer, - * index to the native button index, which is 1, 2, 3, from right to left. - * This is necessary to do for each separate '-type' of button sets. + * Need to map from 'alertButtonStrings' and its corresponding integer, index + * to the native button index, which is 1, 2, 3, from right to left. This is + * necessary to do for each separate '-type' of button sets. */ static const short alertButtonIndexAndTypeToNativeButtonIndex[][7] = { @@ -134,27 +144,47 @@ static const short alertNativeButtonIndexAndTypeToButtonIndex[][3] = { [TYPE_YESNOCANCEL] = {5, 6, 4}, }; +/* + * Construct a file URL from directory and filename. Either may + * be nil. If both are nil, returns nil. + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED > 1050 +static NSURL *getFileURL(NSString *directory, NSString *filename) { + NSURL *url = nil; + if (directory) { + url = [NSURL fileURLWithPath:directory]; + } + if (filename) { + url = [NSURL URLWithString:filename relativeToURL:url]; + } + return url; +} +#endif + #pragma mark TKApplication(TKDialog) @interface NSColorPanel(TKDialog) -- (void)_setUseModalAppearance:(BOOL)flag; +- (void) _setUseModalAppearance: (BOOL) flag; @end @implementation TKApplication(TKDialog) -- (void)tkFilePanelDidEnd:(NSSavePanel *)panel returnCode:(NSInteger)returnCode - contextInfo:(void *)contextInfo { + +- (void) tkFilePanelDidEnd: (NSSavePanel *) panel + returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo +{ FilePanelCallbackInfo *callbackInfo = contextInfo; if (returnCode == NSFileHandlingPanelOKButton) { Tcl_Obj *resultObj; + if (callbackInfo->multiple) { resultObj = Tcl_NewListObj(0, NULL); - for (NSString *name in [(NSOpenPanel*)panel filenames]) { + for (NSURL *url in [(NSOpenPanel*)panel URLs]) { Tcl_ListObjAppendElement(callbackInfo->interp, resultObj, - Tcl_NewStringObj([name UTF8String], -1)); + Tcl_NewStringObj([[url path] UTF8String], -1)); } } else { - resultObj = Tcl_NewStringObj([[panel filename] UTF8String], -1); + resultObj = Tcl_NewStringObj([[[panel URL]path] UTF8String], -1); } if (callbackInfo->cmdObj) { Tcl_Obj **objv, **tmpv; @@ -179,14 +209,14 @@ static const short alertNativeButtonIndexAndTypeToButtonIndex[][3] = { } if (callbackInfo->cmdObj) { Tcl_DecrRefCount(callbackInfo->cmdObj); - ckfree((char*) callbackInfo); + ckfree((char *)callbackInfo); } } - (void)tkAlertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo { AlertCallbackInfo *callbackInfo = contextInfo; - if (returnCode != NSAlertErrorReturn) { + if (returnCode >= NSAlertFirstButtonReturn) { Tcl_Obj *resultObj = Tcl_NewStringObj(alertButtonStrings[ alertNativeButtonIndexAndTypeToButtonIndex[callbackInfo-> typeIndex][returnCode - NSAlertFirstButtonReturn]], -1); @@ -211,7 +241,7 @@ static const short alertNativeButtonIndexAndTypeToButtonIndex[][3] = { } if (callbackInfo->cmdObj) { Tcl_DecrRefCount(callbackInfo->cmdObj); - ckfree((char*) callbackInfo); + ckfree((char *) callbackInfo); } } @end @@ -252,43 +282,41 @@ Tk_ChooseColorObjCmd( for (i = 1; i < objc; i += 2) { int index; - const char *option, *value; + const char *value; - if (Tcl_GetIndexFromObj(interp, objv[i], colorOptionStrings, "option", - TCL_EXACT, &index) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[i], colorOptionStrings, + sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) { goto end; } if (i + 1 == objc) { - option = Tcl_GetString(objv[i]); - Tcl_AppendResult(interp, "value for \"", option, "\" missing", - NULL); + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "value for \"%s\" missing", Tcl_GetString(objv[i]))); + Tcl_SetErrorCode(interp, "TK", "COLORDIALOG", "VALUE", NULL); goto end; } value = Tcl_GetString(objv[i + 1]); switch (index) { - case COLOR_INITIAL: { - XColor *colorPtr; + case COLOR_INITIAL: { + XColor *colorPtr; - colorPtr = Tk_GetColor(interp, tkwin, value); - if (colorPtr == NULL) { - goto end; - } - initialColor = TkMacOSXGetNSColor(NULL, colorPtr->pixel); - Tk_FreeColor(colorPtr); - break; - } - case COLOR_PARENT: { - parent = Tk_NameToWindow(interp, value, tkwin); - if (parent == NULL) { - goto end; - } - break; + colorPtr = Tk_GetColor(interp, tkwin, value); + if (colorPtr == NULL) { + goto end; } - case COLOR_TITLE: { - title = value; - break; + initialColor = TkMacOSXGetNSColor(NULL, colorPtr->pixel); + Tk_FreeColor(colorPtr); + break; + } + case COLOR_PARENT: + parent = Tk_NameToWindow(interp, value, tkwin); + if (parent == NULL) { + goto end; } + break; + case COLOR_TITLE: + title = value; + break; } } colorPanel = [NSColorPanel sharedColorPanel]; @@ -306,7 +334,7 @@ Tk_ChooseColorObjCmd( [colorPanel setColor:initialColor]; } returnCode = [NSApp runModalForWindow:colorPanel]; - if (returnCode == NSOKButton) { + if (returnCode == modalOK) { color = [[colorPanel color] colorUsingColorSpace: [NSColorSpace genericRGBColorSpace]]; numberOfComponents = [color numberOfComponents]; @@ -325,6 +353,7 @@ Tk_ChooseColorObjCmd( Tcl_ResetResult(interp); } result = TCL_OK; + end: return result; } @@ -365,17 +394,18 @@ Tk_GetOpenFileObjCmd( NSWindow *parent; NSMutableArray *fileTypes = nil; NSOpenPanel *panel = [NSOpenPanel openPanel]; - NSInteger returnCode = NSAlertErrorReturn; + NSInteger modalReturnCode = modalError; TkInitFileFilters(&fl); for (i = 1; i < objc; i += 2) { - if (Tcl_GetIndexFromObj(interp, objv[i], openOptionStrings, "option", - TCL_EXACT, &index) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[i], openOptionStrings, + sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) { goto end; } if (i + 1 == objc) { - str = Tcl_GetString(objv[i]); - Tcl_AppendResult(interp, "value for \"", str, "\" missing", NULL); + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "value for \"%s\" missing", Tcl_GetString(objv[i]))); + Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "VALUE", NULL); goto end; } switch (index) { @@ -434,6 +464,7 @@ Tk_GetOpenFileObjCmd( break; } } + [panel setAllowsMultipleSelection:multiple]; if (fl.filters) { fileTypes = [NSMutableArray array]; for (FileFilter *filterPtr = fl.filters; filterPtr; @@ -466,10 +497,9 @@ Tk_GetOpenFileObjCmd( } } } - [panel setAllowsMultipleSelection:multiple]; + [panel setAllowedFileTypes:fileTypes]; if (cmdObj) { - callbackInfo = (FilePanelCallbackInfo *) - ckalloc(sizeof(FilePanelCallbackInfo)); + callbackInfo = (FilePanelCallbackInfo *)ckalloc(sizeof(FilePanelCallbackInfo)); if (Tcl_IsShared(cmdObj)) { cmdObj = Tcl_DuplicateObj(cmdObj); } @@ -480,28 +510,47 @@ Tk_GetOpenFileObjCmd( callbackInfo->multiple = multiple; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { - [panel beginSheetForDirectory:directory file:filename types:fileTypes - modalForWindow:parent modalDelegate:NSApp didEndSelector: - @selector(tkFilePanelDidEnd:returnCode:contextInfo:) - contextInfo:callbackInfo]; - returnCode = cmdObj ? NSAlertOtherReturn : - [NSApp runModalForWindow:panel]; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + [panel beginSheetForDirectory:directory + file:filename + types:fileTypes + modalForWindow:parent + modalDelegate:NSApp + didEndSelector: + @selector(tkFilePanelDidEnd:returnCode:contextInfo:) + contextInfo:callbackInfo]; +#else + [panel setAllowedFileTypes:fileTypes]; + [panel setDirectoryURL:getFileURL(directory, filename)]; + [panel beginSheetModalForWindow:parent + completionHandler:^(NSInteger returnCode) + { [NSApp tkFilePanelDidEnd:panel + returnCode:returnCode + contextInfo:callbackInfo ]; } ]; +#endif + modalReturnCode = cmdObj ? modalOther : [NSApp runModalForWindow:panel]; } else { - returnCode = [panel runModalForDirectory:directory file:filename - types:fileTypes]; - [NSApp tkFilePanelDidEnd:panel returnCode:returnCode +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + modalReturnCode = [panel runModalForDirectory:directory + file:filename]; +#else + [panel setDirectoryURL:getFileURL(directory, filename)]; + modalReturnCode = [panel runModal]; +#endif + [NSApp tkFilePanelDidEnd:panel returnCode:modalReturnCode contextInfo:callbackInfo]; } - result = (returnCode != NSAlertErrorReturn) ? TCL_OK : TCL_ERROR; + result = (modalReturnCode != modalError) ? TCL_OK : TCL_ERROR; if (typeVariablePtr && result == TCL_OK) { /* * The -typevariable option is not really supported. */ - Tcl_SetVar(interp, Tcl_GetString(typeVariablePtr), "", - TCL_GLOBAL_ONLY); + Tcl_SetVar2(interp, Tcl_GetString(typeVariablePtr), NULL, + "", TCL_GLOBAL_ONLY); } -end: + + end: TkFreeFileFilters(&fl); return result; } @@ -543,18 +592,18 @@ Tk_GetSaveFileObjCmd( NSWindow *parent; NSMutableArray *fileTypes = nil; NSSavePanel *panel = [NSSavePanel savePanel]; - NSInteger returnCode = NSAlertErrorReturn; + NSInteger modalReturnCode = modalError; TkInitFileFilters(&fl); for (i = 1; i < objc; i += 2) { - if (Tcl_GetIndexFromObj(interp, objv[i], saveOptionStrings, "option", - TCL_EXACT, &index) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[i], saveOptionStrings, + sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) { goto end; } if (i + 1 == objc) { - str = Tcl_GetString(objv[i]); - Tcl_AppendResult(interp, "value for \"", str, "\" missing", - NULL); + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "value for \"%s\" missing", Tcl_GetString(objv[i]))); + Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "VALUE", NULL); goto end; } switch (index) { @@ -614,7 +663,7 @@ Tk_GetSaveFileObjCmd( break; case SAVE_CONFIRMOW: if (Tcl_GetBooleanFromObj(interp, objv[i + 1], - &confirmOverwrite) != TCL_OK) { + &confirmOverwrite) != TCL_OK) { goto end; } break; @@ -649,8 +698,7 @@ Tk_GetSaveFileObjCmd( [panel setCanSelectHiddenExtension:YES]; [panel setExtensionHidden:NO]; if (cmdObj) { - callbackInfo = (FilePanelCallbackInfo *) - ckalloc(sizeof(FilePanelCallbackInfo)); + callbackInfo = (FilePanelCallbackInfo *)ckalloc(sizeof(FilePanelCallbackInfo)); if (Tcl_IsShared(cmdObj)) { cmdObj = Tcl_DuplicateObj(cmdObj); } @@ -661,19 +709,36 @@ Tk_GetSaveFileObjCmd( callbackInfo->multiple = 0; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { - [panel beginSheetForDirectory:directory file:filename - modalForWindow:parent modalDelegate:NSApp didEndSelector: - @selector(tkFilePanelDidEnd:returnCode:contextInfo:) - contextInfo:callbackInfo]; - returnCode = cmdObj ? NSAlertOtherReturn : - [NSApp runModalForWindow:panel]; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + [panel beginSheetForDirectory:directory + file:filename + modalForWindow:parent + modalDelegate:NSApp + didEndSelector: + @selector(tkFilePanelDidEnd:returnCode:contextInfo:) + contextInfo:callbackInfo]; +#else + [panel setDirectoryURL:getFileURL(directory, filename)]; + [panel beginSheetModalForWindow:parent + completionHandler:^(NSInteger returnCode) + { [NSApp tkFilePanelDidEnd:panel + returnCode:returnCode + contextInfo:callbackInfo ]; } ]; +#endif + modalReturnCode = cmdObj ? modalOther : [NSApp runModalForWindow:panel]; } else { - returnCode = [panel runModalForDirectory:directory file:filename]; - [NSApp tkFilePanelDidEnd:panel returnCode:returnCode +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + modalReturnCode = [panel runModalForDirectory:directory file:filename]; +#else + [panel setDirectoryURL:getFileURL(directory, filename)]; + modalReturnCode = [panel runModal]; +#endif + [NSApp tkFilePanelDidEnd:panel returnCode:modalReturnCode contextInfo:callbackInfo]; } - result = (returnCode != NSAlertErrorReturn) ? TCL_OK : TCL_ERROR; -end: + result = (modalReturnCode != modalError) ? TCL_OK : TCL_ERROR; + + end: TkFreeFileFilters(&fl); return result; } @@ -714,16 +779,17 @@ Tk_ChooseDirectoryObjCmd( NSString *message, *title; NSWindow *parent; NSOpenPanel *panel = [NSOpenPanel openPanel]; - NSInteger returnCode = NSAlertErrorReturn; + NSInteger modalReturnCode = modalError; for (i = 1; i < objc; i += 2) { - if (Tcl_GetIndexFromObj(interp, objv[i], chooseOptionStrings, "option", - TCL_EXACT, &index) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[i], chooseOptionStrings, + sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) { goto end; } if (i + 1 == objc) { - str = Tcl_GetString(objv[i]); - Tcl_AppendResult(interp, "value for \"", str, "\" missing", NULL); + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "value for \"%s\" missing", Tcl_GetString(objv[i]))); + Tcl_SetErrorCode(interp, "TK", "DIRDIALOG", "VALUE", NULL); goto end; } switch (index) { @@ -770,8 +836,7 @@ Tk_ChooseDirectoryObjCmd( [panel setCanChooseDirectories:YES]; [panel setCanCreateDirectories:!mustexist]; if (cmdObj) { - callbackInfo = (FilePanelCallbackInfo *) - ckalloc(sizeof(FilePanelCallbackInfo)); + callbackInfo = (FilePanelCallbackInfo *)ckalloc(sizeof(FilePanelCallbackInfo)); if (Tcl_IsShared(cmdObj)) { cmdObj = Tcl_DuplicateObj(cmdObj); } @@ -782,19 +847,35 @@ Tk_ChooseDirectoryObjCmd( callbackInfo->multiple = 0; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { - [panel beginSheetForDirectory:directory file:filename - modalForWindow:parent modalDelegate:NSApp didEndSelector: - @selector(tkFilePanelDidEnd:returnCode:contextInfo:) +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + [panel beginSheetForDirectory:directory + file:filename + modalForWindow:parent + modalDelegate:NSApp + didEndSelector: @selector(tkFilePanelDidEnd:returnCode:contextInfo:) contextInfo:callbackInfo]; - returnCode = cmdObj ? NSAlertOtherReturn : - [NSApp runModalForWindow:panel]; +#else + [panel setDirectoryURL:getFileURL(directory, filename)]; + [panel beginSheetModalForWindow:parent + completionHandler:^(NSInteger returnCode) + { [NSApp tkFilePanelDidEnd:panel + returnCode:returnCode + contextInfo:callbackInfo ]; } ]; +#endif + modalReturnCode = cmdObj ? modalOther : [NSApp runModalForWindow:panel]; } else { - returnCode = [panel runModalForDirectory:directory file:filename]; - [NSApp tkFilePanelDidEnd:panel returnCode:returnCode +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + modalReturnCode = [panel runModalForDirectory:directory file:nil]; +#else + [panel setDirectoryURL:getFileURL(directory, filename)]; + modalReturnCode = [panel runModal]; +#endif + [NSApp tkFilePanelDidEnd:panel returnCode:modalReturnCode contextInfo:callbackInfo]; } - result = (returnCode != NSAlertErrorReturn) ? TCL_OK : TCL_ERROR; -end: + result = (modalReturnCode != modalError) ? TCL_OK : TCL_ERROR; + + end: return result; } @@ -818,20 +899,29 @@ void TkAboutDlg(void) { NSImage *image; - NSString *path = [NSApp tkFrameworkImagePath:@"Tk.tiff"]; + NSString *path = [NSApp tkFrameworkImagePath: @"Tk.tiff"]; + if (path) { image = [[[NSImage alloc] initWithContentsOfFile:path] autorelease]; } else { image = [NSApp applicationIconImage]; } + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4]; [dateFormatter setDateFormat:@"Y"]; + NSString *year = [dateFormatter stringFromDate:[NSDate date]]; + [dateFormatter release]; - NSMutableParagraphStyle *style = [[[NSParagraphStyle defaultParagraphStyle] - mutableCopy] autorelease]; + + NSMutableParagraphStyle *style = + [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] + autorelease]; + [style setAlignment:NSCenterTextAlignment]; + NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: @"Tcl & Tk", @"ApplicationName", @"Tcl " TCL_VERSION " & Tk " TK_VERSION, @"ApplicationVersion", @@ -842,15 +932,15 @@ TkAboutDlg(void) [[[NSAttributedString alloc] initWithString: [NSString stringWithFormat: @"%1$C 1987-%2$@ Tcl Core Team." "\n\n" - "%1$C 1989-%2$@ Contributors." "\n\n" + "%1$C 1989-%2$@ Contributors." "\n\n" "%1$C 2011-%2$@ Kevin Walzer/WordTech Communications LLC." "\n\n" "%1$C 2014-%2$@ Marc Culler." "\n\n" - "%1$C 2002-%2$@ Daniel A. Steffen." "\n\n" - "%1$C 2001-2009 Apple Inc." "\n\n" - "%1$C 2001-2002 Jim Ingham & Ian Reid" "\n\n" - "%1$C 1998-2000 Jim Ingham & Ray Johnson" "\n\n" - "%1$C 1998-2000 Scriptics Inc." "\n\n" - "%1$C 1996-1997 Sun Microsystems Inc.", 0xA9, year] attributes: + "%1$C 2002-%2$@ Daniel A. Steffen." "\n\n" + "%1$C 2001-2009 Apple Inc." "\n\n" + "%1$C 2001-2002 Jim Ingham & Ian Reid" "\n\n" + "%1$C 1998-2000 Jim Ingham & Ray Johnson" "\n\n" + "%1$C 1998-2000 Scriptics Inc." "\n\n" + "%1$C 1996-1997 Sun Microsystems Inc.", 0xA9, year] attributes: [NSDictionary dictionaryWithObject:style forKey:NSParagraphStyleAttributeName]] autorelease], @"Credits", nil]; @@ -884,7 +974,7 @@ TkMacOSXStandardAboutPanelObjCmd( Tcl_WrongNumArgs(interp, 1, objv, NULL); return TCL_ERROR; } - [NSApp orderFrontStandardAboutPanelWithOptions:nil]; + [NSApp orderFrontStandardAboutPanelWithOptions:[NSDictionary dictionary]]; return TCL_OK; } @@ -922,18 +1012,19 @@ Tk_MessageBoxObjCmd( NSWindow *parent; NSArray *buttons; NSAlert *alert = [NSAlert new]; - NSInteger returnCode = NSAlertErrorReturn; + NSInteger modalReturnCode = 1; iconIndex = ICON_INFO; typeIndex = TYPE_OK; for (i = 1; i < objc; i += 2) { - if (Tcl_GetIndexFromObj(interp, objv[i], alertOptionStrings, "option", - TCL_EXACT, &index) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[i], alertOptionStrings, + sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) { goto end; } if (i + 1 == objc) { - str = Tcl_GetString(objv[i]); - Tcl_AppendResult(interp, "value for \"", str, "\" missing", NULL); + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "value for \"%s\" missing", Tcl_GetString(objv[i]))); + Tcl_SetErrorCode(interp, "TK", "MSGBOX", "VALUE", NULL); goto end; } switch (index) { @@ -954,8 +1045,8 @@ Tk_MessageBoxObjCmd( break; case ALERT_ICON: - if (Tcl_GetIndexFromObj(interp, objv[i + 1], alertIconStrings, - "value", TCL_EXACT, &iconIndex) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[i + 1], alertIconStrings, + sizeof(char *), "value", TCL_EXACT, &iconIndex) != TCL_OK) { goto end; } break; @@ -984,8 +1075,8 @@ Tk_MessageBoxObjCmd( break; case ALERT_TYPE: - if (Tcl_GetIndexFromObj(interp, objv[i + 1], alertTypeStrings, - "value", TCL_EXACT, &typeIndex) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[i + 1], alertTypeStrings, + sizeof(char *), "value", TCL_EXACT, &typeIndex) != TCL_OK) { goto end; } break; @@ -996,13 +1087,12 @@ Tk_MessageBoxObjCmd( } if (indexDefaultOption) { /* - * Any '-default' option needs to know the '-type' option, which is why - * we do this here. + * Any '-default' option needs to know the '-type' option, which is + * why we do this here. */ - if (Tcl_GetIndexFromObj(interp, objv[indexDefaultOption + 1], - alertButtonStrings, "value", TCL_EXACT, &index) - != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[indexDefaultOption + 1], + alertButtonStrings, sizeof(char *), "value", TCL_EXACT, &index) != TCL_OK) { goto end; } @@ -1015,6 +1105,7 @@ Tk_MessageBoxObjCmd( if (!defaultNativeButtonIndex) { Tcl_SetObjResult(interp, Tcl_NewStringObj("Illegal default option", -1)); + Tcl_SetErrorCode(interp, "TK", "MSGBOX", "DEFAULT", NULL); goto end; } } @@ -1027,15 +1118,17 @@ Tk_MessageBoxObjCmd( buttons = [alert buttons]; for (NSButton *b in buttons) { NSString *ke = [b keyEquivalent]; + if (([ke isEqualToString:@"\r"] || [ke isEqualToString:@"\033"]) && ![b keyEquivalentModifierMask]) { [b setKeyEquivalent:@""]; } } - [[buttons objectAtIndex:[buttons count]-1] setKeyEquivalent:@"\033"]; - [[buttons objectAtIndex:defaultNativeButtonIndex-1] setKeyEquivalent:@"\r"]; + [[buttons objectAtIndex: [buttons count]-1] setKeyEquivalent: @"\033"]; + [[buttons objectAtIndex: defaultNativeButtonIndex-1] + setKeyEquivalent: @"\r"]; if (cmdObj) { - callbackInfo = (AlertCallbackInfo *) ckalloc(sizeof(AlertCallbackInfo)); + callbackInfo = (AlertCallbackInfo *)ckalloc(sizeof(AlertCallbackInfo)); if (Tcl_IsShared(cmdObj)) { cmdObj = Tcl_DuplicateObj(cmdObj); } @@ -1046,18 +1139,27 @@ Tk_MessageBoxObjCmd( callbackInfo->typeIndex = typeIndex; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { - [alert beginSheetModalForWindow:parent modalDelegate:NSApp - didEndSelector:@selector(tkAlertDidEnd:returnCode:contextInfo:) - contextInfo:callbackInfo]; - returnCode = cmdObj ? NSAlertOtherReturn : - [NSApp runModalForWindow:[alert window]]; +#if MAC_OS_X_VERSION_MIN_REQUIRED > 1090 + [alert beginSheetModalForWindow:parent + completionHandler:^(NSModalResponse returnCode) + { [NSApp tkAlertDidEnd:alert + returnCode:returnCode + contextInfo:callbackInfo ]; } ]; +#else + [alert beginSheetModalForWindow:parent + modalDelegate:NSApp + didEndSelector:@selector(tkAlertDidEnd:returnCode:contextInfo:) + contextInfo:callbackInfo]; +#endif + modalReturnCode = cmdObj ? 0 : + [NSApp runModalForWindow:[alert window]]; } else { - returnCode = [alert runModal]; - [NSApp tkAlertDidEnd:alert returnCode:returnCode + modalReturnCode = [alert runModal]; + [NSApp tkAlertDidEnd:alert returnCode:modalReturnCode contextInfo:callbackInfo]; } - result = (returnCode != NSAlertErrorReturn) ? TCL_OK : TCL_ERROR; -end: + result = (modalReturnCode < 1) ? TCL_OK : TCL_ERROR; + end: [alert release]; return result; } diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 672e266..45a07c7 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -675,7 +675,7 @@ GetCGContextForDrawable( if (macDraw->flags & TK_IS_BW_PIXMAP) { bitsPerPixel = 8; - bitmapInfo = kCGImageAlphaOnly; + bitmapInfo = (CGBitmapInfo)kCGImageAlphaOnly; } else { colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); bitsPerPixel = 32; diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index d30da09..f1e01d2 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -15,6 +15,19 @@ #include "tkMacOSXPrivate.h" #include "tkMacOSXFont.h" +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 +#define defaultOrientation kCTFontDefaultOrientation +#define verticalOrientation kCTFontVerticalOrientation +#else +#define defaultOrientation kCTFontOrientationDefault +#define verticalOrientation kCTFontOrientationVertical +#endif +#if MAC_OS_X_VERSION_MIN_REQUIRED < 101100 +#define fixedPitch kCTFontUserFixedPitchFontType +#else +#define fixedPitch kCTFontUIFontUserFixedPitch +#endif + /* #ifdef TK_MAC_DEBUG #define TK_MAC_DEBUG_FONTS @@ -270,7 +283,7 @@ InitFont( fmPtr->fixed = [nsFont advancementForGlyph:glyphs[0]].width == [nsFont advancementForGlyph:glyphs[1]].width; bounds = NSRectFromCGRect(CTFontGetBoundingRectsForGlyphs((CTFontRef) - nsFont, kCTFontDefaultOrientation, ch, boundingRects, nCh)); + nsFont, defaultOrientation, ch, boundingRects, nCh)); kern = [nsFont advancementForGlyph:glyphs[2]].width - [fontPtr->nsFont advancementForGlyph:glyphs[2]].width; } @@ -382,8 +395,7 @@ TkpFontPkgInit( systemFont++; } TkInitFontAttributes(&fa); - nsFont = (NSFont*) CTFontCreateUIFontForLanguage( - kCTFontUserFixedPitchFontType, 11, NULL); + nsFont = (NSFont*) CTFontCreateUIFontForLanguage(fixedPitch, 11, NULL); if (nsFont) { GetTkFontAttributesForNSFont(nsFont, &fa); CFRelease(nsFont); diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c index 9671ab9..9c0f9d1 100644 --- a/macosx/tkMacOSXHLEvents.c +++ b/macosx/tkMacOSXHLEvents.c @@ -7,12 +7,15 @@ * Copyright (c) 1995-1997 Sun Microsystems, Inc. * Copyright 2001-2009, Apple Inc. * Copyright (c) 2006-2009 Daniel A. Steffen + * Copyright (c) 2015 Marc Culler * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkMacOSXPrivate.h" +#include +#define URL_MAX_LENGTH (17 + MAXPATHLEN) /* * This is a Tcl_Event structure that the Quit AppleEvent handler uses to @@ -30,154 +33,32 @@ typedef struct KillEvent { * Static functions used only in this file. */ -static OSErr QuitHandler(const AppleEvent *event, - AppleEvent *reply, SRefCon handlerRefcon); -static OSErr OappHandler(const AppleEvent *event, - AppleEvent *reply, SRefCon handlerRefcon); -static OSErr RappHandler(const AppleEvent *event, - AppleEvent *reply, SRefCon handlerRefcon); -static OSErr OdocHandler(const AppleEvent *event, - AppleEvent *reply, SRefCon handlerRefcon); -static OSErr PrintHandler(const AppleEvent *event, - AppleEvent *reply, SRefCon handlerRefcon); -static OSErr ScriptHandler(const AppleEvent *event, - AppleEvent *reply, SRefCon handlerRefcon); -static OSErr PrefsHandler(const AppleEvent *event, - AppleEvent *reply, SRefCon handlerRefcon); -static int MissedAnyParameters(const AppleEvent *theEvent); -static int ReallyKillMe(Tcl_Event *eventPtr, int flags); -static OSStatus FSRefToDString(const FSRef *fsref, Tcl_DString *ds); +static void tkMacOSXProcessFiles(NSAppleEventDescriptor* event, + NSAppleEventDescriptor* replyEvent, + Tcl_Interp *interp, + char* procedure); +static int MissedAnyParameters(const AppleEvent *theEvent); +static int ReallyKillMe(Tcl_Event *eventPtr, int flags); #pragma mark TKApplication(TKHLEvents) @implementation TKApplication(TKHLEvents) - -- (void)terminate:(id)sender { - QuitHandler(NULL, NULL, (SRefCon) _eventInterp); -} - -- (void)preferences:(id)sender { - PrefsHandler(NULL, NULL, (SRefCon) _eventInterp); -} - -@end - -#pragma mark - - -/* - *---------------------------------------------------------------------- - * - * TkMacOSXInitAppleEvents -- - * - * Initilize the Apple Events on the Macintosh. This registers the core - * event handlers. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -TkMacOSXInitAppleEvents( - Tcl_Interp *interp) /* Interp to handle basic events. */ +- (void) terminate: (id) sender { - AEEventHandlerUPP OappHandlerUPP, RappHandlerUPP, OdocHandlerUPP; - AEEventHandlerUPP PrintHandlerUPP, QuitHandlerUPP, ScriptHandlerUPP; - AEEventHandlerUPP PrefsHandlerUPP; - static Boolean initialized = FALSE; - - if (!initialized) { - initialized = TRUE; - - /* - * Install event handlers for the core apple events. - */ - - QuitHandlerUPP = NewAEEventHandlerUPP(QuitHandler); - ChkErr(AEInstallEventHandler, kCoreEventClass, kAEQuitApplication, - QuitHandlerUPP, (SRefCon) interp, false); - - OappHandlerUPP = NewAEEventHandlerUPP(OappHandler); - ChkErr(AEInstallEventHandler, kCoreEventClass, kAEOpenApplication, - OappHandlerUPP, (SRefCon) interp, false); - - RappHandlerUPP = NewAEEventHandlerUPP(RappHandler); - ChkErr(AEInstallEventHandler, kCoreEventClass, kAEReopenApplication, - RappHandlerUPP, (SRefCon) interp, false); - - OdocHandlerUPP = NewAEEventHandlerUPP(OdocHandler); - ChkErr(AEInstallEventHandler, kCoreEventClass, kAEOpenDocuments, - OdocHandlerUPP, (SRefCon) interp, false); - - PrintHandlerUPP = NewAEEventHandlerUPP(PrintHandler); - ChkErr(AEInstallEventHandler, kCoreEventClass, kAEPrintDocuments, - PrintHandlerUPP, (SRefCon) interp, false); - - PrefsHandlerUPP = NewAEEventHandlerUPP(PrefsHandler); - ChkErr(AEInstallEventHandler, kCoreEventClass, kAEShowPreferences, - PrefsHandlerUPP, (SRefCon) interp, false); - - if (interp) { - ScriptHandlerUPP = NewAEEventHandlerUPP(ScriptHandler); - ChkErr(AEInstallEventHandler, kAEMiscStandards, kAEDoScript, - ScriptHandlerUPP, (SRefCon) interp, false); - } - } + [self handleQuitApplicationEvent:Nil withReplyEvent:Nil]; } - -/* - *---------------------------------------------------------------------- - * - * TkMacOSXDoHLEvent -- - * - * Dispatch incomming highlevel events. - * - * Results: - * None. - * - * Side effects: - * Depends on the incoming event. - * - *---------------------------------------------------------------------- - */ -int -TkMacOSXDoHLEvent( - void *theEvent) +- (void) preferences: (id) sender { - return AEProcessAppleEvent((EventRecord *)theEvent); + [self handleShowPreferencesEvent:Nil withReplyEvent:Nil]; } - -/* - *---------------------------------------------------------------------- - * - * QuitHandler -- - * - * This is the 'quit' core Apple event handler. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static OSErr -QuitHandler( - const AppleEvent *event, - AppleEvent *reply, - SRefCon handlerRefcon) +- (void) handleQuitApplicationEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent { - Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; KillEvent *eventPtr; - if (interp) { + if (_eventInterp) { /* * Call the exit command from the event loop, since you are not * supposed to call ExitToShell in an Apple Event Handler. We put this @@ -186,289 +67,292 @@ QuitHandler( * quickly as possible. */ - eventPtr = (KillEvent *) ckalloc(sizeof(KillEvent)); + eventPtr = (KillEvent*)ckalloc(sizeof(KillEvent)); eventPtr->header.proc = ReallyKillMe; - eventPtr->interp = interp; + eventPtr->interp = _eventInterp; Tcl_QueueEvent((Tcl_Event *) eventPtr, TCL_QUEUE_HEAD); } - return noErr; } - -/* - *---------------------------------------------------------------------- - * - * OappHandler -- - * - * This is the 'oapp' core Apple event handler. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static OSErr -OappHandler( - const AppleEvent *event, - AppleEvent *reply, - SRefCon handlerRefcon) +- (void) handleOpenApplicationEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent { - Tcl_CmdInfo dummy; - Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; + Tcl_Interp *interp = _eventInterp; if (interp && - Tcl_GetCommandInfo(interp, "::tk::mac::OpenApplication", &dummy)){ - int code = Tcl_EvalEx(interp, "::tk::mac::OpenApplication", -1, TCL_EVAL_GLOBAL); + Tcl_FindCommand(_eventInterp, "::tk::mac::OpenApplication", NULL, 0)){ + int code = Tcl_EvalEx(_eventInterp, "::tk::mac::OpenApplication", + -1, TCL_EVAL_GLOBAL); if (code != TCL_OK) { - Tcl_BackgroundError(interp); + Tcl_BackgroundError(_eventInterp); } } - return noErr; } - -/* - *---------------------------------------------------------------------- - * - * RappHandler -- - * - * This is the 'rapp' core Apple event handler. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static OSErr -RappHandler( - const AppleEvent *event, - AppleEvent *reply, - SRefCon handlerRefcon) +- (void) handleReopenApplicationEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent { - Tcl_CmdInfo dummy; - Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090 ProcessSerialNumber thePSN = {0, kCurrentProcess}; - OSStatus err = ChkErr(SetFrontProcess, &thePSN); - - if (interp && Tcl_GetCommandInfo(interp, - "::tk::mac::ReopenApplication", &dummy)) { - int code = Tcl_EvalEx(interp, "::tk::mac::ReopenApplication", -1, TCL_EVAL_GLOBAL); + SetFrontProcess(&thePSN); +#else + [[NSApplication sharedApplication] activateIgnoringOtherApps: YES]; +#endif + if (_eventInterp && Tcl_FindCommand(_eventInterp, + "::tk::mac::ReopenApplication", NULL, 0)) { + int code = Tcl_EvalEx(_eventInterp, "::tk::mac::ReopenApplication", + -1, TCL_EVAL_GLOBAL); if (code != TCL_OK){ - Tcl_BackgroundError(interp); + Tcl_BackgroundError(_eventInterp); } } - return err; } - -/* - *---------------------------------------------------------------------- - * - * PrefsHandler -- - * - * This is the 'pref' core Apple event handler. Called when the user - * selects 'Preferences...' in MacOS X - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static OSErr -PrefsHandler( - const AppleEvent *event, - AppleEvent *reply, - SRefCon handlerRefcon) +- (void) handleShowPreferencesEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent { - Tcl_CmdInfo dummy; - Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; - - if (interp && - Tcl_GetCommandInfo(interp, "::tk::mac::ShowPreferences", &dummy)){ - int code = Tcl_EvalEx(interp, "::tk::mac::ShowPreferences", -1, TCL_EVAL_GLOBAL); + if (_eventInterp && + Tcl_FindCommand(_eventInterp, "::tk::mac::ShowPreferences", NULL, 0)){ + int code = Tcl_EvalEx(_eventInterp, "::tk::mac::ShowPreferences", + -1, TCL_EVAL_GLOBAL); if (code != TCL_OK) { - Tcl_BackgroundError(interp); + Tcl_BackgroundError(_eventInterp); } } - return noErr; } - -/* - *---------------------------------------------------------------------- - * - * OdocHandler -- - * - * This is the 'odoc' core Apple event handler. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static OSErr -OdocHandler( - const AppleEvent *event, - AppleEvent *reply, - SRefCon handlerRefcon) +- (void) handleOpenDocumentsEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent { - Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; - AEDescList fileSpecList; - FSRef file; - DescType type; - Size actual; - long count, index; - AEKeyword keyword; - Tcl_DString command, pathName; - Tcl_CmdInfo dummy; - int code; + tkMacOSXProcessFiles(event, replyEvent, _eventInterp, "::tk::mac::OpenDocument"); +} - /* - * Don't bother if we don't have an interp or the open document procedure - * doesn't exist. - */ +- (void) handlePrintDocumentsEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent +{ + tkMacOSXProcessFiles(event, replyEvent, _eventInterp, "::tk::mac::PrintDocument"); +} - if (!interp || - !Tcl_GetCommandInfo(interp, "::tk::mac::OpenDocument", &dummy)) { - return noErr; - } +- (void) handleDoScriptEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent +{ + OSStatus err; + const AEDesc *theDesc = nil; + DescType type = 0, initialType = 0; + Size actual; + int tclErr = -1; + char URLBuffer[1 + URL_MAX_LENGTH]; + char errString[128]; + char typeString[5]; /* - * If we get any errors while retrieving our parameters we just return with - * no error. + * The DoScript event receives one parameter that should be text data or a + * fileURL. */ - if (ChkErr(AEGetParamDesc, event, keyDirectObject, typeAEList, - &fileSpecList) != noErr) { - return noErr; + theDesc = [event aeDesc]; + if (theDesc == nil) { + return; } - if (MissedAnyParameters(event) != noErr) { - return noErr; + + err = AEGetParamPtr(theDesc, keyDirectObject, typeWildCard, &initialType, + NULL, 0, NULL); + if (err != noErr) { + sprintf(errString, "AEDoScriptHandler: GetParamDesc error %d", (int)err); + AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyErrorString, typeChar, + errString, strlen(errString)); + return; } - if (ChkErr(AECountItems, &fileSpecList, &count) != noErr) { - return noErr; + + if (MissedAnyParameters((AppleEvent*)theDesc)) { + sprintf(errString, "AEDoScriptHandler: extra parameters"); + AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyErrorString, typeChar, + errString, strlen(errString)); + return; } - /* - * Convert our parameters into a script to evaluate, skipping things that - * we can't handle right. - */ - - Tcl_DStringInit(&command); - Tcl_DStringAppend(&command, "::tk::mac::OpenDocument", -1); - for (index = 1; index <= count; index++) { - if (ChkErr(AEGetNthPtr, &fileSpecList, index, typeFSRef, &keyword, - &type, (Ptr) &file, sizeof(FSRef), &actual) != noErr) { - continue; + if (initialType == typeFileURL || initialType == typeAlias) { + /* + * The descriptor can be coerced to a file url. Source the file, or + * pass the path as a string argument to ::tk::mac::DoScriptFile if + * that procedure exists. + */ + err = AEGetParamPtr(theDesc, keyDirectObject, typeFileURL, &type, + (Ptr) URLBuffer, URL_MAX_LENGTH, &actual); + if (err == noErr && actual > 0){ + URLBuffer[actual] = '\0'; + NSString *urlString = [NSString stringWithUTF8String:(char*)URLBuffer]; + NSURL *fileURL = [NSURL URLWithString:urlString]; + Tcl_DString command; + Tcl_DStringInit(&command); + if (Tcl_FindCommand(_eventInterp, "::tk::mac::DoScriptFile", NULL, 0)){ + Tcl_DStringAppend(&command, "::tk::mac::DoScriptFile", -1); + } else { + Tcl_DStringAppend(&command, "source", -1); + } + Tcl_DStringAppendElement(&command, [[fileURL path] UTF8String]); + tclErr = Tcl_EvalEx(_eventInterp, Tcl_DStringValue(&command), + Tcl_DStringLength(&command), TCL_EVAL_GLOBAL); } - - if (ChkErr(FSRefToDString, &file, &pathName) == noErr) { - Tcl_DStringAppendElement(&command, Tcl_DStringValue(&pathName)); - Tcl_DStringFree(&pathName); + } else if (noErr == AEGetParamPtr(theDesc, keyDirectObject, typeUTF8Text, &type, + NULL, 0, &actual)) { + if (actual > 0) { + /* + * The descriptor can be coerced to UTF8 text. Evaluate as Tcl, or + * or pass the text as a string argument to ::tk::mac::DoScriptText + * if that procedure exists. + */ + char *data = ckalloc(actual + 1); + if (noErr == AEGetParamPtr(theDesc, keyDirectObject, typeUTF8Text, &type, + data, actual, NULL)) { + if (Tcl_FindCommand(_eventInterp, "::tk::mac::DoScriptText", NULL, 0)){ + Tcl_DString command; + Tcl_DStringInit(&command); + Tcl_DStringAppend(&command, "::tk::mac::DoScriptText", -1); + Tcl_DStringAppendElement(&command, data); + tclErr = Tcl_EvalEx(_eventInterp, Tcl_DStringValue(&command), + Tcl_DStringLength(&command), TCL_EVAL_GLOBAL); + } else { + tclErr = Tcl_EvalEx(_eventInterp, data, actual, TCL_EVAL_GLOBAL); + } + } + ckfree(data); + } + } else { + /* + * The descriptor can not be coerced to a fileURL or UTF8 text. + */ + for (int i = 0; i < 4; i++) { + typeString[i] = ((char*)&initialType)[3-i]; } + typeString[4] = '\0'; + sprintf(errString, "AEDoScriptHandler: invalid script type '%s', " + "must be coercable to 'furl' or 'utf8'", typeString); + AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyErrorString, typeChar, errString, + strlen(errString)); } - /* - * Now handle the event by evaluating a script. + * If we ran some Tcl code, put the result in the reply. */ - - code = Tcl_EvalEx(interp, Tcl_DStringValue(&command), - Tcl_DStringLength(&command), TCL_EVAL_GLOBAL); - if (code != TCL_OK) { - Tcl_BackgroundError(interp); + if (tclErr >= 0) { + int reslen; + const char *result = + Tcl_GetStringFromObj(Tcl_GetObjResult(_eventInterp), &reslen); + if (tclErr == TCL_OK) { + AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyDirectObject, typeChar, + result, reslen); + } else { + AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyErrorString, typeChar, + result, reslen); + AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyErrorNumber, typeSInt32, + (Ptr) &tclErr,sizeof(int)); + } } - Tcl_DStringFree(&command); - return noErr; + return; } - +@end + +#pragma mark - + /* *---------------------------------------------------------------------- * - * PrintHandler -- + * TkMacOSXProcessFiles -- * - * This is the 'pdoc' core Apple event handler. + * Extract a list of fileURLs from an AppleEvent and call the specified + * procedure with the file paths as arguments. * * Results: * None. * * Side effects: - * None. + * The event is handled by running the procedure. * *---------------------------------------------------------------------- */ -static OSErr -PrintHandler( - const AppleEvent * event, - AppleEvent * reply, - SRefCon handlerRefcon) +static void +tkMacOSXProcessFiles( + NSAppleEventDescriptor* event, + NSAppleEventDescriptor* replyEvent, + Tcl_Interp *interp, + char* procedure) { - Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; - AEDescList fileSpecList; - FSRef file; + Tcl_Encoding utf8 = Tcl_GetEncoding(NULL, "utf-8"); + const AEDesc *fileSpecDesc = nil; + AEDesc contents; + char URLString[1 + URL_MAX_LENGTH]; + NSURL *fileURL; DescType type; Size actual; long count, index; AEKeyword keyword; Tcl_DString command, pathName; - Tcl_CmdInfo dummy; int code; /* - * Don't bother if we don't have an interp or the print document procedure - * doesn't exist. + * Do nothing if we don't have an interpreter or the procedure doesn't exist. */ - if (!interp || - !Tcl_GetCommandInfo(interp, "::tk::mac::PrintDocument", &dummy)) { - return noErr; + if (!interp || !Tcl_FindCommand(interp, procedure, NULL, 0)) { + return; } - + + fileSpecDesc = [event aeDesc]; + if (fileSpecDesc == nil ) { + return; + } + /* - * If we get any errors while retrieving our parameters we just return with - * no error. + * The AppleEvent's descriptor should either contain a value of + * typeObjectSpecifier or typeAEList. In the first case, the descriptor + * can be treated as a list of size 1 containing a value which can be + * coerced into a fileURL. In the second case we want to work with the list + * itself. Values in the list will be coerced into fileURL's if possible; + * otherwise they will be ignored. */ - - if (ChkErr(AEGetParamDesc, event, keyDirectObject, typeAEList, - &fileSpecList) != noErr) { - return noErr; + + /* Get a copy of the AppleEvent's descriptor. */ + AEGetParamDesc(fileSpecDesc, keyDirectObject, typeWildCard, &contents); + if (contents.descriptorType == typeAEList) { + fileSpecDesc = &contents; } - if (ChkErr(MissedAnyParameters, event) != noErr) { - return noErr; + + if (AECountItems(fileSpecDesc, &count) != noErr) { + AEDisposeDesc(&contents); + return; } - if (ChkErr(AECountItems, &fileSpecList, &count) != noErr) { - return noErr; - } - + + /* + * Construct a Tcl command which calls the procedure, passing the + * paths contained in the AppleEvent as arguments. + */ + Tcl_DStringInit(&command); - Tcl_DStringAppend(&command, "::tk::mac::PrintDocument", -1); + Tcl_DStringAppend(&command, procedure, -1); + for (index = 1; index <= count; index++) { - if (ChkErr(AEGetNthPtr, &fileSpecList, index, typeFSRef, &keyword, - &type, (Ptr) &file, sizeof(FSRef), &actual) != noErr) { + if (noErr != AEGetNthPtr(fileSpecDesc, index, typeFileURL, &keyword, + &type, (Ptr) URLString, URL_MAX_LENGTH, &actual)) { continue; } - - if (ChkErr(FSRefToDString, &file, &pathName) == noErr) { - Tcl_DStringAppendElement(&command, Tcl_DStringValue(&pathName)); - Tcl_DStringFree(&pathName); + if (type != typeFileURL) { + continue; + } + URLString[actual] = '\0'; + fileURL = [NSURL URLWithString:[NSString stringWithUTF8String:(char*)URLString]]; + if (fileURL == nil) { + continue; } + Tcl_ExternalToUtfDString(utf8, [[fileURL path] UTF8String], -1, &pathName); + Tcl_DStringAppendElement(&command, Tcl_DStringValue(&pathName)); + Tcl_DStringFree(&pathName); } + AEDisposeDesc(&contents); /* - * Now handle the event by evaluating a script. + * Handle the event by evaluating the Tcl expression we constructed. */ code = Tcl_EvalEx(interp, Tcl_DStringValue(&command), @@ -477,18 +361,19 @@ PrintHandler( Tcl_BackgroundError(interp); } Tcl_DStringFree(&command); - return noErr; + return; } /* *---------------------------------------------------------------------- * - * ScriptHandler -- + * TkMacOSXInitAppleEvents -- * - * This handler process the script event. + * Register AppleEvent handlers with the NSAppleEventManager for + * this NSApplication. * * Results: - * Schedules the given event to be processed. + * None. * * Side effects: * None. @@ -496,108 +381,91 @@ PrintHandler( *---------------------------------------------------------------------- */ -static OSErr -ScriptHandler( - const AppleEvent *event, - AppleEvent *reply, - SRefCon handlerRefcon) +void +TkMacOSXInitAppleEvents( + Tcl_Interp *interp) /* not used */ { - OSStatus theErr; - AEDescList theDesc; - Size size; - int tclErr = -1; - Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; - char errString[128]; + NSAppleEventManager *aeManager = [NSAppleEventManager sharedAppleEventManager]; + static Boolean initialized = FALSE; - /* - * The do script event receives one parameter that should be data or a - * file. - */ + if (!initialized) { + initialized = TRUE; - theErr = AEGetParamDesc(event, keyDirectObject, typeWildCard, - &theDesc); - if (theErr != noErr) { - sprintf(errString, "AEDoScriptHandler: GetParamDesc error %d", - (int)theErr); - theErr = AEPutParamPtr(reply, keyErrorString, typeChar, errString, - strlen(errString)); - } else if (MissedAnyParameters(event)) { - /* - * Return error if parameter is missing. - */ + [aeManager setEventHandler:NSApp + andSelector:@selector(handleQuitApplicationEvent:withReplyEvent:) + forEventClass:kCoreEventClass andEventID:kAEQuitApplication]; - sprintf(errString, "AEDoScriptHandler: extra parameters"); - AEPutParamPtr(reply, keyErrorString, typeChar, errString, - strlen(errString)); - theErr = -1771; - } else if (theDesc.descriptorType == (DescType) typeAlias && - AEGetParamPtr(event, keyDirectObject, typeFSRef, NULL, NULL, - 0, &size) == noErr && size == sizeof(FSRef)) { - /* - * We've had a file sent to us. Source it. - */ + [aeManager setEventHandler:NSApp + andSelector:@selector(handleOpenApplicationEvent:withReplyEvent:) + forEventClass:kCoreEventClass andEventID:kAEOpenApplication]; - FSRef file; - theErr = AEGetParamPtr(event, keyDirectObject, typeFSRef, NULL, &file, - size, NULL); - if (theErr == noErr) { - Tcl_DString scriptName; + [aeManager setEventHandler:NSApp + andSelector:@selector(handleReopenApplicationEvent:withReplyEvent:) + forEventClass:kCoreEventClass andEventID:kAEReopenApplication]; - theErr = FSRefToDString(&file, &scriptName); - if (theErr == noErr) { - tclErr = Tcl_EvalFile(interp, Tcl_DStringValue(&scriptName)); - Tcl_DStringFree(&scriptName); - } else { - sprintf(errString, "AEDoScriptHandler: file not found"); - AEPutParamPtr(reply, keyErrorString, typeChar, errString, - strlen(errString)); - } - } - } else if (AEGetParamPtr(event, keyDirectObject, typeUTF8Text, NULL, NULL, - 0, &size) == noErr && size) { - /* - * We've had some data sent to us. Evaluate it. - */ + [aeManager setEventHandler:NSApp + andSelector:@selector(handleShowPreferencesEvent:withReplyEvent:) + forEventClass:kCoreEventClass andEventID:kAEShowPreferences]; - char *data = ckalloc(size + 1); - theErr = AEGetParamPtr(event, keyDirectObject, typeUTF8Text, NULL, data, - size, NULL); - if (theErr == noErr) { - tclErr = Tcl_EvalEx(interp, data, size, TCL_EVAL_GLOBAL); - } - } else { - /* - * Umm, don't recognize what we've got... - */ + [aeManager setEventHandler:NSApp + andSelector:@selector(handleOpenDocumentsEvent:withReplyEvent:) + forEventClass:kCoreEventClass andEventID:kAEOpenDocuments]; - sprintf(errString, "AEDoScriptHandler: invalid script type '%-4.4s', " - "must be 'alis' or coercable to 'utf8'", - (char*) &theDesc.descriptorType); - AEPutParamPtr(reply, keyErrorString, typeChar, errString, - strlen(errString)); - theErr = -1770; + [aeManager setEventHandler:NSApp + andSelector:@selector(handleOpenDocumentsEvent:withReplyEvent:) + forEventClass:kCoreEventClass andEventID:kAEPrintDocuments]; + + [aeManager setEventHandler:NSApp + andSelector:@selector(handleDoScriptEvent:withReplyEvent:) + forEventClass:kAEMiscStandards andEventID:kAEDoScript]; } +} + +/* + *---------------------------------------------------------------------- + * + * TkMacOSXDoHLEvent -- + * + * Dispatch an AppleEvent. + * + * Results: + * None. + * + * Side effects: + * Depend on the AppleEvent. + * + *---------------------------------------------------------------------- + */ - /* - * If we actually go to run Tcl code - put the result in the reply. +int +TkMacOSXDoHLEvent( + void *theEvent) +{ + /* According to the NSAppleEventManager reference: + * "The theReply parameter always specifies a reply Apple event, never + * nil. However, the handler should not fill out the reply if the + * descriptor type for the reply event is typeNull, indicating the sender + * does not want a reply." + * The specified way to build such a non-nil descriptor is used here. But + * on OSX 10.11, the compiler nonetheless generates a warning. I am + * supressing the warning here -- maybe the warnings will stop in a future + * compiler release. */ +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnonnull" +#endif - if (tclErr >= 0) { - int reslen; - const char *result = - Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &reslen); + NSAppleEventDescriptor* theReply = [NSAppleEventDescriptor nullDescriptor]; + NSAppleEventManager *aeManager = [NSAppleEventManager sharedAppleEventManager]; - if (tclErr == TCL_OK) { - AEPutParamPtr(reply, keyDirectObject, typeChar, result, reslen); - } else { - AEPutParamPtr(reply, keyErrorString, typeChar, result, reslen); - AEPutParamPtr(reply, keyErrorNumber, typeSInt32, (Ptr) &tclErr, - sizeof(int)); - } - } + return [aeManager dispatchRawAppleEvent:(const AppleEvent*)theEvent + withRawReply: (AppleEvent *)theReply + handlerRefCon: (SRefCon)0]; - AEDisposeDesc(&theDesc); - return theErr; +#ifdef __clang__ +#pragma clang diagnostic pop +#endif } /* @@ -616,7 +484,6 @@ ScriptHandler( * *---------------------------------------------------------------------- */ - static int ReallyKillMe( Tcl_Event *eventPtr, @@ -666,38 +533,7 @@ MissedAnyParameters( return (err != errAEDescNotFound); } - -/* - *---------------------------------------------------------------------- - * - * FSRefToDString -- - * - * Get a POSIX path from an FSRef. - * - * Results: - * In the parameter ds. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static OSStatus -FSRefToDString( - const FSRef *fsref, - Tcl_DString *ds) -{ - UInt8 fileName[PATH_MAX+1]; - OSStatus err; - err = ChkErr(FSRefMakePath, fsref, fileName, sizeof(fileName)); - if (err == noErr) { - Tcl_ExternalToUtfDString(NULL, (char*) fileName, -1, ds); - } - return err; -} - /* * Local Variables: * mode: objc diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index c3121cb..3f4b3b5 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -792,7 +792,7 @@ TkpPostMenu( NSRect frame = NSMakeRect(x + 9, tkMacOSXZeroScreenHeight - y - 9, 1, 1); frame.origin = [view convertPoint: - [win convertScreenToBase:frame.origin] fromView:nil]; + [win convertPointFromScreen:frame.origin] fromView:nil]; NSMenu *menu = (NSMenu *) menuPtr->platformData; NSPopUpButtonCell *popUpButtonCell = [[NSPopUpButtonCell alloc] diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index f4bfb44..cd3eac1 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -26,65 +26,22 @@ typedef struct { static int GenerateButtonEvent(MouseEventData *medPtr); static unsigned int ButtonModifiers2State(UInt32 buttonState, - UInt32 keyModifiers); - -#pragma mark NSWindow(TKMouseEvent) - -/* Conversion of coordinates between window and screen */ -@interface NSWindow(TKWm) -- (NSPoint) convertPointToScreen:(NSPoint)point; -- (NSPoint) convertPointFromScreen:(NSPoint)point; -@end - -@implementation NSWindow(TKMouseEvent) -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 -- (NSPoint) convertPointToScreen: (NSPoint) point -{ - return [self convertBaseToScreen:point]; -} -- (NSPoint) convertPointFromScreen: (NSPoint)point -{ - return [self convertScreenToBase:point]; -} -@end -#else -- (NSPoint) convertPointToScreen: (NSPoint)point -{ - NSRect pointrect; - pointrect.origin = point; - pointrect.size.width = 0; - pointrect.size.height = 0; - return [self convertRectToScreen:pointrect].origin; -} -- (NSPoint) convertPointFromScreen: (NSPoint)point -{ - NSRect pointrect; - pointrect.origin = point; - pointrect.size.width = 0; - pointrect.size.height = 0; - return [self convertRectFromScreen:pointrect].origin; -} -@end -#endif - -#pragma mark - - + UInt32 keyModifiers); #pragma mark TKApplication(TKMouseEvent) enum { NSWindowWillMoveEventType = 20 }; + /* * In OS X 10.6 an NSEvent of type NSMouseMoved would always have a non-Nil - * window attribute when the mouse was inside a window. As of 10.8 this - * behavior had changed. The new behavior was that if the mouse were ever - * moved outside of a window, all subsequent NSMouseMoved NSEvents would have a - * Nil window attribute. To work around this we remember which window the - * mouse is in by saving the window attribute of each NSEvent of type - * NSMouseEntered. If an NSEvent has a Nil window attribute we use our saved - * window. It may be the case that the mouse has actually left the window, but - * this is harmless since Tk will ignore the event in that case. + * window attribute pointing to the active window. As of 10.8 this behavior + * had changed. The new behavior was that if the mouse were ever moved outside + * of a window, all subsequent NSMouseMoved NSEvents would have a Nil window + * attribute. To work around this the TKApplication remembers the last non-Nil + * window that it received in a mouse event. If it receives an NSEvent with a + * Nil window attribute then the saved window is used. */ @implementation TKApplication(TKMouseEvent) @@ -92,14 +49,14 @@ enum { #ifdef TK_MAC_DEBUG_EVENTS TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent); #endif - id win; - NSEventType type = [theEvent type]; + NSWindow* eventWindow = [theEvent window]; + NSEventType eventType = [theEvent type]; #if 0 NSTrackingArea *trackingArea = nil; NSInteger eventNumber, clickCount, buttonNumber; #endif - switch (type) { + switch (eventType) { case NSMouseEntered: /* Remember which window has the mouse. */ if (_windowWithMouse) { @@ -133,25 +90,31 @@ enum { case NSTabletProximity: case NSScrollWheel: break; - default: /* Unrecognized mouse event. */ return theEvent; } + /* Remember the window in case we need it next time. */ + if (eventWindow && eventWindow != _windowWithMouse) { + if (_windowWithMouse) { + [_windowWithMouse release]; + } + _windowWithMouse = eventWindow; + [_windowWithMouse retain]; + } + /* Create an Xevent to add to the Tk queue. */ - win = [theEvent window]; - NSWindow *nswindow = (NSWindow *)win; NSPoint global, local = [theEvent locationInWindow]; - if (win) { /* local will be in window coordinates. */ - global = [nswindow convertPointToScreen: local]; - local.y = [win frame].size.height - local.y; + if (eventWindow) { /* local will be in window coordinates. */ + global = [eventWindow convertPointToScreen: local]; + local.y = [eventWindow frame].size.height - local.y; global.y = tkMacOSXZeroScreenHeight - global.y; } else { /* local will be in screen coordinates. */ if (_windowWithMouse ) { - win = _windowWithMouse; + eventWindow = _windowWithMouse; global = local; - local = [nswindow convertPointFromScreen: local]; - local.y = [win frame].size.height - local.y; + local = [eventWindow convertPointFromScreen: local]; + local.y = [eventWindow frame].size.height - local.y; global.y = tkMacOSXZeroScreenHeight - global.y; } else { /* We have no window. Use the screen???*/ local.y = tkMacOSXZeroScreenHeight - local.y; @@ -159,7 +122,7 @@ enum { } } - Window window = TkMacOSXGetXWindow(win); + Window window = TkMacOSXGetXWindow(eventWindow); Tk_Window tkwin = window ? Tk_IdToWindow(TkGetDisplayList()->display, window) : NULL; if (!tkwin) { @@ -187,7 +150,7 @@ enum { state |= (buttons & ((1<<5) - 1)) << 8; } else { if (button < 5) { - switch (type) { + switch (eventType) { case NSLeftMouseDown: case NSRightMouseDown: case NSLeftMouseDragged: @@ -224,12 +187,12 @@ enum { state |= Mod4Mask; } - if (type != NSScrollWheel) { + if (eventType != NSScrollWheel) { #ifdef TK_MAC_DEBUG_EVENTS TKLog(@"UpdatePointer %p x %f.0 y %f.0 %d", tkwin, global.x, global.y, state); #endif Tk_UpdatePointer(tkwin, global.x, global.y, state); - } else { + } else { /* handle scroll wheel event */ CGFloat delta; int coarseDelta; XEvent xEvent; @@ -245,7 +208,8 @@ enum { delta = [theEvent deltaY]; if (delta != 0.0) { - coarseDelta = (delta > -1.0 && delta < 1.0) ? (signbit(delta) ? -1 : 1) : lround(delta); + coarseDelta = (delta > -1.0 && delta < 1.0) ? + (signbit(delta) ? -1 : 1) : lround(delta); xEvent.xbutton.state = state; xEvent.xkey.keycode = coarseDelta; xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); @@ -253,7 +217,8 @@ enum { } delta = [theEvent deltaX]; if (delta != 0.0) { - coarseDelta = (delta > -1.0 && delta < 1.0) ? (signbit(delta) ? -1 : 1) : lround(delta); + coarseDelta = (delta > -1.0 && delta < 1.0) ? + (signbit(delta) ? -1 : 1) : lround(delta); xEvent.xbutton.state = state | ShiftMask; xEvent.xkey.keycode = coarseDelta; xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); @@ -424,7 +389,7 @@ XQueryPointer( if (win) { NSPoint local; - local = [win convertScreenToBase:global]; + local = [win convertPointFromScreen:global]; local.y = [win frame].size.height - local.y; if (macWin->winPtr && macWin->winPtr->wmInfoPtr) { local.x -= macWin->winPtr->wmInfoPtr->xInParent; @@ -522,7 +487,7 @@ TkGenerateButtonEvent( if (win) { NSPoint local = NSMakePoint(x, tkMacOSXZeroScreenHeight - y); - local = [win convertScreenToBase:local]; + local = [win convertPointFromScreen:local]; local.y = [win frame].size.height - local.y; if (macWin->winPtr && macWin->winPtr->wmInfoPtr) { local.x -= macWin->winPtr->wmInfoPtr->xInParent; diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 4f96f64..4891b32 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -294,6 +294,24 @@ VISIBILITY_HIDDEN - (void)tkProvidePasteboard:(TkDisplay *)dispPtr; - (void)tkCheckPasteboard; @end +@interface TKApplication(TKHLEvents) +- (void) terminate: (id) sender; +- (void) preferences: (id) sender; +- (void) handleQuitApplicationEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent; +- (void) handleOpenApplicationEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent; +- (void) handleReopenApplicationEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent; +- (void) handleShowPreferencesEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent; +- (void) handleOpenDocumentsEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent; +- (void) handlePrintDocumentsEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent; +- (void) handleDoScriptEvent: (NSAppleEventDescriptor *)event + withReplyEvent: (NSAppleEventDescriptor *)replyEvent; +@end VISIBILITY_HIDDEN @interface TKContentView : NSView { @@ -327,6 +345,11 @@ VISIBILITY_HIDDEN @interface TKWindow : NSWindow @end +@interface NSWindow(TKWm) +- (NSPoint) convertPointToScreen:(NSPoint)point; +- (NSPoint) convertPointFromScreen:(NSPoint)point; +@end + #pragma mark NSMenu & NSMenuItem Utilities @interface NSMenu(TKUtils) @@ -355,9 +378,4 @@ VISIBILITY_HIDDEN keyEquivalentModifierMask:(NSUInteger)keyEquivalentModifierMask; @end - -/* Helper functions from tkMacOSXDeprecations.c */ - -extern NSPoint convertWindowToScreen( NSWindow *window, NSPoint point); - #endif /* _TKMACPRIV */ diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index c028a75..0b32e7e 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -747,15 +747,16 @@ TkWmProtocolEventProc( int Tk_MacOSXIsAppInFront(void) { - OSStatus err; - ProcessSerialNumber frontPsn, ourPsn = {0, kCurrentProcess}; Boolean isFrontProcess = true; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + ProcessSerialNumber frontPsn, ourPsn = {0, kCurrentProcess}; - err = ChkErr(GetFrontProcess, &frontPsn); - if (err == noErr) { - ChkErr(SameProcess, &frontPsn, &ourPsn, &isFrontProcess); + if (noErr == GetFrontProcess(&frontPsn)){ + SameProcess(&frontPsn, &ourPsn, &isFrontProcess); } - +#else + isFrontProcess = [NSRunningApplication currentApplication].active; +#endif return (isFrontProcess == true); } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 241d70a..69d3cfb 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -200,6 +200,48 @@ static int tkMacOSXWmAttrNotifyVal = 0; static Tcl_HashTable windowTable; static int windowHashInit = false; + + +#pragma mark NSWindow(TKWm) + +/* + * Conversion of coordinates between window and screen. + */ + +@implementation NSWindow(TKWm) +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 +- (NSPoint) convertPointToScreen: (NSPoint) point +{ + return [self convertBaseToScreen:point]; +} +- (NSPoint) convertPointFromScreen: (NSPoint)point +{ + return [self convertScreenToBase:point]; +} +@end +#else +- (NSPoint) convertPointToScreen: (NSPoint) point +{ + NSRect pointrect; + pointrect.origin = point; + pointrect.size.width = 0; + pointrect.size.height = 0; + return [self convertRectToScreen:pointrect].origin; +} +- (NSPoint) convertPointFromScreen: (NSPoint)point +{ + NSRect pointrect; + pointrect.origin = point; + pointrect.size.width = 0; + pointrect.size.height = 0; + return [self convertRectFromScreen:pointrect].origin; +} +@end +#endif + +#pragma mark - + + /* * Forward declarations for procedures defined in this file: */ diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index 2b9783d..f8adf1e 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -181,7 +181,21 @@ TkpOpenDisplay( NSAppKitVersionNumber); } display->vendor = vendor; - Gestalt(gestaltSystemVersion, (SInt32 *) &display->release); + { + int major, minor, patch; + +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 + Gestalt(gestaltSystemVersionMajor, (SInt32*)&major); + Gestalt(gestaltSystemVersionMinor, (SInt32*)&minor); + Gestalt(gestaltSystemVersionBugFix, (SInt32*)&patch); +#else + NSOperatingSystemVersion systemVersion = [[NSProcessInfo processInfo] operatingSystemVersion]; + major = systemVersion.majorVersion; + minor = systemVersion.minorVersion; + patch = systemVersion.patchVersion; +#endif + display->release = major << 16 | minor << 8 | patch; + } /* * These screen bits never change -- cgit v0.12 From c1b04b28e254278324baf30b73f1400b4fec2f5d Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 25 Nov 2015 07:22:53 +0000 Subject: Ooops... removed debug traces unintentionally left in the merge mark... --- generic/tkText.c | 8 -------- generic/tkTextDisp.c | 35 +---------------------------------- 2 files changed, 1 insertion(+), 42 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index dfcd294..4edf652 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -35,10 +35,6 @@ #include "tkText.h" -#define LOG(toVar,what) \ - Tcl_SetVar2(textPtr->interp, toVar, NULL, (what), \ - TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT) - /* * Used to avoid having to allocate and deallocate arrays on the fly for * commonly used functions. Must be > 0. @@ -608,9 +604,7 @@ CreateWidget( TkTextCreateDInfo(textPtr); TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, textPtr, 0, 0, &startIndex); -LOG("debug", "In createWidget, before"); TkTextSetYView(textPtr, &startIndex, 0); -LOG("debug", "In createWidget, after"); textPtr->exportSelection = 1; textPtr->pickEvent.type = LeaveNotify; textPtr->undo = textPtr->sharedTextPtr->undo; @@ -2658,9 +2652,7 @@ InsertChars( lineAndByteIndex[resetViewCount], 0, &newTop); TkTextIndexForwBytes(tPtr, &newTop, lineAndByteIndex[resetViewCount+1], &newTop); -LOG("debug", "In InsertChars, before"); TkTextSetYView(tPtr, &newTop, 0); -LOG("debug", "In InsertChars, after"); } } resetViewCount += 2; diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 722a137..02666d0 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -5088,14 +5088,12 @@ TkTextSetYView( int bottomY, close, lineIndex; TkTextIndex tmpIndex, rounded; int lineHeight; -char buffer[3 * TCL_INTEGER_SPACE + 1]; /* * If the specified position is the extra line at the end of the text, * round it back to the last real line. */ -LOG("debug", "\nENTERING TkTextSetYView"); lineIndex = TkBTreeLinesTo(textPtr, indexPtr->linePtr); if (lineIndex == TkBTreeNumLines(indexPtr->tree, textPtr)) { TkTextIndexBackChars(textPtr, indexPtr, 1, &rounded, COUNT_INDICES); @@ -5138,10 +5136,7 @@ LOG("debug", "\nENTERING TkTextSetYView"); } dlPtr = FindDLine(textPtr, dInfoPtr->dLinePtr, indexPtr); if (dlPtr != NULL) { -LOG("debug", "It's on screen"); -sprintf(buffer, "dlPtr->y: %d dlPtr->height: %d dInfoPtr->maxY: %d", dlPtr->y, dlPtr->height, dInfoPtr->maxY); -LOG("debug", buffer); - if ((dlPtr->y + dlPtr->height) > dInfoPtr->maxY) { + if ((dlPtr->y + dlPtr->height) > dInfoPtr->maxY) { /* * Part of the line hangs off the bottom of the screen; pretend * the whole line is off-screen. @@ -5149,10 +5144,6 @@ LOG("debug", buffer); dlPtr = NULL; } else { -TkTextPrintIndex(textPtr, &dlPtr->index, buffer); -LOG("debug", buffer); -TkTextPrintIndex(textPtr, indexPtr, buffer); -LOG("debug", buffer); if (TkTextIndexCmp(&dlPtr->index, indexPtr) <= 0) { if (dInfoPtr->dLinePtr == dlPtr && dInfoPtr->topPixelOffset != 0) { /* @@ -5176,16 +5167,9 @@ LOG("debug", buffer); * If the line is not close, place it in the center of the window. */ -LOG("debug", "Not yet on screen"); tmpIndex = *indexPtr; -TkTextPrintIndex(textPtr, &tmpIndex, buffer); -LOG("debug", buffer); TkTextFindDisplayLineEnd(textPtr, &tmpIndex, 0, NULL); -TkTextPrintIndex(textPtr, &tmpIndex, buffer); -LOG("debug", buffer); lineHeight = CalculateDisplayLineHeight(textPtr, &tmpIndex, NULL, NULL); - sprintf(buffer, "lineHeight: %d", lineHeight); -LOG("debug", buffer); /* * It would be better if 'bottomY' were calculated using the actual height @@ -5194,14 +5178,11 @@ LOG("debug", buffer); bottomY = (dInfoPtr->y + dInfoPtr->maxY + lineHeight)/2; close = (dInfoPtr->maxY - dInfoPtr->y)/3; -sprintf(buffer, "bottomY: %d close: %d", bottomY, close); -LOG("debug", buffer); if (close < 3*textPtr->charHeight) { close = 3*textPtr->charHeight; } if (dlPtr != NULL) { int overlap; -LOG("debug", "Above the top of the screen"); /* * The desired line is above the top of screen. If it is "close" to @@ -5220,7 +5201,6 @@ LOG("debug", "Above the top of the screen"); } } else { int overlap; -LOG("debug", "Below the top of the screen"); /* * The desired line is below the bottom of the screen. If it is @@ -5230,14 +5210,8 @@ LOG("debug", "Below the top of the screen"); MeasureUp(textPtr, indexPtr, close + lineHeight - textPtr->charHeight/2, &tmpIndex, &overlap); -TkTextPrintIndex(textPtr, &tmpIndex, buffer); -LOG("debug", buffer); -sprintf(buffer, "overlap: %d", overlap); -LOG("debug", buffer); if (FindDLine(textPtr, dInfoPtr->dLinePtr, &tmpIndex) != NULL) { bottomY = dInfoPtr->maxY - dInfoPtr->y; -sprintf(buffer, "New bottomY: %d", bottomY); -LOG("debug", buffer); } } @@ -5249,15 +5223,8 @@ LOG("debug", buffer); * of the window. */ -TkTextPrintIndex(textPtr, indexPtr, buffer); -LOG("debug", buffer); MeasureUp(textPtr, indexPtr, bottomY, &textPtr->topIndex, &dInfoPtr->newTopPixelOffset); -//dInfoPtr->newTopPixelOffset = 0; -TkTextPrintIndex(textPtr, &textPtr->topIndex, buffer); -LOG("debug", buffer); -sprintf(buffer, "newTopPixelOffset: %d", dInfoPtr->newTopPixelOffset); -LOG("debug", buffer); scheduleUpdate: if (!(dInfoPtr->flags & REDRAW_PENDING)) { -- cgit v0.12 From 510e1a4afed492f79e94a67224a0823158aa1db2 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 26 Nov 2015 13:55:28 +0000 Subject: On cygwin, install libtk8.5.dll.a in the {prefix}/lib directory. --- unix/configure | 2 +- unix/tcl.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/configure b/unix/configure index afd5bff..1be3cb8 100755 --- a/unix/configure +++ b/unix/configure @@ -7086,7 +7086,7 @@ fi MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' if test "${SHLIB_SUFFIX}" = ".dll"; then - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" else diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 4b9543c..3005321 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -2069,7 +2069,7 @@ dnl # preprocessing tests use only CPPFLAGS. LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' AS_IF([test "${SHLIB_SUFFIX}" = ".dll"], [ - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" ], [ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' -- cgit v0.12 From 492a37c09443c512e4054acff1bd206ae5d4d501 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 28 Nov 2015 19:45:01 +0000 Subject: [.text pendingsync] returns a boolean --- generic/tkText.c | 6 ++---- generic/tkText.h | 2 +- generic/tkTextDisp.c | 13 +++++++------ tests/text.test | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 62de1af..09e656f 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -1374,15 +1374,13 @@ TextWidgetObjCmd( result = TextPeerCmd(textPtr, interp, objc, objv); break; case TEXT_PENDINGSYNC: { - int number; - if (objc != 2) { Tcl_WrongNumArgs(interp, 2, objv, NULL); result = TCL_ERROR; goto done; } - number = TkTextPendingsync(textPtr); - Tcl_SetObjResult(interp, Tcl_NewIntObj(number)); + Tcl_SetObjResult(interp, + Tcl_NewBooleanObj(TkTextPendingsync(textPtr))); break; } case TEXT_REPLACE: { diff --git a/generic/tkText.h b/generic/tkText.h index 1c4be68..49ee479 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -1125,7 +1125,7 @@ MODULE_SCOPE int TkTextMarkNameToIndex(TkText *textPtr, MODULE_SCOPE void TkTextMarkSegToIndex(TkText *textPtr, TkTextSegment *markPtr, TkTextIndex *indexPtr); MODULE_SCOPE void TkTextEventuallyRepick(TkText *textPtr); -MODULE_SCOPE int TkTextPendingsync(TkText *textPtr); +MODULE_SCOPE Bool TkTextPendingsync(TkText *textPtr); MODULE_SCOPE void TkTextPickCurrent(TkText *textPtr, XEvent *eventPtr); MODULE_SCOPE void TkTextPixelIndex(TkText *textPtr, int x, int y, TkTextIndex *indexPtr, int *nearest); diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index d8a17a9..d214fa7 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -6101,12 +6101,11 @@ TkTextYviewCmd( * * TkTextPendingsync -- * - * This function computes how many lines are not up-to-date regarding - * asynchronous height calculations. + * This function checks if any line heights are not up-to-date. * * Results: - * Returns a positive integer corresponding to the number of lines for - * which the height is outdated. + * Returns a boolean true if it is the case, or false if all line + * heights are up-to-date. * * Side effects: * None. @@ -6114,13 +6113,15 @@ TkTextYviewCmd( *-------------------------------------------------------------- */ -int +Bool TkTextPendingsync( TkText *textPtr) /* Information about text widget. */ { TextDInfo *dInfoPtr = textPtr->dInfoPtr; - return (dInfoPtr->lastMetricUpdateLine - dInfoPtr->currentMetricUpdateLine); + return ( + (dInfoPtr->lastMetricUpdateLine - dInfoPtr->currentMetricUpdateLine) ? + 1 : 0); } /* diff --git a/tests/text.test b/tests/text.test index dc44293..89dd12c 100644 --- a/tests/text.test +++ b/tests/text.test @@ -1044,7 +1044,7 @@ test text-11a.12 {TextWidgetCmd procedure, "pendingsync" option} -setup { .top.yt delete 1.0 end .top.yt insert 1.0 $content # ensure the test is relevant - lappend res [expr {[.top.yt pendingsync] > 0}] + lappend res [.top.yt pendingsync] # asynchronously wait for completion of line metrics calculation while {[.top.yt pendingsync]} {update} .top.yt yview moveto $fraction1 -- cgit v0.12 From c7c6352112248f90539ef01a9d921745572b5d6b Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 28 Nov 2015 21:38:19 +0000 Subject: Text widget documentation updated according to TIP #438 --- doc/text.n | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 92 insertions(+), 1 deletion(-) diff --git a/doc/text.n b/doc/text.n index d2f0c82..f7cb143 100644 --- a/doc/text.n +++ b/doc/text.n @@ -1060,6 +1060,82 @@ affected. See below for the \fIpathName \fBpeer\fR widget command that controls the creation of peer widgets. .VE 8.5 +.SH "ASYNCHRONOUS UPDATE OF LINE HEIGHTS" +.PP +In order to maintain a responsive user-experience, the text widget calculates +lines metrics (line heights in pixels) asynchronously. Because of this, some +commands of the text widget may return wrong results if the asynchronous +calculations are not finished at the time of calling. This applies to +\fIpathName \fBcount -ypixels\fR and \fIpathName \fByview\fR. +.PP +Again for performance reasons, it would not be appropriate to let these +commands always wait for the end of the update calculation each time they are +called. In most use cases of these commands a more or less inaccurate result +does not really matter compared to execution speed. +.PP +In case accurate result is needed (and if the text widget is managed by a +geometry manager), one can resort to \fIpathName \fBsync\fR and \fIpathName +\fBpendingsync\fR to control the synchronization of the view of text widgets. +.PP +The \fB<>\fR virtual event fires when the line heights of the +text widget becomes obsolete (due to some editing command or configuration +change), and again when the internal data of the text widget are back in sync +with the widget view. The detail field (%d substitution) is either true (when +the widget is in sync) or false (when it is not). +.PP +\fIpathName \fBsync\fR, \fIpathName \fBpendingsync\fR and +\fB<>\fR apply to each text widget independently of its peers. +.PP +Examples of use: +.CS +## Example 1: +# runtime, immediately complete line metrics at any cost (GUI unresponsive) +$w sync +$w yview moveto $fraction + +## Example 2: +# runtime, synchronously wait for up-to-date line metrics (GUI responsive) +$w sync -command [list $w yview moveto $fraction] + +## Example 3: +# init +set yud($w) 0 +proc updateaction w { +\&set ::yud($w) 1 +\&# any other update action here... +} +# runtime, synchronously wait for up-to-date line metrics (GUI responsive) +$w sync -command [list updateaction $w] +vwait yud($w) +$w yview moveto $fraction + +## Example 4: +# init +set todo($w) {} +proc updateaction w { +\&foreach cmd $::todo($w) {uplevel #0 $cmd} +\&set todo($w) {} +} +# runtime +lappend todo($w) [list $w yview moveto $fraction] +$w sync -command [list updateaction $w] + +## Example 5: +# init +set todo($w) {} +bind $w <> { +\&if {%d} { +\&\&foreach cmd $todo(%W) {eval $cmd} +\&\&set todo(%W) {} +\&} +} +# runtime +if {![$w pendingsync]} { +\&$w yview moveto $fraction +} else { +\&lappend todo($w) [list $w yview moveto $fraction] +} +.CE .SH "WIDGET COMMAND" .PP The \fBtext\fR command creates a new Tcl command whose @@ -1132,7 +1208,9 @@ if the text widget is managed by a geometry manager), then all subsequent options ensure that any possible out of date information is recalculated. This currently only has any effect for the \fI\-ypixels\fR count (which, if \fB\-update\fR is not given, will use the text widget's current cached value -for each line). The count options are interpreted as follows: +for each line). This \fB\-update\fR option is obsoleted by \fIpathName +\fBsync\fR, \fIpathName \fBpendingsync\fR and \fB<>\fR. The +count options are interpreted as follows: .RS .IP \fB\-chars\fR count all characters, whether elided or not. Do not count @@ -1508,6 +1586,9 @@ Returns a list of peers of this widget (this does not include the widget itself). The order within this list is undefined. .RE .TP +\fIpathName \fBpendingsync\fR +Returns 1 if the line heights calculations are not up-to-date, 0 otherwise. +.TP \fIpathName \fBreplace\fR \fIindex1 index2 chars\fR ?\fItagList chars tagList ...\fR? Replaces the range of characters between \fIindex1\fR and \fIindex2\fR with the given characters and tags. See the section on \fIpathName @@ -1701,6 +1782,16 @@ edge of the window. If \fIindex\fR is far out of view, then the command centers \fIindex\fR in the window. .TP +\fIpathName \fBsync\fR ?\fB-command \fIcommand\fR? +Immediately brings the line metrics up-to-date by forcing computation of any +outdated line heights. The command returns immediately if there is no such +outdated line heights, otherwise it returns only at the end of the computation. +The command returns an empty string. If \fB-command \fIcommand\fR is specified, +schedule \fIcommand\fR to be executed exactly once as soon as all line +calculations are up-to-date. If there are no pending line metrics calculations, +\fIcommand\fR is executed immediately. \fIpathName \fBsync -command +\fIcommand\fR returns the return value of \fIcommand\fR. +.TP \fIpathName \fBtag \fIoption \fR?\fIarg arg ...\fR? This command is used to manipulate tags. The exact behavior of the command depends on the \fIoption\fR argument that follows the -- cgit v0.12 From 8fd7d7784f01c76fd4cb02b9a66cc435194a8bc4 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 28 Nov 2015 22:18:58 +0000 Subject: Fixed indentation --- generic/tkText.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 09e656f..a2b7dde 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -1510,19 +1510,19 @@ TextWidgetObjCmd( if (textPtr->afterSyncCmd) { Tcl_DecrRefCount(textPtr->afterSyncCmd); } - textPtr->afterSyncCmd = cmd; + textPtr->afterSyncCmd = cmd; } else { - result = Tcl_EvalObjEx(interp, cmd, TCL_EVAL_GLOBAL); - Tcl_DecrRefCount(cmd); + result = Tcl_EvalObjEx(interp, cmd, TCL_EVAL_GLOBAL); + Tcl_DecrRefCount(cmd); } - break; + break; } else if (objc != 2) { - Tcl_WrongNumArgs(interp, 2, objv, "?-command command?"); - result = TCL_ERROR; - goto done; + Tcl_WrongNumArgs(interp, 2, objv, "?-command command?"); + result = TCL_ERROR; + goto done; } if (textPtr->afterSyncCmd) { - Tcl_DecrRefCount(textPtr->afterSyncCmd); + Tcl_DecrRefCount(textPtr->afterSyncCmd); } textPtr->afterSyncCmd = NULL; TkTextUpdateLineMetrics(textPtr, 1, -- cgit v0.12 From bba041fbdedf7358083ff0f2cc618a4990696bd0 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 28 Nov 2015 22:35:18 +0000 Subject: Clearer separation between what [.text sync] and [.text sync -command] exactly perform --- doc/text.n | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/text.n b/doc/text.n index f7cb143..1966882 100644 --- a/doc/text.n +++ b/doc/text.n @@ -1783,14 +1783,21 @@ If \fIindex\fR is far out of view, then the command centers \fIindex\fR in the window. .TP \fIpathName \fBsync\fR ?\fB-command \fIcommand\fR? +Control the synchronization of the view of text widget. +.RS +.TP +\fIpathName \fBsync\fR Immediately brings the line metrics up-to-date by forcing computation of any outdated line heights. The command returns immediately if there is no such outdated line heights, otherwise it returns only at the end of the computation. -The command returns an empty string. If \fB-command \fIcommand\fR is specified, -schedule \fIcommand\fR to be executed exactly once as soon as all line -calculations are up-to-date. If there are no pending line metrics calculations, -\fIcommand\fR is executed immediately. \fIpathName \fBsync -command -\fIcommand\fR returns the return value of \fIcommand\fR. +The command returns an empty string. +.TP +\fIpathName \fBsync -command \fIcommand\fR +Schedule \fIcommand\fR to be executed exactly once as soon as all line heights +are up-to-date. If there are no pending line metrics calculations, +\fIcommand\fR is executed immediately and the command returns the return value +of \fIcommand\fR. Otherwise the command returns an empty string. +.RE .TP \fIpathName \fBtag \fIoption \fR?\fIarg arg ...\fR? This command is used to manipulate tags. The exact behavior of the -- cgit v0.12 From 7f2c3a3f39d6a76f0656cbffc7e589b1a59bc346 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 3 Dec 2015 15:49:25 +0000 Subject: Fix 64-bit MSVC build without SDK: If the MSVC version is recent enough, compiling without SDK works fine (provided that the build is configured using "--enable-64bit") --- win/configure | 12 ++++-------- win/tcl.m4 | 7 ++----- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/win/configure b/win/configure index bd48382..71f3f27 100755 --- a/win/configure +++ b/win/configure @@ -3859,15 +3859,11 @@ echo "${ECHO_T}using shared flags" >&6 ;; esac if test ! -d "${PATH64}" ; then - { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 -echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} - { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 -echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} - do64bit="no" - else - echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 -echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 + { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK" >&5 +echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK" >&2;} fi + echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 +echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 fi LIBS="user32.lib advapi32.lib ws2_32.lib" diff --git a/win/tcl.m4 b/win/tcl.m4 index 2795086..006778c 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -815,12 +815,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ ;; esac if test ! -d "${PATH64}" ; then - AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) - AC_MSG_WARN([Ensure latest Platform SDK is installed]) - do64bit="no" - else - AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) + AC_MSG_WARN([Could not find 64-bit $MACHINE SDK]) fi + AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) fi LIBS="user32.lib advapi32.lib ws2_32.lib" -- cgit v0.12 From 20e5273f5b6208576bf9bc900e4cff39d724cb7f Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 5 Dec 2015 13:31:00 +0000 Subject: Fix for bug [ff8a1e55a2] - Filling a never-mapped text widget is CPU hungry - Patch from Koen Danckaert --- generic/tkTextDisp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index cfe6e7a..0665ba7 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2923,7 +2923,8 @@ AsyncUpdateLineMetrics( return; } - if (dInfoPtr->flags & REDRAW_PENDING) { + if ((dInfoPtr->flags & REDRAW_PENDING) || !Tk_IsMapped(textPtr->tkwin) + || dInfoPtr->maxX <= dInfoPtr->x || dInfoPtr->maxY <= dInfoPtr->y) { dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(1, AsyncUpdateLineMetrics, clientData); return; -- cgit v0.12 From 1c20b0f7e0b8d0e66ff9b4325dbc2859968f52fd Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 5 Dec 2015 13:48:24 +0000 Subject: Fix for bug [1739605] - [text see] misbehaves following widget create/populate - Patch from Koen Danckaert --- generic/tkTextDisp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index cfe6e7a..851e17a 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -5237,6 +5237,15 @@ TkTextSetYView( } /* + * If the window height is smaller than the line height, prefer to make + * the top of the line visible. + */ + + if (dInfoPtr->maxY - dInfoPtr->y < lineHeight) { + bottomY = lineHeight; + } + + /* * Our job now is to arrange the display so that indexPtr appears as low * on the screen as possible but with its bottom no lower than bottomY. * BottomY is the bottom of the window if the desired line is just below -- cgit v0.12 From 98378541b701acb3b2821a3b9f1e0a23fb57bcfc Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 6 Dec 2015 19:57:34 +0000 Subject: Added non-regression test case: textDisp-11.21 --- tests/textDisp.test | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/textDisp.test b/tests/textDisp.test index 5508d7c..038eccd 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -1574,6 +1574,17 @@ test textDisp-11.20 {TkTextSetYView, see in elided lines} { # this shall not crash (null chunkPtr in TkTextSeeCmd is tested) .top.t see 3.0 } {} +test textDisp-11.21 {TkTextSetYView, window height smaller than the line height} { + .top.t delete 1.0 end + for {set i 1} {$i <= 10} {incr i} { + .top.t insert end "Line $i\n" + } + set lineheight [font metrics [.top.t cget -font] -linespace] + wm geometry .top 200x[expr {$lineheight / 2}] + update + .top.t see 1.0 + .top.t index @0,[expr {$lineheight - 2}] +} {1.0} .t configure -wrap word .t delete 50.0 51.0 -- cgit v0.12 From 6aad9c9b454d5334c3e36cd2bf623dae8369defe Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Mon, 7 Dec 2015 02:02:44 +0000 Subject: Fix for zombie windows on El Capitan/OS X 10.11; thanks to Marc Culler for patch --- macosx/tkMacOSXDialog.c | 2 +- macosx/tkMacOSXDraw.c | 16 ++++++++++++---- macosx/tkMacOSXInit.c | 6 +----- macosx/tkMacOSXNotify.c | 3 ++- macosx/tkMacOSXSubwindows.c | 3 ++- macosx/tkMacOSXWm.c | 46 ++++++++++++++++++++++++++++++++++++++++----- macosx/tkMacOSXXStubs.c | 7 ++++--- 7 files changed, 63 insertions(+), 20 deletions(-) diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index ca17195..0889ee5 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -1161,7 +1161,7 @@ Tk_MessageBoxObjCmd( [NSApp tkAlertDidEnd:alert returnCode:modalReturnCode contextInfo:callbackInfo]; } - result = (modalReturnCode < 1) ? TCL_OK : TCL_ERROR; + result = (modalReturnCode >= NSAlertFirstButtonReturn) ? TCL_OK : TCL_ERROR; end: [alert release]; return result; diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index ed8c428..bcc7afe 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -138,6 +138,7 @@ BitmapRepFromDrawableRect( CGImageRef cg_image=NULL, sub_cg_image=NULL; NSBitmapImageRep *bitmap_rep=NULL; NSView *view=NULL; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; if ( mac_drawable->flags & TK_IS_PIXMAP ) { /* This means that the MacDrawable is functioning as a Tk Pixmap, so its view @@ -174,6 +175,7 @@ BitmapRepFromDrawableRect( } else { TkMacOSXDbgMsg("Invalid source drawable"); } + [pool drain]; return bitmap_rep; } @@ -1568,7 +1570,6 @@ TkScrollWindow( /* Belt and suspenders: make the AppKit request a redraw when it gets control again. */ - [view setNeedsDisplay:YES]; } } else { dmgRgn = HIShapeCreateEmpty(); @@ -1635,6 +1636,7 @@ TkMacOSXSetupDrawingContext( int dontDraw = 0, isWin = 0; TkMacOSXDrawingContext dc = {}; CGRect clipBounds; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; dc.clipRgn = TkMacOSXGetClipRgn(d); if (!dontDraw) { @@ -1765,6 +1767,7 @@ end: dc.clipRgn = NULL; } *dcPtr = dc; + [pool drain]; return !dontDraw; } @@ -1788,6 +1791,7 @@ void TkMacOSXRestoreDrawingContext( TkMacOSXDrawingContext *dcPtr) { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; if (dcPtr->context) { CGContextSynchronize(dcPtr->context); [[dcPtr->view window] setViewsNeedDisplay:YES]; @@ -1804,6 +1808,7 @@ TkMacOSXRestoreDrawingContext( #ifdef TK_MAC_DEBUG bzero(dcPtr, sizeof(TkMacOSXDrawingContext)); #endif /* TK_MAC_DEBUG */ + [pool drain]; } /* @@ -1829,7 +1834,8 @@ TkMacOSXGetClipRgn( { MacDrawable *macDraw = (MacDrawable *) drawable; HIShapeRef clipRgn = NULL; - + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + if (macDraw->winPtr && macDraw->flags & TK_CLIP_INVALID) { TkMacOSXUpdateClipRgn(macDraw->winPtr); #ifdef TK_MAC_DEBUG_DRAWING @@ -1854,7 +1860,7 @@ TkMacOSXGetClipRgn( } else if (macDraw->visRgn) { clipRgn = HIShapeCreateCopy(macDraw->visRgn); } - + [pool drain]; return clipRgn; } @@ -1907,7 +1913,8 @@ TkpClipDrawableToRect( { MacDrawable *macDraw = (MacDrawable *) d; NSView *view = TkMacOSXDrawableView(macDraw); - + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + if (macDraw->drawRgn) { CFRelease(macDraw->drawRgn); macDraw->drawRgn = NULL; @@ -1940,6 +1947,7 @@ TkpClipDrawableToRect( macDraw->flags &= ~TK_FOCUSED_VIEW; } } + [pool drain]; } /* diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index e861089..98e6824 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -253,10 +253,7 @@ TkpInit( } #endif - static NSAutoreleasePool *pool = nil; - if (!pool) { - pool = [NSAutoreleasePool new]; - } + NSAutoreleasePool *pool = [NSAutoreleasePool new]; [[NSUserDefaults standardUserDefaults] registerDefaults: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], @@ -327,7 +324,6 @@ TkpInit( TkMacOSXUseAntialiasedText(interp, -1); TkMacOSXInitCGDrawing(interp, TRUE, 0); [pool drain]; - pool = [NSAutoreleasePool new]; /* * FIXME: Close stdin & stdout for remote debugging otherwise we will diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 1d4c6c5..3fe59bd 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -220,7 +220,7 @@ TkMacOSXEventsSetupProc( if (flags & TCL_WINDOW_EVENTS && ![[NSRunLoop currentRunLoop] currentMode]) { static const Tcl_Time zeroBlockTime = { 0, 0 }; - + NSAutoreleasePool *pool = [NSAutoreleasePool new]; /* Call this with dequeue=NO -- just checking if the queue is empty. */ NSEvent *currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] @@ -229,6 +229,7 @@ TkMacOSXEventsSetupProc( if (currentEvent && currentEvent.type > 0) { Tcl_SetMaxBlockTime(&zeroBlockTime); } + [pool drain]; } } diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 72ef39c..d23ba85 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -318,7 +318,7 @@ XResizeWindow( unsigned int height) { MacDrawable *macWin = (MacDrawable *) window; - + NSAutoreleasePool *pool= [NSAutoreleasePool new]; display->request++; if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) { NSWindow *w = macWin->winPtr->wmInfoPtr->window; @@ -333,6 +333,7 @@ XResizeWindow( } else { MoveResizeWindow(macWin); } + [pool drain]; } /* diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index fb58904..5ec38ca 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -386,6 +386,7 @@ static void RemapWindows(TkWindow *winPtr, @end @implementation TKWindow(TKWm) + - (BOOL) canBecomeKeyWindow { TkWindow *winPtr = TkMacOSXGetTkWindow(self); @@ -395,16 +396,38 @@ static void RemapWindows(TkWindow *winPtr, kWindowNoActivatesAttribute)) ? NO : YES; } +#if DEBUG_ZOMBIES - (id) retain { -#if DEBUG_ZOMBIES + id result = [super retain]; const char *title = [[self title] UTF8String]; - if (title != NULL) { - printf("Retaining %s with count %lu\n", title, [self retainCount]); + if (title == nil) { + title = "unnamed window"; } -#endif - return [super retain]; + printf("Retained <%s>. Count is: %lu\n", title, [self retainCount]); + return result; +} + +- (id) autorelease +{ + id result = [super autorelease]; + const char *title = [[self title] UTF8String]; + if (title == nil) { + title = "unnamed window"; + } + printf("Autoreleased <%s>. Count is %lu\n", title, [self retainCount]); + return result; +} + +- (oneway void) release { + const char *title = [[self title] UTF8String]; + if (title == nil) { + title = "unnamed window"; + } + printf("Releasing <%s>. Count is %lu\n", title, [self retainCount]); + [super release]; } +#endif @end #pragma mark - @@ -842,6 +865,15 @@ TkWmDeadWindow( if (winPtr->window) { ((MacDrawable *) winPtr->window)->view = nil; } +#if DEBUG_ZOMBIES + { + const char *title = [[window title] UTF8String]; + if (title == nil) { + title = "unnamed window"; + } + printf("Closing <%s>. Count is: %lu\n", title, [window retainCount]); + } +#endif [window release]; wmPtr->window = NULL; /* Activate the highest window left on the screen. */ @@ -5507,6 +5539,8 @@ TkMacOSXMakeRealWindowExist( */ } + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + WindowClass macClass = wmPtr->macClass; wmPtr->attributes &= (tkAlwaysValidAttributes | macClassAttrs[macClass].validAttrs); @@ -5590,6 +5624,8 @@ TkMacOSXMakeRealWindowExist( TkMacOSXRegisterOffScreenWindow((Window) macWin, window); macWin->flags |= TK_HOST_EXISTS; + + [pool drain]; } /* diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index e87bb39..c39d42d 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -142,7 +142,7 @@ TkpOpenDisplay( static NSRect maxBounds = {{0, 0}, {0, 0}}; static char vendor[25] = ""; NSArray *cgVers; - NSAutoreleasePool *pool; + if (gMacDisplay != NULL) { if (strcmp(gMacDisplay->display->display_name, display_name) == 0) { @@ -152,6 +152,8 @@ TkpOpenDisplay( } } + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + display = ckalloc(sizeof(Display)); screen = ckalloc(sizeof(Screen)); bzero(display, sizeof(Display)); @@ -166,7 +168,6 @@ TkpOpenDisplay( display->default_screen = 0; display->display_name = (char *) macScreenName; - pool = [NSAutoreleasePool new]; cgVers = [[[NSBundle bundleWithIdentifier:@"com.apple.CoreGraphics"] objectForInfoDictionaryKey:@"CFBundleShortVersionString"] componentsSeparatedByString:@"."]; @@ -184,7 +185,7 @@ TkpOpenDisplay( { int major, minor, patch; -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 10100 Gestalt(gestaltSystemVersionMajor, (SInt32*)&major); Gestalt(gestaltSystemVersionMinor, (SInt32*)&minor); Gestalt(gestaltSystemVersionBugFix, (SInt32*)&patch); -- cgit v0.12 From e82200cb0ca4389ea75f8ae0c2096358a985c14e Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Mon, 7 Dec 2015 02:04:45 +0000 Subject: Fix for zombie windows on El Capitan/OS X 10.11; thanks to Marc Culler for patch --- macosx/tkMacOSXDialog.c | 2 +- macosx/tkMacOSXDraw.c | 16 ++++++++++++---- macosx/tkMacOSXInit.c | 6 +----- macosx/tkMacOSXNotify.c | 2 ++ macosx/tkMacOSXSubwindows.c | 3 ++- macosx/tkMacOSXWm.c | 46 ++++++++++++++++++++++++++++++++++++++++----- macosx/tkMacOSXXStubs.c | 6 +++--- 7 files changed, 62 insertions(+), 19 deletions(-) diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 9cd9cf3..eebff3c 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -1158,7 +1158,7 @@ Tk_MessageBoxObjCmd( [NSApp tkAlertDidEnd:alert returnCode:modalReturnCode contextInfo:callbackInfo]; } - result = (modalReturnCode < 1) ? TCL_OK : TCL_ERROR; + result = (modalReturnCode >= NSAlertFirstButtonReturn) ? TCL_OK : TCL_ERROR; end: [alert release]; return result; diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 45a07c7..b3c2499 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -138,6 +138,7 @@ BitmapRepFromDrawableRect( CGImageRef cg_image=NULL, sub_cg_image=NULL; NSBitmapImageRep *bitmap_rep=NULL; NSView *view=NULL; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; if ( mac_drawable->flags & TK_IS_PIXMAP ) { /* This means that the MacDrawable is functioning as a Tk Pixmap, so its view @@ -174,6 +175,7 @@ BitmapRepFromDrawableRect( } else { TkMacOSXDbgMsg("Invalid source drawable"); } + [pool drain]; return bitmap_rep; } @@ -1568,7 +1570,6 @@ TkScrollWindow( /* Belt and suspenders: make the AppKit request a redraw when it gets control again. */ - [view setNeedsDisplay:YES]; } } else { dmgRgn = HIShapeCreateEmpty(); @@ -1635,6 +1636,7 @@ TkMacOSXSetupDrawingContext( int dontDraw = 0, isWin = 0; TkMacOSXDrawingContext dc = {}; CGRect clipBounds; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; dc.clipRgn = TkMacOSXGetClipRgn(d); if (!dontDraw) { @@ -1765,6 +1767,7 @@ end: dc.clipRgn = NULL; } *dcPtr = dc; + [pool drain]; return !dontDraw; } @@ -1788,6 +1791,7 @@ void TkMacOSXRestoreDrawingContext( TkMacOSXDrawingContext *dcPtr) { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; if (dcPtr->context) { CGContextSynchronize(dcPtr->context); [[dcPtr->view window] setViewsNeedDisplay:YES]; @@ -1804,6 +1808,7 @@ TkMacOSXRestoreDrawingContext( #ifdef TK_MAC_DEBUG bzero(dcPtr, sizeof(TkMacOSXDrawingContext)); #endif /* TK_MAC_DEBUG */ + [pool drain]; } /* @@ -1829,7 +1834,8 @@ TkMacOSXGetClipRgn( { MacDrawable *macDraw = (MacDrawable *) drawable; HIShapeRef clipRgn = NULL; - + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + if (macDraw->winPtr && macDraw->flags & TK_CLIP_INVALID) { TkMacOSXUpdateClipRgn(macDraw->winPtr); #ifdef TK_MAC_DEBUG_DRAWING @@ -1854,7 +1860,7 @@ TkMacOSXGetClipRgn( } else if (macDraw->visRgn) { clipRgn = HIShapeCreateCopy(macDraw->visRgn); } - + [pool drain]; return clipRgn; } @@ -1907,7 +1913,8 @@ TkpClipDrawableToRect( { MacDrawable *macDraw = (MacDrawable *) d; NSView *view = TkMacOSXDrawableView(macDraw); - + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + if (macDraw->drawRgn) { CFRelease(macDraw->drawRgn); macDraw->drawRgn = NULL; @@ -1940,6 +1947,7 @@ TkpClipDrawableToRect( macDraw->flags &= ~TK_FOCUSED_VIEW; } } + [pool drain]; } /* diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 6ba726d..8e5479e 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -242,10 +242,7 @@ TkpInit( } #endif - static NSAutoreleasePool *pool = nil; - if (!pool) { - pool = [NSAutoreleasePool new]; - } + NSAutoreleasePool *pool = [NSAutoreleasePool new]; [[NSUserDefaults standardUserDefaults] registerDefaults: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], @@ -316,7 +313,6 @@ TkpInit( TkMacOSXUseAntialiasedText(interp, -1); TkMacOSXInitCGDrawing(interp, TRUE, 0); [pool drain]; - pool = [NSAutoreleasePool new]; /* * FIXME: Close stdin & stdout for remote debugging otherwise we will diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 4cfb5a9..c703297 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -215,6 +215,7 @@ TkMacOSXEventsSetupProc( if (flags & TCL_WINDOW_EVENTS && ![[NSRunLoop currentRunLoop] currentMode]) { static Tcl_Time zeroBlockTime = { 0, 0 }; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; /* Call this with dequeue=NO -- just checking if the queue is empty. */ NSEvent *currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] @@ -223,6 +224,7 @@ TkMacOSXEventsSetupProc( if (currentEvent && currentEvent.type > 0) { Tcl_SetMaxBlockTime(&zeroBlockTime); } + [pool drain]; } } diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index a601c50..b985e5d 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -318,7 +318,7 @@ XResizeWindow( unsigned int height) { MacDrawable *macWin = (MacDrawable *) window; - + NSAutoreleasePool *pool= [NSAutoreleasePool new]; display->request++; if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) { NSWindow *w = macWin->winPtr->wmInfoPtr->window; @@ -333,6 +333,7 @@ XResizeWindow( } else { MoveResizeWindow(macWin); } + [pool drain]; } /* diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 69d3cfb..4ce2206 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -390,6 +390,7 @@ static void RemapWindows(TkWindow *winPtr, @end @implementation TKWindow(TKWm) + - (BOOL) canBecomeKeyWindow { TkWindow *winPtr = TkMacOSXGetTkWindow(self); @@ -399,16 +400,38 @@ static void RemapWindows(TkWindow *winPtr, kWindowNoActivatesAttribute)) ? NO : YES; } +#if DEBUG_ZOMBIES - (id) retain { -#if DEBUG_ZOMBIES + id result = [super retain]; const char *title = [[self title] UTF8String]; - if (title != NULL) { - printf("Retaining %s with count %lu\n", title, [self retainCount]); + if (title == nil) { + title = "unnamed window"; } -#endif - return [super retain]; + printf("Retained <%s>. Count is: %lu\n", title, [self retainCount]); + return result; +} + +- (id) autorelease +{ + id result = [super autorelease]; + const char *title = [[self title] UTF8String]; + if (title == nil) { + title = "unnamed window"; + } + printf("Autoreleased <%s>. Count is %lu\n", title, [self retainCount]); + return result; +} + +- (oneway void) release { + const char *title = [[self title] UTF8String]; + if (title == nil) { + title = "unnamed window"; + } + printf("Releasing <%s>. Count is %lu\n", title, [self retainCount]); + [super release]; } +#endif @end #pragma mark - @@ -847,6 +870,15 @@ TkWmDeadWindow( if (winPtr->window) { ((MacDrawable *) winPtr->window)->view = nil; } +#if DEBUG_ZOMBIES + { + const char *title = [[window title] UTF8String]; + if (title == nil) { + title = "unnamed window"; + } + printf("Closing <%s>. Count is: %lu\n", title, [window retainCount]); + } +#endif [window release]; wmPtr->window = NULL; /* Activate the highest window left on the screen. */ @@ -5447,6 +5479,8 @@ TkMacOSXMakeRealWindowExist( */ } + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + WindowClass macClass = wmPtr->macClass; wmPtr->attributes &= (tkAlwaysValidAttributes | macClassAttrs[macClass].validAttrs); @@ -5530,6 +5564,8 @@ TkMacOSXMakeRealWindowExist( TkMacOSXRegisterOffScreenWindow((Window) macWin, window); macWin->flags |= TK_HOST_EXISTS; + + [pool drain]; } /* diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index f8adf1e..4bdd1c4 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -142,7 +142,6 @@ TkpOpenDisplay( static NSRect maxBounds = {{0, 0}, {0, 0}}; static char vendor[25] = ""; NSArray *cgVers; - NSAutoreleasePool *pool; if (gMacDisplay != NULL) { if (strcmp(gMacDisplay->display->display_name, display_name) == 0) { @@ -152,6 +151,8 @@ TkpOpenDisplay( } } + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + display = (Display *) ckalloc(sizeof(Display)); screen = (Screen *) ckalloc(sizeof(Screen)); bzero(display, sizeof(Display)); @@ -166,7 +167,6 @@ TkpOpenDisplay( display->default_screen = 0; display->display_name = (char *) macScreenName; - pool = [NSAutoreleasePool new]; cgVers = [[[NSBundle bundleWithIdentifier:@"com.apple.CoreGraphics"] objectForInfoDictionaryKey:@"CFBundleShortVersionString"] componentsSeparatedByString:@"."]; @@ -184,7 +184,7 @@ TkpOpenDisplay( { int major, minor, patch; -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 10100 Gestalt(gestaltSystemVersionMajor, (SInt32*)&major); Gestalt(gestaltSystemVersionMinor, (SInt32*)&minor); Gestalt(gestaltSystemVersionBugFix, (SInt32*)&patch); -- cgit v0.12 From c1c79b52233b43b276d2b2933dade1563b16f0c5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 7 Dec 2015 21:29:13 +0000 Subject: Reverted [d29847c6] since there is a better patch --- generic/tkTextDisp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 0665ba7..cfe6e7a 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2923,8 +2923,7 @@ AsyncUpdateLineMetrics( return; } - if ((dInfoPtr->flags & REDRAW_PENDING) || !Tk_IsMapped(textPtr->tkwin) - || dInfoPtr->maxX <= dInfoPtr->x || dInfoPtr->maxY <= dInfoPtr->y) { + if (dInfoPtr->flags & REDRAW_PENDING) { dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(1, AsyncUpdateLineMetrics, clientData); return; -- cgit v0.12 From 7aa2342349dcaec45b76ecf2f5c6b0fe8ec33ae1 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 7 Dec 2015 21:36:25 +0000 Subject: Better patch for bug [ff8a1e55a2] - Filling a never-mapped text widget is CPU hungry - Patch from Koen Danckaert --- generic/tkTextDisp.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index cfe6e7a..8a9d0e8 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -658,17 +658,8 @@ TkTextCreateDInfo( dInfoPtr->metricEpoch = -1; dInfoPtr->metricIndex.textPtr = NULL; dInfoPtr->metricIndex.linePtr = NULL; - - /* - * Add a refCount for each of the idle call-backs. - */ - - textPtr->refCount++; - dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(0, - AsyncUpdateLineMetrics, (ClientData) textPtr); - textPtr->refCount++; - dInfoPtr->scrollbarTimer = Tcl_CreateTimerHandler(200, - AsyncUpdateYScrollbar, (ClientData) textPtr); + dInfoPtr->lineUpdateTimer = NULL; + dInfoPtr->scrollbarTimer = NULL; textPtr->dInfoPtr = dInfoPtr; } @@ -2912,9 +2903,10 @@ AsyncUpdateLineMetrics( dInfoPtr->lineUpdateTimer = NULL; - if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { + if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED) + || !Tk_IsMapped(textPtr->tkwin)) { /* - * The widget has been deleted. Don't do anything. + * The widget has been deleted, or is not mapped. Don't do anything. */ if (--textPtr->refCount == 0) { -- cgit v0.12 From 4ffa86ad7e16a62ad85e9fcaeeeeec8b054b66e3 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 10 Dec 2015 17:07:13 +0000 Subject: Removed duplicate test: 'entry-23.1' in spinbox.test is the same as 'entry-21.1' in entry.test --- tests/spinbox.test | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tests/spinbox.test b/tests/spinbox.test index 430e176..88e4d44 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -1568,20 +1568,6 @@ test spinbox-22.3 {spinbox config, -from changes SF bug 559078} { set val } {6} -test entry-23.1 {selection present while disabled, bug 637828} { - destroy .e - entry .e - .e insert end 0123456789 - .e select from 3 - .e select to 6 - set out [.e selection present] - .e configure -state disabled - # still return 1 when disabled, because 'selection get' will work, - # but selection cannot be changed (new behavior since 8.4) - .e select to 9 - lappend out [.e selection present] [selection get] -} {1 1 345} - destroy .e catch {unset ::e ::vVals} -- cgit v0.12 From 2f823dce353535fda34fff8883078e034675eec3 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 10 Dec 2015 17:21:07 +0000 Subject: Fixed bug [1700065] - error in trace proc on textvariable doesn't trigger bgerror --- generic/tkEntry.c | 88 ++++++++++++++++++++++++++++++++++++++---------------- tests/entry.test | 21 ++++++++++--- tests/spinbox.test | 15 ++++++++++ 3 files changed, 94 insertions(+), 30 deletions(-) diff --git a/generic/tkEntry.c b/generic/tkEntry.c index f6ff9b9..a303bea 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -391,7 +391,7 @@ static const char *selElementNames[] = { static int ConfigureEntry(Tcl_Interp *interp, Entry *entryPtr, int objc, Tcl_Obj *const objv[], int flags); -static void DeleteChars(Entry *entryPtr, int index, int count); +static int DeleteChars(Entry *entryPtr, int index, int count); static void DestroyEntry(char *memPtr); static void DisplayEntry(ClientData clientData); static void EntryBlinkProc(ClientData clientData); @@ -417,7 +417,7 @@ static int EntryValidateChange(Entry *entryPtr, char *change, static void ExpandPercents(Entry *entryPtr, const char *before, const char *change, const char *newStr, int index, int type, Tcl_DString *dsPtr); -static void EntryValueChanged(Entry *entryPtr, +static int EntryValueChanged(Entry *entryPtr, const char *newValue); static void EntryVisibleRange(Entry *entryPtr, double *firstPtr, double *lastPtr); @@ -427,7 +427,7 @@ static int EntryWidgetObjCmd(ClientData clientData, static void EntryWorldChanged(ClientData instanceData); static int GetEntryIndex(Tcl_Interp *interp, Entry *entryPtr, char *string, int *indexPtr); -static void InsertChars(Entry *entryPtr, int index, char *string); +static int InsertChars(Entry *entryPtr, int index, char *string); /* * These forward declarations are the spinbox specific ones: @@ -663,7 +663,7 @@ EntryWidgetObjCmd( break; case COMMAND_DELETE: { - int first, last; + int first, last, code; if ((objc < 3) || (objc > 4)) { Tcl_WrongNumArgs(interp, 2, objv, "firstIndex ?lastIndex?"); @@ -680,7 +680,10 @@ EntryWidgetObjCmd( goto error; } if ((last >= first) && (entryPtr->state == STATE_NORMAL)) { - DeleteChars(entryPtr, first, last - first); + code = DeleteChars(entryPtr, first, last - first); + if (code != TCL_OK) { + goto error; + } } break; } @@ -721,7 +724,7 @@ EntryWidgetObjCmd( } case COMMAND_INSERT: { - int index; + int index, code; if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "index text"); @@ -732,7 +735,10 @@ EntryWidgetObjCmd( goto error; } if (entryPtr->state == STATE_NORMAL) { - InsertChars(entryPtr, index, Tcl_GetString(objv[3])); + code = InsertChars(entryPtr, index, Tcl_GetString(objv[3])); + if (code != TCL_OK) { + goto error; + } } break; } @@ -1291,6 +1297,9 @@ ConfigureEntry( /* * If the entry is tied to the value of a variable, create the variable if * it doesn't exist, and set the entry's value from the variable's value. + * No checking of the return value of EntryValueChanged is needed since it + * can only return TCL_ERROR if there is a trace on the textvariable and + * since any existing trace on it was eliminated above. */ if (entryPtr->textVarName != NULL) { @@ -1999,7 +2008,7 @@ EntryComputeGeometry( *---------------------------------------------------------------------- */ -static void +static int InsertChars( Entry *entryPtr, /* Entry that is to get the new elements. */ int index, /* Add the new elements before this character @@ -2017,7 +2026,7 @@ InsertChars( byteIndex = Tcl_UtfAtIndex(string, index) - string; byteCount = strlen(value); if (byteCount == 0) { - return; + return TCL_OK; } newByteCount = entryPtr->numBytes + byteCount + 1; @@ -2031,7 +2040,7 @@ InsertChars( EntryValidateChange(entryPtr, value, newStr, index, VALIDATE_INSERT) != TCL_OK) { ckfree(newStr); - return; + return TCL_OK; } ckfree((char *)string); @@ -2079,7 +2088,7 @@ InsertChars( if (entryPtr->insertPos >= index) { entryPtr->insertPos += charsAdded; } - EntryValueChanged(entryPtr, NULL); + return EntryValueChanged(entryPtr, NULL); } /* @@ -2099,7 +2108,7 @@ InsertChars( *---------------------------------------------------------------------- */ -static void +static int DeleteChars( Entry *entryPtr, /* Entry widget to modify. */ int index, /* Index of first character to delete. */ @@ -2113,7 +2122,7 @@ DeleteChars( count = entryPtr->numChars - index; } if (count <= 0) { - return; + return TCL_OK; } string = entryPtr->string; @@ -2135,7 +2144,7 @@ DeleteChars( VALIDATE_DELETE) != TCL_OK) { ckfree(newStr); ckfree(toDelete); - return; + return TCL_OK; } ckfree(toDelete); @@ -2194,7 +2203,7 @@ DeleteChars( entryPtr->insertPos = index; } } - EntryValueChanged(entryPtr, NULL); + return EntryValueChanged(entryPtr, NULL); } /* @@ -2215,7 +2224,7 @@ DeleteChars( *---------------------------------------------------------------------- */ -static void +static int EntryValueChanged( Entry *entryPtr, /* Entry whose value just changed. */ const char *newValue) /* If this value is not NULL, we first force @@ -2229,7 +2238,7 @@ EntryValueChanged( newValue = NULL; } else { newValue = Tcl_SetVar(entryPtr->interp, entryPtr->textVarName, - entryPtr->string, TCL_GLOBAL_ONLY); + entryPtr->string, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG); } if ((newValue != NULL) && (strcmp(newValue, entryPtr->string) != 0)) { @@ -2251,6 +2260,17 @@ EntryValueChanged( EntryComputeGeometry(entryPtr); EventuallyRedraw(entryPtr); } + + /* + * An error may have happened when setting the textvariable in case there + * is a trace on that variable and the trace proc triggered an error. + * Signal this error. + */ + + if ((entryPtr->textVarName != NULL) && (newValue == NULL)) { + return TCL_ERROR; + } + return TCL_OK; } /* @@ -3703,7 +3723,7 @@ SpinboxWidgetObjCmd( break; case SB_CMD_DELETE: { - int first, last; + int first, last, code; if ((objc < 3) || (objc > 4)) { Tcl_WrongNumArgs(interp, 2, objv, "firstIndex ?lastIndex?"); @@ -3722,7 +3742,10 @@ SpinboxWidgetObjCmd( } } if ((last >= first) && (entryPtr->state == STATE_NORMAL)) { - DeleteChars(entryPtr, first, last - first); + code = DeleteChars(entryPtr, first, last - first); + if (code != TCL_OK) { + goto error; + } } break; } @@ -3782,7 +3805,7 @@ SpinboxWidgetObjCmd( } case SB_CMD_INSERT: { - int index; + int index, code; if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "index text"); @@ -3793,7 +3816,10 @@ SpinboxWidgetObjCmd( goto error; } if (entryPtr->state == STATE_NORMAL) { - InsertChars(entryPtr, index, Tcl_GetString(objv[3])); + code = InsertChars(entryPtr, index, Tcl_GetString(objv[3])); + if (code != TCL_OK) { + goto error; + } } break; } @@ -4001,16 +4027,22 @@ SpinboxWidgetObjCmd( break; } - case SB_CMD_SET: + case SB_CMD_SET: { + int code = TCL_OK; + if (objc > 3) { Tcl_WrongNumArgs(interp, 2, objv, "?string?"); goto error; } if (objc == 3) { - EntryValueChanged(entryPtr, Tcl_GetString(objv[2])); + code = EntryValueChanged(entryPtr, Tcl_GetString(objv[2])); + if (code != TCL_OK) { + goto error; + } } Tcl_SetStringObj(Tcl_GetObjResult(interp), entryPtr->string, -1); break; + } case SB_CMD_VALIDATE: { int code; @@ -4151,7 +4183,7 @@ GetSpinboxElement( * TCL_OK. * * Side effects: - * An background error condition may arise when invoking the callback. + * A background error condition may arise when invoking the callback. * The widget value may change. * *-------------------------------------------------------------- @@ -4182,6 +4214,7 @@ SpinboxInvoke( return TCL_OK; } + code = TCL_OK; if (fabs(sbPtr->increment) > MIN_DBL_VAL) { if (sbPtr->listObj != NULL) { Tcl_Obj *objPtr; @@ -4227,7 +4260,7 @@ SpinboxInvoke( } } Tcl_ListObjIndex(interp, sbPtr->listObj, sbPtr->eIndex, &objPtr); - EntryValueChanged(entryPtr, Tcl_GetString(objPtr)); + code = EntryValueChanged(entryPtr, Tcl_GetString(objPtr)); } else if (!DOUBLES_EQ(sbPtr->fromValue, sbPtr->toValue)) { double dvalue; @@ -4274,9 +4307,12 @@ SpinboxInvoke( } } sprintf(sbPtr->formatBuf, sbPtr->valueFormat, dvalue); - EntryValueChanged(entryPtr, sbPtr->formatBuf); + code = EntryValueChanged(entryPtr, sbPtr->formatBuf); } } + if (code != TCL_OK) { + return TCL_ERROR; + } if (sbPtr->command != NULL) { Tcl_DStringInit(&script); diff --git a/tests/entry.test b/tests/entry.test index 27acfc1..da8f280 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -1621,13 +1621,26 @@ test entry-22.1 {lost namespaced textvar} { namespace eval test { variable foo {a b} } entry .e -textvariable ::test::foo namespace delete test - .e insert end "more stuff" - .e delete 5 end - catch {set ::test::foo} result - list [.e get] [.e cget -textvar] $result + catch {.e insert end "more stuff"} result1 + catch {.e delete 5 end} result2 + catch {set ::test::foo} result3 + list [.e get] [.e cget -textvar] $result1 $result2 $result3 } [list "a bmo" ::test::foo \ + {can't set "::test::foo": parent namespace doesn't exist} \ + {can't set "::test::foo": parent namespace doesn't exist} \ {can't read "::test::foo": no such variable}] +test entry-23.1 {error in trace proc attached to the textvariable} { + destroy .e + trace variable myvar w traceit + proc traceit args {error "Intentional error here!"} + entry .e -textvariable myvar + catch {.e insert end mystring} result1 + catch {.e delete 0} result2 + list $result1 $result2 +} [list {can't set "myvar": Intentional error here!} \ + {can't set "myvar": Intentional error here!}] + destroy .e # XXX Still need to write tests for EntryBlinkProc, EntryFocusProc, diff --git a/tests/spinbox.test b/tests/spinbox.test index 88e4d44..e8f027b 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -1568,6 +1568,21 @@ test spinbox-22.3 {spinbox config, -from changes SF bug 559078} { set val } {6} +test spinbox-23.1 {error in trace proc attached to the textvariable} { + destroy .s + trace variable myvar w traceit + proc traceit args {error "Intentional error here!"} + spinbox .s -textvariable myvar -from 1 -to 10 + catch {.s set mystring} result1 + catch {.s insert 0 mystring} result2 + catch {.s delete 0} result3 + catch {.s invoke buttonup} result4 + list $result1 $result2 $result3 $result4 +} [list {can't set "myvar": Intentional error here!} \ + {can't set "myvar": Intentional error here!} \ + {can't set "myvar": Intentional error here!} \ + {can't set "myvar": Intentional error here!}] + destroy .e catch {unset ::e ::vVals} -- cgit v0.12 From fbcd240c74caa743dc1fef3f144cd2154895befc Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 11 Dec 2015 10:43:41 +0000 Subject: Reverted [30c7d14b21], but really use a spinbox and not an entry for the test... --- tests/spinbox.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/spinbox.test b/tests/spinbox.test index 88e4d44..0661635 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -1568,6 +1568,20 @@ test spinbox-22.3 {spinbox config, -from changes SF bug 559078} { set val } {6} +test spinbox-23.1 {selection present while disabled, bug 637828} { + destroy .e + spinbox .e + .e insert end 0123456789 + .e select from 3 + .e select to 6 + set out [.e selection present] + .e configure -state disabled + # still return 1 when disabled, because 'selection get' will work, + # but selection cannot be changed (new behavior since 8.4) + .e select to 9 + lappend out [.e selection present] [selection get] +} {1 1 345} + destroy .e catch {unset ::e ::vVals} -- cgit v0.12 From 656997252224e4bbfea9417b0ab6d1eca66f5a02 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 11 Dec 2015 10:44:56 +0000 Subject: Reverted [aaf6b1a3a0] --- tests/spinbox.test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/spinbox.test b/tests/spinbox.test index 0f41379..b8170c5 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -3775,6 +3775,22 @@ test spinbox-22.3 {spinbox config, -from changes SF bug 559078} -body { destroy .e } -result {6} +test spinbox-23.1 {selection present while disabled, bug 637828} -body { + spinbox .e + .e insert end 0123456789 + .e select from 3 + .e select to 6 + set out [.e selection present] + .e configure -state disabled +# still return 1 when disabled, because 'selection get' will work, +# but selection cannot be changed (new behavior since 8.4) + .e select to 9 + lappend out [.e selection present] [selection get] +} -cleanup { + destroy .e +} -result {1 1 345} + + # Collected comments about lacks from the test # XXX Still need to write tests for SpinboxBlinkProc, SpinboxFocusProc, # and SpinboxTextVarProc. -- cgit v0.12 From 7310553ebcfd9493614bbc345b30b0a747bef92d Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 12 Dec 2015 14:42:51 +0000 Subject: Updated header comments of EntryValueChanged, InsertChars and DeleteChars since they now return a Tcl result --- generic/tkEntry.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/generic/tkEntry.c b/generic/tkEntry.c index a303bea..dd753f0 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -1999,7 +1999,8 @@ EntryComputeGeometry( * Add new characters to an entry widget. * * Results: - * None. + * A standard Tcl result. If an error occurred then an error message is + * left in the interp's result. * * Side effects: * New information gets added to entryPtr; it will be redisplayed soon, @@ -2099,7 +2100,8 @@ InsertChars( * Remove one or more characters from an entry widget. * * Results: - * None. + * A standard Tcl result. If an error occurred then an error message is + * left in the interp's result. * * Side effects: * Memory gets freed, the entry gets modified and (eventually) @@ -2216,7 +2218,8 @@ DeleteChars( * is one, and does other bookkeeping such as arranging for redisplay. * * Results: - * None. + * A standard Tcl result. If an error occurred then an error message is + * left in the interp's result. * * Side effects: * None. -- cgit v0.12 From 206fdec2adc973a08951dafa6b30a911e82918d5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 12 Dec 2015 16:01:18 +0000 Subject: Fixed bug [793909] - Problem with nonexistent namespaces --- generic/tkEntry.c | 38 ++++++++++++++++++++++++++++++++------ tests/entry.test | 6 ++++++ tests/spinbox.test | 6 ++++++ 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/generic/tkEntry.c b/generic/tkEntry.c index dd753f0..338652b 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -1102,6 +1102,7 @@ ConfigureEntry( int valuesChanged = 0; /* lint initialization */ double oldFrom = 0.0; /* lint initialization */ double oldTo = 0.0; /* lint initialization */ + int code; /* * Eliminate any existing trace on a variable monitored by the entry. @@ -1297,9 +1298,6 @@ ConfigureEntry( /* * If the entry is tied to the value of a variable, create the variable if * it doesn't exist, and set the entry's value from the variable's value. - * No checking of the return value of EntryValueChanged is needed since it - * can only return TCL_ERROR if there is a trace on the textvariable and - * since any existing trace on it was eliminated above. */ if (entryPtr->textVarName != NULL) { @@ -1307,6 +1305,17 @@ ConfigureEntry( value = Tcl_GetVar(interp, entryPtr->textVarName, TCL_GLOBAL_ONLY); if (value == NULL) { + + /* + * Since any trace on the textvariable was eliminated above, + * the only possible reason for EntryValueChanged to return + * an error is that the textvariable lives in a namespace + * that does not (yet) exist. Indeed, namespaces are not + * automatically created as needed. Don't trap this error + * here, better do it below when attempting to trace the + * variable. + */ + EntryValueChanged(entryPtr, NULL); } else { EntrySetValue(entryPtr, value); @@ -1325,7 +1334,13 @@ ConfigureEntry( */ Tcl_ListObjIndex(interp, sbPtr->listObj, 0, &objPtr); - EntryValueChanged(entryPtr, Tcl_GetString(objPtr)); + + /* + * No check for error return here as well, because any possible + * error will be trapped below when attempting tracing. + */ + + EntryValueChanged(entryPtr, Tcl_GetString(objPtr)); } else if ((sbPtr->valueStr == NULL) && !DOUBLES_EQ(sbPtr->fromValue, sbPtr->toValue) && (!DOUBLES_EQ(sbPtr->fromValue, oldFrom) @@ -1350,6 +1365,12 @@ ConfigureEntry( } } sprintf(sbPtr->formatBuf, sbPtr->valueFormat, dvalue); + + /* + * No check for error return here as well, because any possible + * error will be trapped below when attempting tracing. + */ + EntryValueChanged(entryPtr, sbPtr->formatBuf); } } @@ -1361,10 +1382,13 @@ ConfigureEntry( if ((entryPtr->textVarName != NULL) && !(entryPtr->flags & ENTRY_VAR_TRACED)) { - Tcl_TraceVar(interp, entryPtr->textVarName, + code = Tcl_TraceVar(interp, entryPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, EntryTextVarProc, (ClientData) entryPtr); - entryPtr->flags |= ENTRY_VAR_TRACED; + if (code != TCL_OK) { + return TCL_ERROR; + } + entryPtr->flags |= ENTRY_VAR_TRACED; } EntryWorldChanged((ClientData) entryPtr); @@ -2267,6 +2291,8 @@ EntryValueChanged( /* * An error may have happened when setting the textvariable in case there * is a trace on that variable and the trace proc triggered an error. + * Another possibility is that the textvariable is in a namespace that + * does not (yet) exist. * Signal this error. */ diff --git a/tests/entry.test b/tests/entry.test index da8f280..da3637d 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -1641,6 +1641,12 @@ test entry-23.1 {error in trace proc attached to the textvariable} { } [list {can't set "myvar": Intentional error here!} \ {can't set "myvar": Intentional error here!}] +test entry-24.1 {textvariable lives in a non-existing namespace} { + destroy .e + catch {entry .e -textvariable thisnsdoesntexist::myvar} result1 + set result1 +} {can't trace "thisnsdoesntexist::myvar": parent namespace doesn't exist} + destroy .e # XXX Still need to write tests for EntryBlinkProc, EntryFocusProc, diff --git a/tests/spinbox.test b/tests/spinbox.test index 5fba390..68c6fae 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -1599,6 +1599,12 @@ test spinbox-24.1 {error in trace proc attached to the textvariable} { {can't set "myvar": Intentional error here!} \ {can't set "myvar": Intentional error here!}] +test spinbox-25.1 {textvariable lives in a non-existing namespace} { + destroy .s + catch {spinbox .s -textvariable thisnsdoesntexist::myvar} result1 + set result1 +} {can't trace "thisnsdoesntexist::myvar": parent namespace doesn't exist} + catch {unset ::e ::vVals} ## -- cgit v0.12 From ff45ebd61fc2390dcfe72e451ddc579fe1bca4bc Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 13 Dec 2015 20:58:26 +0000 Subject: Better (and more correct) description of what [.text sync -command $command] does --- doc/text.n | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/text.n b/doc/text.n index 1966882..c55b4cf 100644 --- a/doc/text.n +++ b/doc/text.n @@ -1794,9 +1794,9 @@ The command returns an empty string. .TP \fIpathName \fBsync -command \fIcommand\fR Schedule \fIcommand\fR to be executed exactly once as soon as all line heights -are up-to-date. If there are no pending line metrics calculations, -\fIcommand\fR is executed immediately and the command returns the return value -of \fIcommand\fR. Otherwise the command returns an empty string. +are up-to-date. If there are no pending line metrics calculations, the +scheduling is immediate. The command returns the empty string. \fBbgerror\fR is +called on \fIcommand\fR failure. .RE .TP \fIpathName \fBtag \fIoption \fR?\fIarg arg ...\fR? -- cgit v0.12 From f98486f81600c792bfb248f8f8eb87058f2d1040 Mon Sep 17 00:00:00 2001 From: oehhar Date: Mon, 14 Dec 2015 10:00:01 +0000 Subject: Support to paste file list (e.g. support CF_HDROPtype) Ticket [9fcc519a7c] --- win/tkWinClipboard.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) mode change 100644 => 100755 win/tkWinClipboard.c diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c old mode 100644 new mode 100755 index 2501688..a616af5 --- a/win/tkWinClipboard.c +++ b/win/tkWinClipboard.c @@ -12,6 +12,7 @@ #include "tkWinInt.h" #include "tkSelect.h" +#include /* for DROPFILES */ static void UpdateClipboard(HWND hwnd); @@ -52,7 +53,7 @@ TkSelGetSelection( Tcl_DString ds; HGLOBAL handle; Tcl_Encoding encoding; - int result, locale; + int result, locale, noBackslash = 0; if ((selection != Tk_InternAtom(tkwin, "CLIPBOARD")) || (target != XA_STRING) @@ -132,7 +133,37 @@ TkSelGetSelection( if (encoding) { Tcl_FreeEncoding(encoding); } - + } else if (IsClipboardFormatAvailable(CF_HDROP)) { + DROPFILES *drop; + + handle = GetClipboardData(CF_HDROP); + if (!handle) { + CloseClipboard(); + goto error; + } + Tcl_DStringInit(&ds); + drop = (DROPFILES *) GlobalLock(handle); + if (drop->fWide) { + WCHAR *fname = (WCHAR *) ((char *) drop + drop->pFiles); + Tcl_DString dsTmp; + int count = 0, len; + + while (*fname != 0) { + if (count) { + Tcl_DStringAppend(&ds, "\n", 1); + } + len = Tcl_UniCharLen((Tcl_UniChar *) fname); + Tcl_DStringInit(&dsTmp); + Tcl_UniCharToUtfDString((Tcl_UniChar *) fname, len, &dsTmp); + Tcl_DStringAppend(&ds, Tcl_DStringValue(&dsTmp), + Tcl_DStringLength(&dsTmp)); + Tcl_DStringFree(&dsTmp); + fname += len + 1; + count++; + } + noBackslash = (count > 0); + } + GlobalUnlock(handle); } else { CloseClipboard(); goto error; @@ -146,7 +177,9 @@ TkSelGetSelection( while (*data) { if (data[0] == '\r' && data[1] == '\n') { data++; - } else { + } else if (noBackslash && data[0] == '\\') { + data++; + *destPtr++ = '/'; } else { *destPtr++ = *data++; } } -- cgit v0.12 From 63f1bed7bb0c9cdd0a7171121ae98f5c8c33224e Mon Sep 17 00:00:00 2001 From: oehhar Date: Mon, 14 Dec 2015 10:32:33 +0000 Subject: Test winDialog-5.12.7 failed if first item in home folder was not a file->corrected --- tests/winDialog.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 tests/winDialog.test diff --git a/tests/winDialog.test b/tests/winDialog.test old mode 100644 new mode 100755 index 24441cf..c8c36bf --- a/tests/winDialog.test +++ b/tests/winDialog.test @@ -594,7 +594,7 @@ test winDialog-5.12.6 {tk_getSaveFile: initial directory: relative} -constraints test winDialog-5.12.7 {tk_getOpenFile: initial directory: ~} -constraints { nt testwinevent } -body { - set fn [file tail [lindex [glob ~/*] 0]] + set fn [file tail [lindex [glob -types f ~/*] 0]] unset -nocomplain x start {set x [tk_getOpenFile \ -initialdir ~ \ -- cgit v0.12 From 11483b44ac56938fe3548e59216eca6886180a0b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 Dec 2015 10:32:48 +0000 Subject: minor formatting --- win/tkWinClipboard.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c index a616af5..200883f 100755 --- a/win/tkWinClipboard.c +++ b/win/tkWinClipboard.c @@ -135,7 +135,7 @@ TkSelGetSelection( } } else if (IsClipboardFormatAvailable(CF_HDROP)) { DROPFILES *drop; - + handle = GetClipboardData(CF_HDROP); if (!handle) { CloseClipboard(); @@ -147,7 +147,7 @@ TkSelGetSelection( WCHAR *fname = (WCHAR *) ((char *) drop + drop->pFiles); Tcl_DString dsTmp; int count = 0, len; - + while (*fname != 0) { if (count) { Tcl_DStringAppend(&ds, "\n", 1); @@ -179,7 +179,8 @@ TkSelGetSelection( data++; } else if (noBackslash && data[0] == '\\') { data++; - *destPtr++ = '/'; } else { + *destPtr++ = '/'; + } else { *destPtr++ = *data++; } } -- cgit v0.12 From c23b714ab089bf546c9cc37188f29274b4e4991a Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Tue, 15 Dec 2015 02:50:56 +0000 Subject: Fix for some redraw issues on Tk-Cocoa on OS X 10.11; further refinement of memory management; thanks to Marc Culler for patches --- macosx/README | 61 +++++++++++++++++++++++++++++++++++++++ macosx/tkMacOSXDialog.c | 2 -- macosx/tkMacOSXDraw.c | 10 ------- macosx/tkMacOSXEvent.c | 5 ---- macosx/tkMacOSXFont.c | 7 +++-- macosx/tkMacOSXInit.c | 68 +++++++++++++++++++++++++++++-------------- macosx/tkMacOSXKeyEvent.c | 2 +- macosx/tkMacOSXMenu.c | 27 +++++------------ macosx/tkMacOSXNotify.c | 63 ++++++++++++++++++++-------------------- macosx/tkMacOSXPrivate.h | 3 ++ macosx/tkMacOSXSubwindows.c | 11 +------ macosx/tkMacOSXWindowEvent.c | 44 ++++++++++++++++++---------- macosx/tkMacOSXWm.c | 69 ++++++++++++++++++++++++++------------------ macosx/tkMacOSXXStubs.c | 6 ++-- 14 files changed, 227 insertions(+), 151 deletions(-) diff --git a/macosx/README b/macosx/README index 69be037..202dbbd 100644 --- a/macosx/README +++ b/macosx/README @@ -388,3 +388,64 @@ make overrides to the tk/macosx GNUmakefile, e.g. sudo make -C tk${ver}/macosx install \ TCL_FRAMEWORK_DIR=$HOME/Library/Frameworks TCLSH_DIR=$HOME/usr/bin The Makefile variables TCL_FRAMEWORK_DIR and TCLSH_DIR were added with Tk 8.4.3. + +4. About the event loop in Tk for Mac OSX +----------------------------------------- + +The main program in a typical OSX application looks like this (see *) + + void NSApplicationMain(int argc, char *argv[]) { + [NSApplication sharedApplication]; + [NSBundle loadNibNamed:@"myMain" owner:NSApp]; + [NSApp run]; + } + +The run method implements the event loop for the application. There +are three key steps in the run method. First it calls +[NSApp finishLaunching], which creates the bouncing application icon +and does other mysterious things. Second it creates an +NSAutoreleasePool. Third, it starts an event loop which drains the +NSAutoreleasePool every time the queue is empty, and replaces the +drained pool with a new one. This third step is essential to +preventing memory leaks, since the internal methods of Appkit objects +all assume that an autorelease pool is in scope and will be drained +when the event processing cycle ends. + +Mac OSX Tk does not call the [NSApp run] method at all. Instead it +uses the event loop built in to Tk. So we must take care to replicate +the important features of the method ourselves. Here is how this +works in outline. + +We add a private NSAUtoreleasePool* property to our subclass of +NSApplication. (The subclass is called TKApplication but can be +referenced with the global variable NSApp). The TkpInit +function calls [NSApp _setup] which initializes this property by +creating an NSAutoreleasePool. A bit later on, TkpInit calls +[NSAPP _setupEventLoop] which in turn calls the +[NSApp finishLaunching] method. + +Each time that Tcl processes an event in its queue, it calls a +platform specific function which, in the case of Mac OSX, is named +TkMacOSXEventsCheckProc. In the unix implementations of Tk, including +the Mac OSX version, this function collects events from an "event +source", and transfers them to the Tcl event queue. In Mac OSX the +event source is the NSApplication event queue. Each NSEvent is +converted to a Tcl event which is added to the Tcl event queue. The +NSEvent is also passed to [NSApp sendevent], which sends the event on +to the application's NSWindows, which send it to their NSViews, etc. +Since the CheckProc function gets called for every Tk event, it is an +appropriate place to drain the main NSAutoreleasePool and replace it +with a new pool. This is done by calling the method +[NSApp _resetAutoreleasePool], where _resetAutoreleasePool is a method +which we define for the subclass TKApplication. + +One minor caveat is that there are several steps of the Tk +initialization which precede the call to TkpInit. Notably, the font +package is initialized first. Since there is no NSAUtoreleasePool in +scope prior to calling TkpInit, the functions called in these +preliminary stages need to create and drain their own +NSAutoreleasePools whenever they call methods of Appkit objects +(e.g. NSFont). + +* https://developer.apple.com/library/mac/documentation/Cocoa/\ +Reference/ApplicationKit/Classes/NSApplication_Class diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index fb6e490..a3510f8 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -1733,9 +1733,7 @@ TkInitFontchooser( Tcl_SetAssocData(interp, "::tk::fontchooser", DeleteFontchooserData, fcdPtr); if (!fontPanelFontAttributes) { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; fontPanelFontAttributes = [NSMutableDictionary new]; - [pool drain]; } return TCL_OK; } diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 10f7b9e..6a0b409 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -138,7 +138,6 @@ BitmapRepFromDrawableRect( CGImageRef cg_image=NULL, sub_cg_image=NULL; NSBitmapImageRep *bitmap_rep=NULL; NSView *view=NULL; - NSAutoreleasePool *pool = [NSAutoreleasePool new]; if ( mac_drawable->flags & TK_IS_PIXMAP ) { /* This means that the MacDrawable is functioning as a Tk Pixmap, so its view @@ -175,7 +174,6 @@ BitmapRepFromDrawableRect( } else { TkMacOSXDbgMsg("Invalid source drawable"); } - [pool drain]; return bitmap_rep; } @@ -1636,7 +1634,6 @@ TkMacOSXSetupDrawingContext( int dontDraw = 0, isWin = 0; TkMacOSXDrawingContext dc = {}; CGRect clipBounds; - NSAutoreleasePool *pool = [NSAutoreleasePool new]; dc.clipRgn = TkMacOSXGetClipRgn(d); if (!dontDraw) { @@ -1767,7 +1764,6 @@ end: dc.clipRgn = NULL; } *dcPtr = dc; - [pool drain]; return !dontDraw; } @@ -1791,7 +1787,6 @@ void TkMacOSXRestoreDrawingContext( TkMacOSXDrawingContext *dcPtr) { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; if (dcPtr->context) { CGContextSynchronize(dcPtr->context); [[dcPtr->view window] setViewsNeedDisplay:YES]; @@ -1808,7 +1803,6 @@ TkMacOSXRestoreDrawingContext( #ifdef TK_MAC_DEBUG bzero(dcPtr, sizeof(TkMacOSXDrawingContext)); #endif /* TK_MAC_DEBUG */ - [pool drain]; } /* @@ -1834,7 +1828,6 @@ TkMacOSXGetClipRgn( { MacDrawable *macDraw = (MacDrawable *) drawable; HIShapeRef clipRgn = NULL; - NSAutoreleasePool *pool = [NSAutoreleasePool new]; if (macDraw->winPtr && macDraw->flags & TK_CLIP_INVALID) { TkMacOSXUpdateClipRgn(macDraw->winPtr); @@ -1860,7 +1853,6 @@ TkMacOSXGetClipRgn( } else if (macDraw->visRgn) { clipRgn = HIShapeCreateCopy(macDraw->visRgn); } - [pool drain]; return clipRgn; } @@ -1913,7 +1905,6 @@ TkpClipDrawableToRect( { MacDrawable *macDraw = (MacDrawable *) d; NSView *view = TkMacOSXDrawableView(macDraw); - NSAutoreleasePool *pool = [NSAutoreleasePool new]; if (macDraw->drawRgn) { CFRelease(macDraw->drawRgn); @@ -1947,7 +1938,6 @@ TkpClipDrawableToRect( macDraw->flags &= ~TK_FOCUSED_VIEW; } } - [pool drain]; } /* diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c index db13249..7f3357f 100644 --- a/macosx/tkMacOSXEvent.c +++ b/macosx/tkMacOSXEvent.c @@ -128,10 +128,6 @@ enum { MODULE_SCOPE void TkMacOSXFlushWindows(void) { - /* This can be called from outside the Appkit event loop, - * so it needs its own AutoreleasePool. - */ - NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSArray *macWindows = [NSApp orderedWindows]; for (NSWindow *w in macWindows) { @@ -139,7 +135,6 @@ TkMacOSXFlushWindows(void) [w flushWindow]; } } - [pool drain]; } diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 54b0fb8..c48e56e 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -210,6 +210,7 @@ FindNSFont( nsFont = [fm convertFont:nsFont toSize:size]; nsFont = [fm convertFont:nsFont toHaveTrait:traits]; } + [nsFont retain]; #undef defaultFont return nsFont; } @@ -306,7 +307,7 @@ InitFont( [NSNumber numberWithInt:fmPtr->fixed ? 0 : 1], NSLigatureAttributeName, [NSNumber numberWithDouble:kern], NSKernAttributeName, nil]; - fontPtr->nsAttributes = [nsAttributes retain]; + fontPtr->nsAttributes = [nsAttributes retain]; #undef nCh } @@ -371,6 +372,7 @@ TkpFontPkgInit( NSFont *nsFont; TkFontAttributes fa; NSMutableCharacterSet *cs; + /* Since we called before TkpInit, we need our own autorelease pool. */ NSAutoreleasePool *pool = [NSAutoreleasePool new]; /* force this for now */ @@ -530,7 +532,7 @@ TkpGetFontFromAttributes( nsFont = FindNSFont(faPtr->family, traits, weight, points, 1); } if (!nsFont) { - Tcl_Panic("Could not deternmine NSFont from TkFontAttributes"); + Tcl_Panic("Could not determine NSFont from TkFontAttributes"); } if (tkFontPtr == NULL) { fontPtr = ckalloc(sizeof(MacFont)); @@ -675,7 +677,6 @@ TkpGetFontAttrsForChar( { MacFont *fontPtr = (MacFont *) tkfont; NSFont *nsFont = fontPtr->nsFont; - *faPtr = fontPtr->font.fa; if (nsFont && ![[nsFont coveredCharacterSet] characterIsMember:c]) { UTF16Char ch = c; diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 98e6824..c658149 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -57,9 +57,19 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt @end @implementation TKApplication +#ifndef __clang__ +@synthesize poolProtected = _poolProtected; +#endif @end @implementation TKApplication(TKInit) +- (void) _resetAutoreleasePool +{ + if(![self poolProtected]) { + [_mainPool drain]; + _mainPool = [NSAutoreleasePool new]; + } +} #ifdef TK_MAC_DEBUG_NOTIFICATIONS - (void) _postedNotification: (NSNotification *) notification { @@ -86,16 +96,19 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt - (void) _setupEventLoop { - - /*Remove private API flags here.*/ + NSAutoreleasePool *pool = [NSAutoreleasePool new]; [self finishLaunching]; [self setWindowsNeedUpdate:YES]; + [pool drain]; } - (void) _setup: (Tcl_Interp *) interp { _eventInterp = interp; + _mainPool = nil; + [NSApp setPoolProtected:NO]; _defaultMainMenu = nil; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; [self _setupMenus]; [self setDelegate:self]; #ifdef TK_MAC_DEBUG_NOTIFICATIONS @@ -104,12 +117,13 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt #endif [self _setupWindowNotifications]; [self _setupApplicationNotifications]; + [pool drain]; } - (NSString *) tkFrameworkImagePath: (NSString *) image { NSString *path = nil; - + NSAutoreleasePool *pool = [NSAutoreleasePool new]; if (tkLibPath[0] != '\0') { path = [[NSBundle bundleWithPath:[[NSString stringWithUTF8String: tkLibPath] stringByAppendingString:@"/../.."]] @@ -142,6 +156,8 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt } } #endif + [path retain]; + [pool drain]; return path; } @end @@ -168,6 +184,7 @@ static void SetApplicationIcon( ClientData clientData) { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSString *path = [NSApp tkFrameworkImagePath:@"Tk.icns"]; if (path) { NSImage *image = [[NSImage alloc] initWithContentsOfFile:path]; @@ -176,6 +193,7 @@ SetApplicationIcon( [image release]; } } + [pool drain]; } /* @@ -253,16 +271,19 @@ TkpInit( } #endif - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - [[NSUserDefaults standardUserDefaults] registerDefaults: - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:YES], - @"_NSCanWrapButtonTitles", - [NSNumber numberWithInt:-1], - @"NSStringDrawingTypesetterBehavior", - nil]]; - [TKApplication sharedApplication]; - [NSApp _setup:interp]; + { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + [[NSUserDefaults standardUserDefaults] registerDefaults: + [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES], + @"_NSCanWrapButtonTitles", + [NSNumber numberWithInt:-1], + @"NSStringDrawingTypesetterBehavior", + nil]]; + [TKApplication sharedApplication]; + [pool drain]; + [NSApp _setup:interp]; + } /* Check whether we are a bundled executable: */ bundleRef = CFBundleGetMainBundle(); @@ -319,12 +340,15 @@ TkpInit( Tcl_DoWhenIdle(SetApplicationIcon, NULL); } - [NSApp _setupEventLoop]; - TkMacOSXInitAppleEvents(interp); - TkMacOSXUseAntialiasedText(interp, -1); - TkMacOSXInitCGDrawing(interp, TRUE, 0); - [pool drain]; - + { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + [NSApp _setupEventLoop]; + TkMacOSXInitAppleEvents(interp); + TkMacOSXUseAntialiasedText(interp, -1); + TkMacOSXInitCGDrawing(interp, TRUE, 0); + [pool drain]; + } + /* * FIXME: Close stdin & stdout for remote debugging otherwise we will * fight with gdb for stdin & stdout @@ -480,9 +504,8 @@ TkpDisplayWarning( MODULE_SCOPE void TkMacOSXDefaultStartupScript(void) { - CFBundleRef bundleRef; - - bundleRef = CFBundleGetMainBundle(); + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + CFBundleRef bundleRef = CFBundleGetMainBundle(); if (bundleRef != NULL) { CFURLRef appMainURL = CFBundleCopyResourceURL(bundleRef, @@ -506,6 +529,7 @@ TkMacOSXDefaultStartupScript(void) CFRelease(appMainURL); } } + [pool drain]; } /* diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 8521beb..151b4f2 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -328,7 +328,7 @@ static unsigned isFunctionKey(unsigned int code); pt.y = caret_y; pt = [self convertPoint: pt toView: nil]; - pt = [[self window] convertBaseToScreen: pt]; + pt = [[self window] convertPointToScreen: pt]; pt.y -= caret_height; rect.origin = pt; diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 0c078ce..c7e3a78 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -258,10 +258,10 @@ static int ModifierCharWidth(Tk_Font tkfont); if (menuPtr && mePtr) { Tcl_Interp *interp = menuPtr->interp; - /*Add time for errors to fire if necessary. This is sub-optimal but avoids issues with Tcl/Cocoa event loop integration.*/ + /*Add time for errors to fire if necessary. This is sub-optimal + *but avoids issues with Tcl/Cocoa event loop integration. + */ Tcl_Sleep(100); - - NSAutoreleasePool *pool = [NSAutoreleasePool new]; Tcl_Preserve(interp); Tcl_Preserve(menuPtr); @@ -274,7 +274,6 @@ static int ModifierCharWidth(Tk_Font tkfont); } Tcl_Release(menuPtr); Tcl_Release(interp); - [pool drain]; } } } @@ -377,13 +376,6 @@ static int ModifierCharWidth(Tk_Font tkfont); @implementation TKApplication(TKMenu) -- (void) safeSetMainMenu: (NSMenu *) menu -{ - NSAutoreleasePool* pool = [NSAutoreleasePool new]; - [self setMainMenu: menu]; - [pool drain]; -} - - (void) menuBeginTracking: (NSNotification *) notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS @@ -420,7 +412,7 @@ static int ModifierCharWidth(Tk_Font tkfont); if (!mePtr || !(mePtr->entryFlags & ENTRY_APPLE_MENU)) { applicationMenuItem = [NSMenuItem itemWithSubmenu: - [[_defaultApplicationMenu copy] autorelease]]; + [_defaultApplicationMenu copy]]; [menu insertItem:applicationMenuItem atIndex:0]; } [menu setSpecial:tkMainMenu]; @@ -428,7 +420,7 @@ static int ModifierCharWidth(Tk_Font tkfont); applicationMenu = (TKMenu *)[applicationMenuItem submenu]; if (![applicationMenu isSpecial:tkApplicationMenu]) { for (NSMenuItem *item in _defaultApplicationMenuItems) { - [applicationMenu addItem:[[item copy] autorelease]]; + [applicationMenu addItem:[item copy]]; } [applicationMenu setSpecial:tkApplicationMenu]; } @@ -438,15 +430,13 @@ static int ModifierCharWidth(Tk_Font tkfont); for (NSMenuItem *item in itemArray) { TkMenuEntry *mePtr = (TkMenuEntry *)[item tag]; TKMenu *submenu = (TKMenu *)[item submenu]; - if (mePtr && submenu) { if ((mePtr->entryFlags & ENTRY_WINDOWS_MENU) && ![submenu isSpecial:tkWindowsMenu]) { NSInteger index = 0; for (NSMenuItem *i in _defaultWindowsMenuItems) { - [submenu insertItem:[[i copy] autorelease] atIndex: - index++]; + [submenu insertItem:[i copy] atIndex:index++]; } [self setWindowsMenu:submenu]; [submenu setSpecial:tkWindowsMenu]; @@ -455,8 +445,7 @@ static int ModifierCharWidth(Tk_Font tkfont); NSInteger index = 0; for (NSMenuItem *i in _defaultHelpMenuItems) { - [submenu insertItem:[[i copy] autorelease] atIndex: - index++]; + [submenu insertItem:[i copy] atIndex:index++]; } [submenu setSpecial:tkHelpMenu]; } @@ -475,7 +464,7 @@ static int ModifierCharWidth(Tk_Font tkfont); [servicesMenuItem setSubmenu:_servicesMenu]; } [self setAppleMenu:applicationMenu]; - [self safeSetMainMenu:menu]; + [self setMainMenu:menu]; } @end diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 3fe59bd..06207e2 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -50,7 +50,7 @@ static void TkMacOSXEventsCheckProc(ClientData clientData, int flags); @end @implementation TKApplication(TKNotify) -/* Call super then redisplay all of our windows. */ +/* Display all windows each time an event is removed from the queue.*/ - (NSEvent *) nextEventMatchingMask: (NSUInteger) mask untilDate: (NSDate *) expiration inMode: (NSString *) mode dequeue: (BOOL) deqFlag @@ -59,9 +59,9 @@ static void TkMacOSXEventsCheckProc(ClientData clientData, int flags); untilDate:expiration inMode:mode dequeue:deqFlag]; - NSAutoreleasePool *pool = [NSAutoreleasePool new]; + /* Retain this event for later use. Must be released.*/ + [event retain]; [NSApp makeWindowsPerform:@selector(tkDisplayIfNeeded) inOrder:NO]; - [pool drain]; return event; } @@ -70,10 +70,8 @@ static void TkMacOSXEventsCheckProc(ClientData clientData, int flags); */ - (void) sendEvent: (NSEvent *) theEvent { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; [super sendEvent:theEvent]; [NSApp tkCheckPasteboard]; - [pool drain]; } @end @@ -217,19 +215,21 @@ TkMacOSXEventsSetupProc( ClientData clientData, int flags) { - if (flags & TCL_WINDOW_EVENTS && - ![[NSRunLoop currentRunLoop] currentMode]) { + NSString *runloopMode = [[NSRunLoop currentRunLoop] currentMode]; + /* runloopMode will be nil if we are in the Tcl event loop. */ + if (flags & TCL_WINDOW_EVENTS && !runloopMode) { static const Tcl_Time zeroBlockTime = { 0, 0 }; - NSAutoreleasePool *pool = [NSAutoreleasePool new]; /* Call this with dequeue=NO -- just checking if the queue is empty. */ NSEvent *currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask - untilDate:[NSDate distantPast] - inMode:GetRunLoopMode(TkMacOSXGetModalSession()) - dequeue:NO]; - if (currentEvent && currentEvent.type > 0) { - Tcl_SetMaxBlockTime(&zeroBlockTime); + untilDate:[NSDate distantPast] + inMode:GetRunLoopMode(TkMacOSXGetModalSession()) + dequeue:NO]; + if (currentEvent) { + if (currentEvent.type > 0) { + Tcl_SetMaxBlockTime(&zeroBlockTime); + } + [currentEvent release]; } - [pool drain]; } } @@ -256,13 +256,14 @@ TkMacOSXEventsCheckProc( int flags) { NSString *runloopMode = [[NSRunLoop currentRunLoop] currentMode]; + /* runloopMode will be nil if we are in the Tcl event loop. */ if (flags & TCL_WINDOW_EVENTS && !runloopMode) { - NSEvent *currentEvent = nil; NSEvent *testEvent = nil; NSModalSession modalSession; - + do { + [NSApp _resetAutoreleasePool]; modalSession = TkMacOSXGetModalSession(); testEvent = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] @@ -277,25 +278,25 @@ TkMacOSXEventsCheckProc( untilDate:[NSDate distantPast] inMode:GetRunLoopMode(modalSession) dequeue:YES]; - if (!currentEvent) { - break; /* No events are available. */ - } - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - /* Generate Xevents. */ - int oldServiceMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); - NSEvent *processedEvent = [NSApp tkProcessEvent:currentEvent]; - Tcl_SetServiceMode(oldServiceMode); - if (processedEvent) { /* Should always be non-NULL. */ + if (currentEvent) { + /* Generate Xevents. */ + int oldServiceMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); + NSEvent *processedEvent = [NSApp tkProcessEvent:currentEvent]; + Tcl_SetServiceMode(oldServiceMode); + if (processedEvent) { /* Should always be non-NULL. */ #ifdef TK_MAC_DEBUG_EVENTS - TKLog(@" event: %@", currentEvent); + TKLog(@" event: %@", currentEvent); #endif - if (modalSession) { - [NSApp _modalSession:modalSession sendEvent:currentEvent]; - } else { - [NSApp sendEvent:currentEvent]; + if (modalSession) { + [NSApp _modalSession:modalSession sendEvent:currentEvent]; + } else { + [NSApp sendEvent:currentEvent]; + } } + [currentEvent release]; + } else { + break; } - [pool drain]; } while (1); } } diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 90d5a9b..2a411f6 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -275,10 +275,13 @@ VISIBILITY_HIDDEN NSArray *_defaultApplicationMenuItems, *_defaultWindowsMenuItems; NSArray *_defaultHelpMenuItems; NSWindow *_windowWithMouse; + NSAutoreleasePool *_mainPool; } +@property BOOL poolProtected; @end @interface TKApplication(TKInit) - (NSString *)tkFrameworkImagePath:(NSString*)image; +- (void)_resetAutoreleasePool; @end @interface TKApplication(TKEvent) - (NSEvent *)tkProcessEvent:(NSEvent *)theEvent; diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index d23ba85..f026318 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -131,11 +131,6 @@ XMapWindow( { MacDrawable *macWin = (MacDrawable *) window; XEvent event; - /* - * This function can be called from outside the AppKit event - * loop, so it needs its own AutoreleasePool. - */ - NSAutoreleasePool* pool = [NSAutoreleasePool new]; /* * Under certain situations it's possible for this function to be called @@ -158,6 +153,7 @@ XMapWindow( if ( [win canBecomeKeyWindow] ) { [win makeKeyAndOrderFront:NSApp]; } + /* Why do we need this? (It is used by Carbon)*/ [win windowRef]; TkMacOSXApplyWindowAttributes(macWin->winPtr, win); } @@ -194,7 +190,6 @@ XMapWindow( event.xvisibility.type = VisibilityNotify; event.xvisibility.state = VisibilityUnobscured; NotifyVisibility(macWin->winPtr, &event); - [pool drain]; } /* @@ -318,7 +313,6 @@ XResizeWindow( unsigned int height) { MacDrawable *macWin = (MacDrawable *) window; - NSAutoreleasePool *pool= [NSAutoreleasePool new]; display->request++; if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) { NSWindow *w = macWin->winPtr->wmInfoPtr->window; @@ -333,7 +327,6 @@ XResizeWindow( } else { MoveResizeWindow(macWin); } - [pool drain]; } /* @@ -366,7 +359,6 @@ XMoveResizeWindow( display->request++; if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) { NSWindow *w = macWin->winPtr->wmInfoPtr->window; - if (w) { NSRect r = NSMakeRect(x + macWin->winPtr->wmInfoPtr->xInParent, tkMacOSXZeroScreenHeight - (y + @@ -407,7 +399,6 @@ XMoveWindow( display->request++; if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) { NSWindow *w = macWin->winPtr->wmInfoPtr->window; - if (w) { [w setFrameTopLeftPoint:NSMakePoint(x, tkMacOSXZeroScreenHeight - y)]; } diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 851358d..1150f2e 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -806,7 +806,7 @@ ConfigureRestrictProc( { const NSRect *rectsBeingDrawn; NSInteger rectsBeingDrawnCount; - + [self getRectsBeingDrawn:&rectsBeingDrawn count:&rectsBeingDrawnCount]; #ifdef TK_MAC_DEBUG_DRAWING @@ -840,7 +840,8 @@ ConfigureRestrictProc( -(void) setFrameSize: (NSSize)newsize { - if ( [self inLiveResize] ) { + [super setFrameSize: newsize]; + if ([self inLiveResize]) { NSWindow *w = [self window]; TkWindow *winPtr = TkMacOSXGetTkWindow(w); Tk_Window tkwin = (Tk_Window) winPtr; @@ -849,17 +850,29 @@ ConfigureRestrictProc( ClientData oldArg; Tk_RestrictProc *oldProc; - /* Resize the NSView */ - [super setFrameSize: newsize]; - - /* Disable drawing until the window has been completely configured.*/ + /* This can be called from outside the Tk event loop. + * Since it calls Tcl_DoOneEvent, we need to make sure we + * don't clobber the AutoreleasePool set up by the caller. + */ + [NSApp setPoolProtected:YES]; + + /* + * Try to prevent flickers and flashes. + * + * This stops the flickers on OSX 10.11. But flashes still occur when + * the width of the window is 16, 32, 48, 64, 80, 96, 112, 256, 512, + * 768, ... :^( + */ + [w disableFlushWindow]; + + /* Disable Tk drawing until the window has been completely configured.*/ TkMacOSXSetDrawingEnabled(winPtr, 0); /* Generate and handle a ConfigureNotify event for the new size.*/ TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height, TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY); oldProc = Tk_RestrictEvents(ConfigureRestrictProc, NULL, &oldArg); - while ( Tk_DoOneEvent(TK_X_EVENTS|TK_DONT_WAIT) ) {} + while (Tk_DoOneEvent(TK_X_EVENTS|TK_DONT_WAIT)) {} Tk_RestrictEvents(oldProc, oldArg, &oldArg); /* Now that Tk has configured all subwindows we can create the clip regions. */ @@ -871,9 +884,10 @@ ConfigureRestrictProc( HIRect bounds = NSRectToCGRect([self bounds]); HIShapeRef shape = HIShapeCreateWithRect(&bounds); [self generateExposeEvents: shape]; - while ( Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT) ) {} - } else { - [super setFrameSize: newsize]; + while (Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT)) {} + [w enableFlushWindow]; + [w flushWindowIfNeeded]; + [NSApp setPoolProtected:NO]; } } @@ -891,12 +905,10 @@ ConfigureRestrictProc( [self generateExposeEvents: shape]; } -/* Core method of this class: generates expose events for redrawing. - * Whereas drawRect is intended to be called only from the Appkit event - * loop, this can be called from Tk. If the Tcl_ServiceMode is set to - * TCL_SERVICE_ALL then the expose events will be immediately removed - * from the Tcl event loop and processed. Typically, they should be queued, - * however. +/* Core method of this class: generates expose events for redrawing. If the + * Tcl_ServiceMode is set to TCL_SERVICE_ALL then the expose events will be + * immediately removed from the Tcl event loop and processed. Typically, they + * should be queued, however. */ - (void) generateExposeEvents: (HIShapeRef) shape { diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 5ec38ca..308ee11 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -404,18 +404,23 @@ static void RemapWindows(TkWindow *winPtr, if (title == nil) { title = "unnamed window"; } - printf("Retained <%s>. Count is: %lu\n", title, [self retainCount]); + if (DEBUG_ZOMBIES > 1){ + printf("Retained <%s>. Count is: %lu\n", title, [self retainCount]); + } return result; } - (id) autorelease { + static int xcount = 0; id result = [super autorelease]; const char *title = [[self title] UTF8String]; if (title == nil) { title = "unnamed window"; } - printf("Autoreleased <%s>. Count is %lu\n", title, [self retainCount]); + if (DEBUG_ZOMBIES > 1){ + printf("Autoreleased <%s>. Count is %lu\n", title, [self retainCount]); + } return result; } @@ -424,9 +429,24 @@ static void RemapWindows(TkWindow *winPtr, if (title == nil) { title = "unnamed window"; } - printf("Releasing <%s>. Count is %lu\n", title, [self retainCount]); + if (DEBUG_ZOMBIES > 1){ + printf("Releasing <%s>. Count is %lu\n", title, [self retainCount]); + } [super release]; } + +- (void) dealloc { + const char *title = [[self title] UTF8String]; + if (title == nil) { + title = "unnamed window"; + } + if (DEBUG_ZOMBIES > 0){ + printf(">>>> Freeing <%s>. Count is %lu\n", title, [self retainCount]); + } + [super dealloc]; +} + + #endif @end @@ -541,7 +561,6 @@ FrontWindowAtPoint( int x, int y) { NSPoint p = NSMakePoint(x, tkMacOSXZeroScreenHeight - y); - NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSArray *windows = [NSApp orderedWindows]; TkWindow *front = NULL; @@ -551,7 +570,6 @@ FrontWindowAtPoint( break; } } - [pool drain]; return front; } @@ -855,7 +873,6 @@ TkWmDeadWindow( NSWindow *window = wmPtr->window; if (window && !Tk_IsEmbedded(winPtr) ) { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSWindow *parent = [window parentWindow]; if (parent) { [parent removeChildWindow:window]; @@ -865,26 +882,30 @@ TkWmDeadWindow( if (winPtr->window) { ((MacDrawable *) winPtr->window)->view = nil; } -#if DEBUG_ZOMBIES +#if DEBUG_ZOMBIES > 0 { const char *title = [[window title] UTF8String]; if (title == nil) { title = "unnamed window"; } - printf("Closing <%s>. Count is: %lu\n", title, [window retainCount]); + printf(">>>> Closing <%s>. Count is: %lu\n", title, [window retainCount]); } #endif [window release]; wmPtr->window = NULL; - /* Activate the highest window left on the screen. */ - NSArray *windows = [NSApp orderedWindows]; - if ( [windows count] > 0 ) { - NSWindow *front = [windows objectAtIndex:0]; - if ( front && [front canBecomeKeyWindow] ) { - [front makeKeyAndOrderFront:NSApp]; - } - } - [pool drain]; + + /* Activate the highest window left on the screen. */ + NSArray *windows = [NSApp orderedWindows]; + if ( [windows count] > 0 ) { + NSWindow *front = [windows objectAtIndex:0]; + if ( front && [front canBecomeKeyWindow] ) { + [front makeKeyAndOrderFront:NSApp]; + } + } +#if DEBUG_ZOMBIES > 0 + fprintf(stderr, "================= Pool dump ===================\n"); + [NSAutoreleasePool showPools]; +#endif } ckfree(wmPtr); winPtr->wmInfoPtr = NULL; @@ -5538,9 +5559,6 @@ TkMacOSXMakeRealWindowExist( * TODO: Here we should handle out of process embedding. */ } - - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - WindowClass macClass = wmPtr->macClass; wmPtr->attributes &= (tkAlwaysValidAttributes | macClassAttrs[macClass].validAttrs); @@ -5574,10 +5592,10 @@ TkMacOSXMakeRealWindowExist( NSWindow *window = [[winClass alloc] initWithContentRect:contentRect styleMask:styleMask backing:NSBackingStoreBuffered defer:YES]; if (!window) { - Tcl_Panic("couldn't allocate new Mac window"); + Tcl_Panic("couldn't allocate new Mac window"); } TKContentView *contentView = [[TKContentView alloc] - initWithFrame:NSZeroRect]; + initWithFrame:NSZeroRect]; [window setContentView:contentView]; [contentView release]; [window setDelegate:NSApp]; @@ -5612,7 +5630,7 @@ TkMacOSXMakeRealWindowExist( [window setDocumentEdited:NO]; wmPtr->window = window; - macWin->view = contentView; + macWin->view = window.contentView; TkMacOSXApplyWindowAttributes(winPtr, window); NSRect geometry = InitialWindowBounds(winPtr, window); @@ -5621,11 +5639,8 @@ TkMacOSXMakeRealWindowExist( geometry.origin.y = tkMacOSXZeroScreenHeight - (geometry.origin.y + geometry.size.height); [window setFrame:geometry display:NO]; - TkMacOSXRegisterOffScreenWindow((Window) macWin, window); macWin->flags |= TK_HOST_EXISTS; - - [pool drain]; } /* @@ -6018,7 +6033,6 @@ TkpChangeFocus( if (Tk_IsTopLevel(winPtr) && !Tk_IsEmbedded(winPtr) ){ NSWindow *win = TkMacOSXDrawableWindow(winPtr->window); - NSAutoreleasePool *pool = [NSAutoreleasePool new]; TkWmRestackToplevel(winPtr, Above, NULL); if (force ) { [NSApp activateIgnoringOtherApps:YES]; @@ -6026,7 +6040,6 @@ TkpChangeFocus( if ( win && [win canBecomeKeyWindow] ) { [win makeKeyAndOrderFront:NSApp]; } - [pool drain]; } /* diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index c39d42d..53d1eb8 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -142,8 +142,8 @@ TkpOpenDisplay( static NSRect maxBounds = {{0, 0}, {0, 0}}; static char vendor[25] = ""; NSArray *cgVers; - - + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + if (gMacDisplay != NULL) { if (strcmp(gMacDisplay->display->display_name, display_name) == 0) { return gMacDisplay; @@ -152,8 +152,6 @@ TkpOpenDisplay( } } - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - display = ckalloc(sizeof(Display)); screen = ckalloc(sizeof(Screen)); bzero(display, sizeof(Display)); -- cgit v0.12 -- cgit v0.12 From f4326da1c63ed8d0421a5d315255f2b2c402328e Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Tue, 15 Dec 2015 02:53:13 +0000 Subject: Fix for some redraw issues on Tk-Cocoa on OS X 10.11; further refinement of memory management; thanks to Marc Culler for patches --- macosx/README | 61 +++++++++++++++++++++++++++++++++++++ macosx/tkMacOSXDraw.c | 10 ------- macosx/tkMacOSXEvent.c | 5 ---- macosx/tkMacOSXFont.c | 5 ++-- macosx/tkMacOSXInit.c | 67 ++++++++++++++++++++++++++++------------- macosx/tkMacOSXKeyEvent.c | 2 +- macosx/tkMacOSXMenu.c | 27 +++++------------ macosx/tkMacOSXNotify.c | 68 ++++++++++++++++++++++-------------------- macosx/tkMacOSXPrivate.h | 3 ++ macosx/tkMacOSXSubwindows.c | 11 +------ macosx/tkMacOSXWindowEvent.c | 34 ++++++++++++++------- macosx/tkMacOSXWm.c | 71 ++++++++++++++++++++++++++------------------ macosx/tkMacOSXXStubs.c | 3 +- 13 files changed, 225 insertions(+), 142 deletions(-) diff --git a/macosx/README b/macosx/README index b992a2e..7b17fb8 100644 --- a/macosx/README +++ b/macosx/README @@ -386,3 +386,64 @@ make overrides to the tk/macosx GNUmakefile, e.g. sudo make -C tk${ver}/macosx install \ TCL_FRAMEWORK_DIR=$HOME/Library/Frameworks TCLSH_DIR=$HOME/usr/bin The Makefile variables TCL_FRAMEWORK_DIR and TCLSH_DIR were added with Tk 8.4.3. + +4. About the event loop in Tk for Mac OSX +----------------------------------------- + +The main program in a typical OSX application looks like this (see *) + + void NSApplicationMain(int argc, char *argv[]) { + [NSApplication sharedApplication]; + [NSBundle loadNibNamed:@"myMain" owner:NSApp]; + [NSApp run]; + } + +The run method implements the event loop for the application. There +are three key steps in the run method. First it calls +[NSApp finishLaunching], which creates the bouncing application icon +and does other mysterious things. Second it creates an +NSAutoreleasePool. Third, it starts an event loop which drains the +NSAutoreleasePool every time the queue is empty, and replaces the +drained pool with a new one. This third step is essential to +preventing memory leaks, since the internal methods of Appkit objects +all assume that an autorelease pool is in scope and will be drained +when the event processing cycle ends. + +Mac OSX Tk does not call the [NSApp run] method at all. Instead it +uses the event loop built in to Tk. So we must take care to replicate +the important features of the method ourselves. Here is how this +works in outline. + +We add a private NSAUtoreleasePool* property to our subclass of +NSApplication. (The subclass is called TKApplication but can be +referenced with the global variable NSApp). The TkpInit +function calls [NSApp _setup] which initializes this property by +creating an NSAutoreleasePool. A bit later on, TkpInit calls +[NSAPP _setupEventLoop] which in turn calls the +[NSApp finishLaunching] method. + +Each time that Tcl processes an event in its queue, it calls a +platform specific function which, in the case of Mac OSX, is named +TkMacOSXEventsCheckProc. In the unix implementations of Tk, including +the Mac OSX version, this function collects events from an "event +source", and transfers them to the Tcl event queue. In Mac OSX the +event source is the NSApplication event queue. Each NSEvent is +converted to a Tcl event which is added to the Tcl event queue. The +NSEvent is also passed to [NSApp sendevent], which sends the event on +to the application's NSWindows, which send it to their NSViews, etc. +Since the CheckProc function gets called for every Tk event, it is an +appropriate place to drain the main NSAutoreleasePool and replace it +with a new pool. This is done by calling the method +[NSApp _resetAutoreleasePool], where _resetAutoreleasePool is a method +which we define for the subclass TKApplication. + +One minor caveat is that there are several steps of the Tk +initialization which precede the call to TkpInit. Notably, the font +package is initialized first. Since there is no NSAUtoreleasePool in +scope prior to calling TkpInit, the functions called in these +preliminary stages need to create and drain their own +NSAutoreleasePools whenever they call methods of Appkit objects +(e.g. NSFont). + +* https://developer.apple.com/library/mac/documentation/Cocoa/\ +Reference/ApplicationKit/Classes/NSApplication_Class diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index b3c2499..f376591 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -138,7 +138,6 @@ BitmapRepFromDrawableRect( CGImageRef cg_image=NULL, sub_cg_image=NULL; NSBitmapImageRep *bitmap_rep=NULL; NSView *view=NULL; - NSAutoreleasePool *pool = [NSAutoreleasePool new]; if ( mac_drawable->flags & TK_IS_PIXMAP ) { /* This means that the MacDrawable is functioning as a Tk Pixmap, so its view @@ -175,7 +174,6 @@ BitmapRepFromDrawableRect( } else { TkMacOSXDbgMsg("Invalid source drawable"); } - [pool drain]; return bitmap_rep; } @@ -1636,7 +1634,6 @@ TkMacOSXSetupDrawingContext( int dontDraw = 0, isWin = 0; TkMacOSXDrawingContext dc = {}; CGRect clipBounds; - NSAutoreleasePool *pool = [NSAutoreleasePool new]; dc.clipRgn = TkMacOSXGetClipRgn(d); if (!dontDraw) { @@ -1767,7 +1764,6 @@ end: dc.clipRgn = NULL; } *dcPtr = dc; - [pool drain]; return !dontDraw; } @@ -1791,7 +1787,6 @@ void TkMacOSXRestoreDrawingContext( TkMacOSXDrawingContext *dcPtr) { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; if (dcPtr->context) { CGContextSynchronize(dcPtr->context); [[dcPtr->view window] setViewsNeedDisplay:YES]; @@ -1808,7 +1803,6 @@ TkMacOSXRestoreDrawingContext( #ifdef TK_MAC_DEBUG bzero(dcPtr, sizeof(TkMacOSXDrawingContext)); #endif /* TK_MAC_DEBUG */ - [pool drain]; } /* @@ -1834,7 +1828,6 @@ TkMacOSXGetClipRgn( { MacDrawable *macDraw = (MacDrawable *) drawable; HIShapeRef clipRgn = NULL; - NSAutoreleasePool *pool = [NSAutoreleasePool new]; if (macDraw->winPtr && macDraw->flags & TK_CLIP_INVALID) { TkMacOSXUpdateClipRgn(macDraw->winPtr); @@ -1860,7 +1853,6 @@ TkMacOSXGetClipRgn( } else if (macDraw->visRgn) { clipRgn = HIShapeCreateCopy(macDraw->visRgn); } - [pool drain]; return clipRgn; } @@ -1913,7 +1905,6 @@ TkpClipDrawableToRect( { MacDrawable *macDraw = (MacDrawable *) d; NSView *view = TkMacOSXDrawableView(macDraw); - NSAutoreleasePool *pool = [NSAutoreleasePool new]; if (macDraw->drawRgn) { CFRelease(macDraw->drawRgn); @@ -1947,7 +1938,6 @@ TkpClipDrawableToRect( macDraw->flags &= ~TK_FOCUSED_VIEW; } } - [pool drain]; } /* diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c index 6685b80..3c59ac3 100644 --- a/macosx/tkMacOSXEvent.c +++ b/macosx/tkMacOSXEvent.c @@ -126,10 +126,6 @@ enum { MODULE_SCOPE void TkMacOSXFlushWindows(void) { - /* This can be called from outside the Appkit event loop, - * so it needs its own AutoreleasePool. - */ - NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSArray *macWindows = [NSApp orderedWindows]; for (NSWindow *w in macWindows) { @@ -137,7 +133,6 @@ TkMacOSXFlushWindows(void) [w flushWindow]; } } - [pool drain]; } /* diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index f1e01d2..f329071 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -210,6 +210,7 @@ FindNSFont( nsFont = [fm convertFont:nsFont toSize:size]; nsFont = [fm convertFont:nsFont toHaveTrait:traits]; } + [nsFont retain]; #undef defaultFont return nsFont; } @@ -371,6 +372,7 @@ TkpFontPkgInit( NSFont *nsFont; TkFontAttributes fa; NSMutableCharacterSet *cs; + /* Since we called before TkpInit, we need our own autorelease pool. */ NSAutoreleasePool *pool = [NSAutoreleasePool new]; /* force this for now */ @@ -530,7 +532,7 @@ TkpGetFontFromAttributes( nsFont = FindNSFont(faPtr->family, traits, weight, points, 1); } if (!nsFont) { - Tcl_Panic("Could not deternmine NSFont from TkFontAttributes"); + Tcl_Panic("Could not determine NSFont from TkFontAttributes"); } if (tkFontPtr == NULL) { fontPtr = (MacFont *) ckalloc(sizeof(MacFont)); @@ -675,7 +677,6 @@ TkpGetFontAttrsForChar( { MacFont *fontPtr = (MacFont *) tkfont; NSFont *nsFont = fontPtr->nsFont; - *faPtr = fontPtr->font.fa; if (nsFont && ![[nsFont coveredCharacterSet] characterIsMember:c]) { UTF16Char ch = c; diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 8e5479e..cb97f47 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -59,9 +59,19 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt @end @implementation TKApplication +#ifndef __clang__ +@synthesize poolProtected = _poolProtected; +#endif @end @implementation TKApplication(TKInit) +- (void) _resetAutoreleasePool +{ + if(![self poolProtected]) { + [_mainPool drain]; + _mainPool = [NSAutoreleasePool new]; + } +} #ifdef TK_MAC_DEBUG_NOTIFICATIONS - (void)_postedNotification:(NSNotification *)notification { TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); @@ -82,14 +92,17 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt #endif } - (void)_setupEventLoop { - - /*Remove private API calls here.*/ + NSAutoreleasePool *pool = [NSAutoreleasePool new]; [self finishLaunching]; [self setWindowsNeedUpdate:YES]; + [pool drain]; } - (void)_setup:(Tcl_Interp *)interp { _eventInterp = interp; + _mainPool = nil; + [NSApp setPoolProtected:NO]; _defaultMainMenu = nil; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; [self _setupMenus]; [self setDelegate:self]; #ifdef TK_MAC_DEBUG_NOTIFICATIONS @@ -98,9 +111,11 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt #endif [self _setupWindowNotifications]; [self _setupApplicationNotifications]; + [pool drain]; } - (NSString *)tkFrameworkImagePath:(NSString*)image { NSString *path = nil; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; if (tkLibPath[0] != '\0') { path = [[NSBundle bundleWithPath:[[NSString stringWithUTF8String: tkLibPath] stringByAppendingString:@"/../.."]] @@ -131,6 +146,8 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt } } #endif + [path retain]; + [pool drain]; return path; } @end @@ -157,6 +174,7 @@ static void SetApplicationIcon( ClientData clientData) { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSString *path = [NSApp tkFrameworkImagePath:@"Tk.icns"]; if (path) { NSImage *image = [[NSImage alloc] initWithContentsOfFile:path]; @@ -165,6 +183,7 @@ SetApplicationIcon( [image release]; } } + [pool drain]; } /* @@ -242,16 +261,19 @@ TkpInit( } #endif - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - [[NSUserDefaults standardUserDefaults] registerDefaults: - [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:YES], - @"_NSCanWrapButtonTitles", - [NSNumber numberWithInt:-1], - @"NSStringDrawingTypesetterBehavior", - nil]]; - [TKApplication sharedApplication]; - [NSApp _setup:interp]; + { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + [[NSUserDefaults standardUserDefaults] registerDefaults: + [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithBool:YES], + @"_NSCanWrapButtonTitles", + [NSNumber numberWithInt:-1], + @"NSStringDrawingTypesetterBehavior", + nil]]; + [TKApplication sharedApplication]; + [pool drain]; + [NSApp _setup:interp]; + } /* Check whether we are a bundled executable: */ bundleRef = CFBundleGetMainBundle(); @@ -308,12 +330,15 @@ TkpInit( Tcl_DoWhenIdle(SetApplicationIcon, NULL); } - [NSApp _setupEventLoop]; - TkMacOSXInitAppleEvents(interp); - TkMacOSXUseAntialiasedText(interp, -1); - TkMacOSXInitCGDrawing(interp, TRUE, 0); - [pool drain]; - + { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + [NSApp _setupEventLoop]; + TkMacOSXInitAppleEvents(interp); + TkMacOSXUseAntialiasedText(interp, -1); + TkMacOSXInitCGDrawing(interp, TRUE, 0); + [pool drain]; + } + /* * FIXME: Close stdin & stdout for remote debugging otherwise we will * fight with gdb for stdin & stdout @@ -469,9 +494,8 @@ TkpDisplayWarning( MODULE_SCOPE void TkMacOSXDefaultStartupScript(void) { - CFBundleRef bundleRef; - - bundleRef = CFBundleGetMainBundle(); + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + CFBundleRef bundleRef = CFBundleGetMainBundle(); if (bundleRef != NULL) { CFURLRef appMainURL = CFBundleCopyResourceURL(bundleRef, @@ -495,6 +519,7 @@ TkMacOSXDefaultStartupScript(void) CFRelease(appMainURL); } } + [pool drain]; } /* diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index d21389b..da74e60 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -328,7 +328,7 @@ static unsigned isFunctionKey(unsigned int code); pt.y = caret_y; pt = [self convertPoint: pt toView: nil]; - pt = [[self window] convertBaseToScreen: pt]; + pt = [[self window] convertPointToScreen: pt]; pt.y -= caret_height; rect.origin = pt; diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 3f4b3b5..8f20447 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -258,10 +258,10 @@ static int ModifierCharWidth(Tk_Font tkfont); if (menuPtr && mePtr) { Tcl_Interp *interp = menuPtr->interp; - /*Add time for errors to fire if necessary. This is sub-optimal but avoids issues with Tcl/Cocoa event loop integration.*/ + /*Add time for errors to fire if necessary. This is sub-optimal + *but avoids issues with Tcl/Cocoa event loop integration. + */ Tcl_Sleep(100); - - NSAutoreleasePool *pool = [NSAutoreleasePool new]; Tcl_Preserve(interp); Tcl_Preserve(menuPtr); @@ -274,7 +274,6 @@ static int ModifierCharWidth(Tk_Font tkfont); } Tcl_Release(menuPtr); Tcl_Release(interp); - [pool drain]; } } } @@ -377,13 +376,6 @@ static int ModifierCharWidth(Tk_Font tkfont); @implementation TKApplication(TKMenu) -- (void) safeSetMainMenu: (NSMenu *) menu -{ - NSAutoreleasePool* pool = [NSAutoreleasePool new]; - [self setMainMenu: menu]; - [pool drain]; -} - - (void) menuBeginTracking: (NSNotification *) notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS @@ -420,7 +412,7 @@ static int ModifierCharWidth(Tk_Font tkfont); if (!mePtr || !(mePtr->entryFlags & ENTRY_APPLE_MENU)) { applicationMenuItem = [NSMenuItem itemWithSubmenu: - [[_defaultApplicationMenu copy] autorelease]]; + [_defaultApplicationMenu copy]]; [menu insertItem:applicationMenuItem atIndex:0]; } [menu setSpecial:tkMainMenu]; @@ -428,7 +420,7 @@ static int ModifierCharWidth(Tk_Font tkfont); applicationMenu = (TKMenu *)[applicationMenuItem submenu]; if (![applicationMenu isSpecial:tkApplicationMenu]) { for (NSMenuItem *item in _defaultApplicationMenuItems) { - [applicationMenu addItem:[[item copy] autorelease]]; + [applicationMenu addItem:[item copy]]; } [applicationMenu setSpecial:tkApplicationMenu]; } @@ -438,15 +430,13 @@ static int ModifierCharWidth(Tk_Font tkfont); for (NSMenuItem *item in itemArray) { TkMenuEntry *mePtr = (TkMenuEntry *)[item tag]; TKMenu *submenu = (TKMenu *)[item submenu]; - if (mePtr && submenu) { if ((mePtr->entryFlags & ENTRY_WINDOWS_MENU) && ![submenu isSpecial:tkWindowsMenu]) { NSInteger index = 0; for (NSMenuItem *i in _defaultWindowsMenuItems) { - [submenu insertItem:[[i copy] autorelease] atIndex: - index++]; + [submenu insertItem:[i copy] atIndex:index++]; } [self setWindowsMenu:submenu]; [submenu setSpecial:tkWindowsMenu]; @@ -455,8 +445,7 @@ static int ModifierCharWidth(Tk_Font tkfont); NSInteger index = 0; for (NSMenuItem *i in _defaultHelpMenuItems) { - [submenu insertItem:[[i copy] autorelease] atIndex: - index++]; + [submenu insertItem:[i copy] atIndex:index++]; } [submenu setSpecial:tkHelpMenu]; } @@ -475,7 +464,7 @@ static int ModifierCharWidth(Tk_Font tkfont); [servicesMenuItem setSubmenu:_servicesMenu]; } [self setAppleMenu:applicationMenu]; - [self safeSetMainMenu:menu]; + [self setMainMenu:menu]; } @end diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index c703297..0737d74 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -49,7 +49,7 @@ static void TkMacOSXEventsCheckProc(ClientData clientData, int flags); @end @implementation TKApplication(TKNotify) -/* Call super then redisplay all of our windows. */ +/* Display all windows each time an event is removed from the queue.*/ - (NSEvent *)nextEventMatchingMask:(NSUInteger)mask untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag { @@ -57,9 +57,9 @@ static void TkMacOSXEventsCheckProc(ClientData clientData, int flags); untilDate:expiration inMode:mode dequeue:deqFlag]; - NSAutoreleasePool *pool = [NSAutoreleasePool new]; + /* Retain this event for later use. Must be released.*/ + [event retain]; [NSApp makeWindowsPerform:@selector(tkDisplayIfNeeded) inOrder:NO]; - [pool drain]; return event; } @@ -67,10 +67,8 @@ static void TkMacOSXEventsCheckProc(ClientData clientData, int flags); * Call super then check the pasteboard. */ - (void)sendEvent:(NSEvent *)theEvent { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; [super sendEvent:theEvent]; [NSApp tkCheckPasteboard]; - [pool drain]; } @end @@ -191,7 +189,7 @@ TkMacOSXNotifyExitHandler( * TkMacOSXEventsSetupProc -- * * This procedure implements the setup part of the MacOSX event - * source. It is invoked by Tcl_DoOneEvent before calling + * source. It is invoked by Tcl_DoOneEvent before calling * TkMacOSXEventsProc to process all queued NSEvents. In our * case, all we need to do is to set the Tcl MaxBlockTime to * 0 before starting the loop to process all queued NSEvents. @@ -200,7 +198,7 @@ TkMacOSXNotifyExitHandler( * None. * * Side effects: - * + * * If NSEvents are queued, then the maximum block time will be set * to 0 to ensure that control returns immediately to Tcl. * @@ -212,19 +210,21 @@ TkMacOSXEventsSetupProc( ClientData clientData, int flags) { - if (flags & TCL_WINDOW_EVENTS && - ![[NSRunLoop currentRunLoop] currentMode]) { + NSString *runloopMode = [[NSRunLoop currentRunLoop] currentMode]; + /* runloopMode will be nil if we are in the Tcl event loop. */ + if (flags & TCL_WINDOW_EVENTS && !runloopMode) { static Tcl_Time zeroBlockTime = { 0, 0 }; - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - /* Call this with dequeue=NO -- just checking if the queue is empty. */ + /* Call this with dequeue=NO -- just checking if the queue is empty. */ NSEvent *currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask - untilDate:[NSDate distantPast] - inMode:GetRunLoopMode(TkMacOSXGetModalSession()) - dequeue:NO]; - if (currentEvent && currentEvent.type > 0) { - Tcl_SetMaxBlockTime(&zeroBlockTime); + untilDate:[NSDate distantPast] + inMode:GetRunLoopMode(TkMacOSXGetModalSession()) + dequeue:NO]; + if (currentEvent) { + if (currentEvent.type > 0) { + Tcl_SetMaxBlockTime(&zeroBlockTime); + } + [currentEvent release]; } - [pool drain]; } } @@ -251,13 +251,14 @@ TkMacOSXEventsCheckProc( int flags) { NSString *runloopMode = [[NSRunLoop currentRunLoop] currentMode]; + /* runloopMode will be nil if we are in the Tcl event loop. */ if (flags & TCL_WINDOW_EVENTS && !runloopMode) { - NSEvent *currentEvent = nil; NSEvent *testEvent = nil; NSModalSession modalSession; do { + [NSApp _resetAutoreleasePool]; modalSession = TkMacOSXGetModalSession(); testEvent = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] @@ -272,25 +273,26 @@ TkMacOSXEventsCheckProc( untilDate:[NSDate distantPast] inMode:GetRunLoopMode(modalSession) dequeue:YES]; - if (!currentEvent) { - break; /* No events are available. */ - } - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - /* Generate Xevents. */ - int oldServiceMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); - NSEvent *processedEvent = [NSApp tkProcessEvent:currentEvent]; - Tcl_SetServiceMode(oldServiceMode); - if (processedEvent) { /* Should always be non-NULL. */ + if (currentEvent) { + [NSApp _resetAutoreleasePool]; + /* Generate Xevents. */ + int oldServiceMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); + NSEvent *processedEvent = [NSApp tkProcessEvent:currentEvent]; + Tcl_SetServiceMode(oldServiceMode); + if (processedEvent) { /* Should always be non-NULL. */ #ifdef TK_MAC_DEBUG_EVENTS - TKLog(@" event: %@", currentEvent); + TKLog(@" event: %@", currentEvent); #endif - if (modalSession) { - [NSApp _modalSession:modalSession sendEvent:currentEvent]; - } else { - [NSApp sendEvent:currentEvent]; + if (modalSession) { + [NSApp _modalSession:modalSession sendEvent:currentEvent]; + } else { + [NSApp sendEvent:currentEvent]; + } } + [currentEvent release]; + } else { + break; } - [pool drain]; } while (1); } } diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 4891b32..e635020 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -273,10 +273,13 @@ VISIBILITY_HIDDEN NSArray *_defaultApplicationMenuItems, *_defaultWindowsMenuItems; NSArray *_defaultHelpMenuItems; NSWindow *_windowWithMouse; + NSAutoreleasePool *_mainPool; } +@property BOOL poolProtected; @end @interface TKApplication(TKInit) - (NSString *)tkFrameworkImagePath:(NSString*)image; +- (void)_resetAutoreleasePool; @end @interface TKApplication(TKEvent) - (NSEvent *)tkProcessEvent:(NSEvent *)theEvent; diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index b985e5d..c1f16f3 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -131,11 +131,6 @@ XMapWindow( { MacDrawable *macWin = (MacDrawable *) window; XEvent event; - /* - * This function can be called from outside the AppKit event - * loop, so it needs its own AutoreleasePool. - */ - NSAutoreleasePool* pool = [NSAutoreleasePool new]; /* * Under certain situations it's possible for this function to be called @@ -158,6 +153,7 @@ XMapWindow( if ( [win canBecomeKeyWindow] ) { [win makeKeyAndOrderFront:NSApp]; } + /* Why do we need this? (It is used by Carbon)*/ [win windowRef]; TkMacOSXApplyWindowAttributes(macWin->winPtr, win); } @@ -194,7 +190,6 @@ XMapWindow( event.xvisibility.type = VisibilityNotify; event.xvisibility.state = VisibilityUnobscured; NotifyVisibility(macWin->winPtr, &event); - [pool drain]; } /* @@ -318,7 +313,6 @@ XResizeWindow( unsigned int height) { MacDrawable *macWin = (MacDrawable *) window; - NSAutoreleasePool *pool= [NSAutoreleasePool new]; display->request++; if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) { NSWindow *w = macWin->winPtr->wmInfoPtr->window; @@ -333,7 +327,6 @@ XResizeWindow( } else { MoveResizeWindow(macWin); } - [pool drain]; } /* @@ -366,7 +359,6 @@ XMoveResizeWindow( display->request++; if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) { NSWindow *w = macWin->winPtr->wmInfoPtr->window; - if (w) { NSRect r = NSMakeRect(x + macWin->winPtr->wmInfoPtr->xInParent, tkMacOSXZeroScreenHeight - (y + @@ -407,7 +399,6 @@ XMoveWindow( display->request++; if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) { NSWindow *w = macWin->winPtr->wmInfoPtr->window; - if (w) { [w setFrameTopLeftPoint:NSMakePoint(x, tkMacOSXZeroScreenHeight - y)]; } diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 0b32e7e..91cc348 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -808,7 +808,7 @@ ConfigureRestrictProc( { const NSRect *rectsBeingDrawn; NSInteger rectsBeingDrawnCount; - + [self getRectsBeingDrawn:&rectsBeingDrawn count:&rectsBeingDrawnCount]; #ifdef TK_MAC_DEBUG_DRAWING @@ -844,7 +844,8 @@ ConfigureRestrictProc( -(void) setFrameSize: (NSSize)newsize { - if ( [self inLiveResize] ) { + [super setFrameSize: newsize]; + if ([self inLiveResize]) { NSWindow *w = [self window]; TkWindow *winPtr = TkMacOSXGetTkWindow(w); Tk_Window tkwin = (Tk_Window) winPtr; @@ -853,17 +854,29 @@ ConfigureRestrictProc( ClientData oldArg; Tk_RestrictProc *oldProc; - /* Resize the NSView */ - [super setFrameSize: newsize]; - - /* Disable drawing until the window has been completely configured.*/ + /* This can be called from outside the Tk event loop. + * Since it calls Tcl_DoOneEvent, we need to make sure we + * don't clobber the AutoreleasePool set up by the caller. + */ + [NSApp setPoolProtected:YES]; + + /* + * Try to prevent flickers and flashes. + * + * This stops the flickers, but on OSX 10.11 flashes still occur when + * the width of the window is 16, 32, 48, 64, 80, 96, 112, 256, 512, + * 768, ... + */ + [w disableFlushWindow]; + + /* Disable Tk drawing until the window has been completely configured.*/ TkMacOSXSetDrawingEnabled(winPtr, 0); /* Generate and handle a ConfigureNotify event for the new size.*/ TkGenWMConfigureEvent(tkwin, Tk_X(tkwin), Tk_Y(tkwin), width, height, TK_SIZE_CHANGED | TK_MACOSX_HANDLE_EVENT_IMMEDIATELY); oldProc = Tk_RestrictEvents(ConfigureRestrictProc, NULL, &oldArg); - while ( Tk_DoOneEvent(TK_X_EVENTS|TK_DONT_WAIT) ) {} + while (Tk_DoOneEvent(TK_X_EVENTS|TK_DONT_WAIT)) {} Tk_RestrictEvents(oldProc, oldArg, &oldArg); /* Now that Tk has configured all subwindows we can create the clip regions. */ @@ -875,9 +888,10 @@ ConfigureRestrictProc( HIRect bounds = NSRectToCGRect([self bounds]); HIShapeRef shape = HIShapeCreateWithRect(&bounds); [self generateExposeEvents: shape]; - while ( Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT) ) {} - } else { - [super setFrameSize: newsize]; + while (Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT)) {} + [w enableFlushWindow]; + [w flushWindowIfNeeded]; + [NSApp setPoolProtected:NO]; } } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 4ce2206..50cac20 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -408,18 +408,23 @@ static void RemapWindows(TkWindow *winPtr, if (title == nil) { title = "unnamed window"; } - printf("Retained <%s>. Count is: %lu\n", title, [self retainCount]); + if (DEBUG_ZOMBIES > 1){ + printf("Retained <%s>. Count is: %lu\n", title, [self retainCount]); + } return result; } - (id) autorelease { + static int xcount = 0; id result = [super autorelease]; const char *title = [[self title] UTF8String]; if (title == nil) { title = "unnamed window"; } - printf("Autoreleased <%s>. Count is %lu\n", title, [self retainCount]); + if (DEBUG_ZOMBIES > 1){ + printf("Autoreleased <%s>. Count is %lu\n", title, [self retainCount]); + } return result; } @@ -428,9 +433,24 @@ static void RemapWindows(TkWindow *winPtr, if (title == nil) { title = "unnamed window"; } - printf("Releasing <%s>. Count is %lu\n", title, [self retainCount]); + if (DEBUG_ZOMBIES > 1){ + printf("Releasing <%s>. Count is %lu\n", title, [self retainCount]); + } [super release]; } + +- (void) dealloc { + const char *title = [[self title] UTF8String]; + if (title == nil) { + title = "unnamed window"; + } + if (DEBUG_ZOMBIES > 0){ + printf(">>>> Freeing <%s>. Count is %lu\n", title, [self retainCount]); + } + [super dealloc]; +} + + #endif @end @@ -544,7 +564,6 @@ FrontWindowAtPoint( int x, int y) { NSPoint p = NSMakePoint(x, tkMacOSXZeroScreenHeight - y); - NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSArray *windows = [NSApp orderedWindows]; TkWindow *front = NULL; @@ -554,7 +573,6 @@ FrontWindowAtPoint( break; } } - [pool drain]; return front; } @@ -860,7 +878,6 @@ TkWmDeadWindow( NSWindow *window = wmPtr->window; if (window && !Tk_IsEmbedded(winPtr) ) { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSWindow *parent = [window parentWindow]; if (parent) { [parent removeChildWindow:window]; @@ -870,29 +887,33 @@ TkWmDeadWindow( if (winPtr->window) { ((MacDrawable *) winPtr->window)->view = nil; } -#if DEBUG_ZOMBIES +#if DEBUG_ZOMBIES > 0 { const char *title = [[window title] UTF8String]; if (title == nil) { title = "unnamed window"; } - printf("Closing <%s>. Count is: %lu\n", title, [window retainCount]); + printf(">>>> Closing <%s>. Count is: %lu\n", title, [window retainCount]); } #endif [window release]; wmPtr->window = NULL; - /* Activate the highest window left on the screen. */ - NSArray *windows = [NSApp orderedWindows]; - if ( [windows count] > 0 ) { - NSWindow *front = [windows objectAtIndex:0]; - if ( front && [front canBecomeKeyWindow] ) { - [front makeKeyAndOrderFront:NSApp]; - } - } - [pool drain]; - } + + /* Activate the highest window left on the screen. */ + NSArray *windows = [NSApp orderedWindows]; + if ( [windows count] > 0 ) { + NSWindow *front = [windows objectAtIndex:0]; + if ( front && [front canBecomeKeyWindow] ) { + [front makeKeyAndOrderFront:NSApp]; + } + } +#if DEBUG_ZOMBIES > 0 + fprintf(stderr, "================= Pool dump ===================\n"); + [NSAutoreleasePool showPools]; +#endif ckfree((char *)wmPtr); winPtr->wmInfoPtr = NULL; + } } /* @@ -5478,9 +5499,6 @@ TkMacOSXMakeRealWindowExist( * TODO: Here we should handle out of process embedding. */ } - - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - WindowClass macClass = wmPtr->macClass; wmPtr->attributes &= (tkAlwaysValidAttributes | macClassAttrs[macClass].validAttrs); @@ -5514,10 +5532,10 @@ TkMacOSXMakeRealWindowExist( NSWindow *window = [[winClass alloc] initWithContentRect:contentRect styleMask:styleMask backing:NSBackingStoreBuffered defer:YES]; if (!window) { - Tcl_Panic("couldn't allocate new Mac window"); + Tcl_Panic("couldn't allocate new Mac window"); } TKContentView *contentView = [[TKContentView alloc] - initWithFrame:NSZeroRect]; + initWithFrame:NSZeroRect]; [window setContentView:contentView]; [contentView release]; [window setDelegate:NSApp]; @@ -5552,7 +5570,7 @@ TkMacOSXMakeRealWindowExist( [window setDocumentEdited:NO]; wmPtr->window = window; - macWin->view = contentView; + macWin->view = window.contentView; TkMacOSXApplyWindowAttributes(winPtr, window); NSRect geometry = InitialWindowBounds(winPtr, window); @@ -5561,11 +5579,8 @@ TkMacOSXMakeRealWindowExist( geometry.origin.y = tkMacOSXZeroScreenHeight - (geometry.origin.y + geometry.size.height); [window setFrame:geometry display:NO]; - TkMacOSXRegisterOffScreenWindow((Window) macWin, window); macWin->flags |= TK_HOST_EXISTS; - - [pool drain]; } /* @@ -5958,7 +5973,6 @@ TkpChangeFocus( if (Tk_IsTopLevel(winPtr) && !Tk_IsEmbedded(winPtr) ){ NSWindow *win = TkMacOSXDrawableWindow(winPtr->window); - NSAutoreleasePool *pool = [NSAutoreleasePool new]; TkWmRestackToplevel(winPtr, Above, NULL); if (force ) { [NSApp activateIgnoringOtherApps:YES]; @@ -5966,7 +5980,6 @@ TkpChangeFocus( if ( win && [win canBecomeKeyWindow] ) { [win makeKeyAndOrderFront:NSApp]; } - [pool drain]; } /* diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index 4bdd1c4..a16daa8 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -142,6 +142,7 @@ TkpOpenDisplay( static NSRect maxBounds = {{0, 0}, {0, 0}}; static char vendor[25] = ""; NSArray *cgVers; + NSAutoreleasePool *pool = [NSAutoreleasePool new]; if (gMacDisplay != NULL) { if (strcmp(gMacDisplay->display->display_name, display_name) == 0) { @@ -151,8 +152,6 @@ TkpOpenDisplay( } } - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - display = (Display *) ckalloc(sizeof(Display)); screen = (Screen *) ckalloc(sizeof(Screen)); bzero(display, sizeof(Display)); -- cgit v0.12 From b0403585584cc0e6e4518f2cd03ac46fa21db2f9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 17 Dec 2015 15:03:11 +0000 Subject: spacing --- macosx/tkMacOSXInit.c | 2 +- macosx/tkMacOSXNotify.c | 2 +- macosx/tkMacOSXWindowEvent.c | 6 +++--- macosx/tkMacOSXXStubs.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index c658149..997d306 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -348,7 +348,7 @@ TkpInit( TkMacOSXInitCGDrawing(interp, TRUE, 0); [pool drain]; } - + /* * FIXME: Close stdin & stdout for remote debugging otherwise we will * fight with gdb for stdin & stdout diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 06207e2..1455688 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -261,7 +261,7 @@ TkMacOSXEventsCheckProc( NSEvent *currentEvent = nil; NSEvent *testEvent = nil; NSModalSession modalSession; - + do { [NSApp _resetAutoreleasePool]; modalSession = TkMacOSXGetModalSession(); diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 1150f2e..95ebb25 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -806,7 +806,7 @@ ConfigureRestrictProc( { const NSRect *rectsBeingDrawn; NSInteger rectsBeingDrawnCount; - + [self getRectsBeingDrawn:&rectsBeingDrawn count:&rectsBeingDrawnCount]; #ifdef TK_MAC_DEBUG_DRAWING @@ -855,7 +855,7 @@ ConfigureRestrictProc( * don't clobber the AutoreleasePool set up by the caller. */ [NSApp setPoolProtected:YES]; - + /* * Try to prevent flickers and flashes. * @@ -864,7 +864,7 @@ ConfigureRestrictProc( * 768, ... :^( */ [w disableFlushWindow]; - + /* Disable Tk drawing until the window has been completely configured.*/ TkMacOSXSetDrawingEnabled(winPtr, 0); diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index 53d1eb8..5d6ffb9 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -143,7 +143,7 @@ TkpOpenDisplay( static char vendor[25] = ""; NSArray *cgVers; NSAutoreleasePool *pool = [NSAutoreleasePool new]; - + if (gMacDisplay != NULL) { if (strcmp(gMacDisplay->display->display_name, display_name) == 0) { return gMacDisplay; -- cgit v0.12 From 816ab6c14bd318a6918e1cb3cd97e1de92419e1a Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 19 Dec 2015 21:48:11 +0000 Subject: Tests reordered. Two issues currently: 1. text-11a.22 currently hangs but should pass once [.text sync -command $cmd] will be correctly implemented. 2. text-11a.41 fails (unsure why) --- tests/text.test | 118 ++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 80 insertions(+), 38 deletions(-) diff --git a/tests/text.test b/tests/text.test index 89dd12c..cdc14c0 100644 --- a/tests/text.test +++ b/tests/text.test @@ -957,23 +957,52 @@ test text-11.10 {TextWidgetCmd procedure, "insert" option} { list [.t get 1.0 1.end] [.t tag ranges bold] [.t tag ranges silly] } {{First second} {1.0 1.5} {1.5 1.12}} -test text-11a.1 {TextWidgetCmd procedure, "sync" option} -setup { +test text-11a.1 {TextWidgetCmd procedure, "pendingsync" option} -setup { destroy .yt } -body { text .yt - list [catch {.yt sync mytext} msg] $msg + list [catch {.yt pendingsync mytext} msg] $msg } -cleanup { destroy .yt -} -result {1 {wrong # args: should be ".yt sync ?-command command?"}} -test text-11a.2 {TextWidgetCmd procedure, "sync" option with -command} -setup { +} -result {1 {wrong # args: should be ".yt pendingsync"}} +test text-11a.2 {TextWidgetCmd procedure, "pendingsync" option} -setup { + destroy .top.yt .top +} -body { + toplevel .top + pack [text .top.yt] + set content {} + for {set i 1} {$i < 300} {incr i} { + append content [string repeat "$i " 15] \n + } + .top.yt insert 1.0 $content + # wait for end of line metrics calculation to get correct $fraction1 + # as a reference + while {[.top.yt pendingsync]} {update} + .top.yt yview moveto 1 + set fraction1 [lindex [.top.yt yview] 0] + set res [expr {$fraction1 > 0}] + .top.yt delete 1.0 end + .top.yt insert 1.0 $content + # ensure the test is relevant + lappend res [.top.yt pendingsync] + # asynchronously wait for completion of line metrics calculation + while {[.top.yt pendingsync]} {update} + .top.yt yview moveto $fraction1 + set fraction2 [lindex [.top.yt yview] 0] + lappend res [expr {$fraction1 == $fraction2}] +} -cleanup { + destroy .top.yt .top +} -result {1 1 1} + +test text-11a.11 {TextWidgetCmd procedure, "sync" option} -setup { destroy .yt } -body { text .yt - list [catch {.yt sync -comx foo} msg] $msg + list [catch {.yt sync mytext} msg] $msg } -cleanup { destroy .yt -} -result {1 {wrong option "-comx": should be "-command"}} -test text-11a.3 {TextWidgetCmd procedure, "sync" option} -setup { +} -result {1 {wrong # args: should be ".yt sync ?-command command?"}} +test text-11a.12 {TextWidgetCmd procedure, "sync" option} -setup { destroy .top.yt .top } -body { toplevel .top @@ -1005,56 +1034,44 @@ test text-11a.3 {TextWidgetCmd procedure, "sync" option} -setup { } -cleanup { destroy .top.yt .top } -result {1 0 1} -test text-11a.4 {TextWidgetCmd procedure, "sync" option with -command} -setup { - destroy .yt -} -body { - set ::x 0 - pack [text .yt] -expand 1 -fill both - .yt sync -command [list set ::x 1] - set ::x -} -cleanup { - destroy .yt -} -result {1} -test text-11a.11 {TextWidgetCmd procedure, "pendingsync" option} -setup { +test text-11a.21 {TextWidgetCmd procedure, "sync" option with -command} -setup { destroy .yt } -body { text .yt - list [catch {.yt pendingsync mytext} msg] $msg + list [catch {.yt sync -comx foo} msg] $msg } -cleanup { destroy .yt -} -result {1 {wrong # args: should be ".yt pendingsync"}} -test text-11a.12 {TextWidgetCmd procedure, "pendingsync" option} -setup { +} -result {1 {wrong option "-comx": should be "-command"}} +test text-11a.22 {TextWidgetCmd procedure, "sync" option with -command} -setup { destroy .top.yt .top } -body { + set res {} + set ::x 0 toplevel .top pack [text .top.yt] set content {} - for {set i 1} {$i < 300} {incr i} { + for {set i 1} {$i < 30} {incr i} { append content [string repeat "$i " 15] \n } .top.yt insert 1.0 $content - update - # wait for end of line metrics calculation to get correct $fraction1 - # as a reference - while {[.top.yt pendingsync]} {update} - .top.yt yview moveto 1 - set fraction1 [lindex [.top.yt yview] 0] - set res [expr {$fraction1 > 0}] - .top.yt delete 1.0 end - .top.yt insert 1.0 $content - # ensure the test is relevant + # first case: line metrics calculation still running when launching 'sync -command' lappend res [.top.yt pendingsync] - # asynchronously wait for completion of line metrics calculation + .top.yt sync -command [list set ::x 1] + lappend res $::x + # now finish line metrics calculations while {[.top.yt pendingsync]} {update} - .top.yt yview moveto $fraction1 - set fraction2 [lindex [.top.yt yview] 0] - lappend res [expr {$fraction1 == $fraction2}] + lappend res [.top.yt pendingsync] $::x + # second case: line metrics calculation completed when launching 'sync -command' + .top.yt sync -command [list set ::x 2] + lappend res $::x + vwait ::x + lappend res $::x } -cleanup { destroy .top.yt .top -} -result {1 1 1} +} -result {1 0 0 1 1 2} -test text-11a.21 {"<>" event} -setup { +test text-11a.31 {"<>" event} -setup { destroy .top.yt .top } -body { toplevel .top @@ -1086,6 +1103,31 @@ test text-11a.21 {"<>" event} -setup { destroy .top.yt .top } -result {1 1 1} +test text-11a.41 {"sync" "pendingsync" and <>} -setup { + destroy .top.yt .top +} -body { + set res {} + toplevel .top + pack [text .top.yt] + set content {} + for {set i 1} {$i < 300} {incr i} { + append content [string repeat "$i " 50] \n + } + bind .top.yt <> {lappend res Sync:%d} + .top.yt insert 1.0 $content + update + # ensure the test is relevant + lappend res [.top.yt pendingsync] + # - there is no more any pending sync after running 'sync' + # - <> fires when sync returns if there was pending syncs + .top.yt sync + lappend res [.top.yt pendingsync] + update + set res +} -cleanup { + destroy .top.yt .top +} -result {Sync:0 1 0 Sync:1} + # edit, mark, scan, search, see, tag, window, xview and yview actions are tested elsewhere. test text-12.1 {ConfigureText procedure} { -- cgit v0.12 From 801439653efba1124e5dc705bdcd018062719562 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 20 Dec 2015 22:09:14 +0000 Subject: There could be false negatives with [.text pendingsync] when line metrics calculation is in the middle of a long line. --- generic/tkTextDisp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 108cc4a..ba584ac 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -6144,8 +6144,9 @@ TkTextPendingsync( TextDInfo *dInfoPtr = textPtr->dInfoPtr; return ( - (dInfoPtr->lastMetricUpdateLine - dInfoPtr->currentMetricUpdateLine) ? - 1 : 0); + ((dInfoPtr->metricEpoch == -1) && + (dInfoPtr->lastMetricUpdateLine == dInfoPtr->currentMetricUpdateLine)) ? + 0 : 1); } /* -- cgit v0.12 From f3e4c6787e4309d230f3d102105b2ebedf2d12ca Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 20 Dec 2015 22:16:36 +0000 Subject: Test text-11a.41 now correctly written passes. --- tests/text.test | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/text.test b/tests/text.test index cdc14c0..2487df7 100644 --- a/tests/text.test +++ b/tests/text.test @@ -1115,18 +1115,18 @@ test text-11a.41 {"sync" "pendingsync" and <>} -setup { } bind .top.yt <> {lappend res Sync:%d} .top.yt insert 1.0 $content - update + vwait res ; # event dealt with by the event loop, with %d==0 i.e. we're out of sync # ensure the test is relevant - lappend res [.top.yt pendingsync] - # - there is no more any pending sync after running 'sync' + lappend res "Pending:[.top.yt pendingsync]" # - <> fires when sync returns if there was pending syncs + # - there is no more any pending sync after running 'sync' .top.yt sync - lappend res [.top.yt pendingsync] - update + vwait res ; # event dealt with by the event loop, with %d==1 i.e. we're in sync again + lappend res "Pending:[.top.yt pendingsync]" set res } -cleanup { destroy .top.yt .top -} -result {Sync:0 1 0 Sync:1} +} -result {Sync:0 Pending:1 Sync:1 Pending:0} # edit, mark, scan, search, see, tag, window, xview and yview actions are tested elsewhere. -- cgit v0.12 From dcb68b1c9c9f143fc7459480396bf38a6a89d011 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 23 Dec 2015 11:29:34 +0000 Subject: Fixed bug [2f78c7c5ea] - text segfault with tablelist in TkBTreeLinesTo --- generic/tkTextDisp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index ef8d6f4..b832443 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -4803,9 +4803,15 @@ TextRedrawTag( /* * Round up the starting position if it's before the first line visible on - * the screen (we only care about what's on the screen). + * the screen (we only care about what's on the screen). Beware that the + * display info structure might need update, for instance if we arrived + * here after a delete operation triggering a trace running a tag removal + * covering the whole contents of the text widget. */ + if (dInfoPtr->flags & DINFO_OUT_OF_DATE) { + UpdateDisplayInfo(textPtr); + } dlPtr = dInfoPtr->dLinePtr; if (dlPtr == NULL) { return; -- cgit v0.12 From 9e128a5e118f9b0ce894219129ba49b53f6cc3a8 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 23 Dec 2015 16:36:56 +0000 Subject: Added new test textDisp-9.14 to check against regression regarding bug [2f78c7c5ea] --- tests/textDisp.test | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/textDisp.test b/tests/textDisp.test index 038eccd..ea4d0c2 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -1333,6 +1333,30 @@ test textDisp-9.13 {TkTextRedrawTag} { update list $tk_textRelayout $tk_textRedraw } {{2.0 6.0 7.0} {2.0 6.0 7.0}} +test textDisp-9.14 {TkTextRedrawTag} { + pack [text .tnocrash] + for {set i 1} {$i < 6} {incr i} { + .tnocrash insert end \nfoo$i + } + .tnocrash tag configure mytag1 -relief raised + .tnocrash tag configure mytag2 -relief solid + update + proc doit {} { + .tnocrash tag add mytag1 4.0 5.0 + .tnocrash tag add mytag2 4.0 5.0 + after idle { + .tnocrash tag remove mytag1 1.0 end + .tnocrash tag remove mytag2 1.0 end + } + .tnocrash delete 1.0 2.0 + } + doit ; # must not crash + after 500 { + destroy .tnocrash + set done 1 + } + vwait done +} {} test textDisp-10.1 {TkTextRelayoutWindow} { .t configure -wrap char -- cgit v0.12 From a9da52862c63ba71773ced3f712e3565c2b3d81b Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 23 Dec 2015 16:43:16 +0000 Subject: Better comment about the fix, since the issue is now fully understood. --- generic/tkTextDisp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index b832443..133a7d7 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -4805,8 +4805,9 @@ TextRedrawTag( * Round up the starting position if it's before the first line visible on * the screen (we only care about what's on the screen). Beware that the * display info structure might need update, for instance if we arrived - * here after a delete operation triggering a trace running a tag removal - * covering the whole contents of the text widget. + * here from an 'after idle' script removing tags in a range whose + * display lines (and dInfo) were partially invalidated by a previous + * delete operation in the text widget. */ if (dInfoPtr->flags & DINFO_OUT_OF_DATE) { -- cgit v0.12 From 72714043437b73af454d18ff6def2c16d810c758 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 23 Dec 2015 17:08:24 +0000 Subject: Made test textDisp-16.18 pass again on Win7 after [a4bf73e4b8]: map the text widget earlier --- tests/textDisp.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/textDisp.test b/tests/textDisp.test index 038eccd..7aa2fef 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -2021,9 +2021,9 @@ test textDisp-16.18 {TkTextYviewCmd procedure, "moveto" roundoff} {textfonts} { wm geometry .top1 +0+0 text .top1.t -height 3 -width 4 -wrap none -setgrid 1 -padx 6 \ -spacing3 6 - .top1.t insert end "1\n2\n3\n4\n5\n6" pack .top1.t update + .top1.t insert end "1\n2\n3\n4\n5\n6" .top1.t yview moveto 0.3333 set result [.top1.t yview] destroy .top1 -- cgit v0.12 From 7fba872bef36903476be033836a8394fd742a1c0 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 26 Dec 2015 20:52:21 +0000 Subject: [.text sync -command $cmd] schedules execution of $cmd by the event loop at idle time --- generic/tkText.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- generic/tkText.h | 3 ++- generic/tkTextDisp.c | 22 +++++++++++----------- 3 files changed, 62 insertions(+), 14 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index a2b7dde..0cb8431 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -397,6 +397,7 @@ static int TextSearchIndexInLine(const SearchSpec *searchSpecPtr, static int TextPeerCmd(TkText *textPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static TkUndoProc TextUndoRedoCallback; +static void RunAfterSyncCmd(ClientData clientData); /* * Declarations of the three search procs required by the multi-line search @@ -1512,8 +1513,8 @@ TextWidgetObjCmd( } textPtr->afterSyncCmd = cmd; } else { - result = Tcl_EvalObjEx(interp, cmd, TCL_EVAL_GLOBAL); - Tcl_DecrRefCount(cmd); + textPtr->afterSyncCmd = cmd; + Tcl_DoWhenIdle(RunAfterSyncCmd, (ClientData) textPtr); } break; } else if (objc != 2) { @@ -6747,6 +6748,52 @@ TkpTesttextCmd( } /* + *---------------------------------------------------------------------- + * + * RunAfterSyncCmd -- + * + * This function is called by the event loop and excutes the command + * scheduled by [.text sync -command $cmd]. + * + * Results: + * None. + * + * Side effects: + * Anything may happen, depending on $cmd contents. + * + *---------------------------------------------------------------------- + */ + +static void +RunAfterSyncCmd( + ClientData clientData) /* Information about text widget. */ +{ + register TkText *textPtr = (TkText *) clientData; + int code; + + if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { + /* + * The widget has been deleted. Don't do anything. + */ + + if (--textPtr->refCount == 0) { + ckfree((char *) textPtr); + } + return; + } + + Tcl_Preserve((ClientData) textPtr->interp); + code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, TCL_EVAL_GLOBAL); + if (code == TCL_ERROR) { + Tcl_AddErrorInfo(textPtr->interp, "\n (text sync)"); + Tcl_BackgroundError(textPtr->interp); + } + Tcl_Release((ClientData) textPtr->interp); + Tcl_DecrRefCount(textPtr->afterSyncCmd); + textPtr->afterSyncCmd = NULL; +} + +/* * Local Variables: * mode: c * c-basic-offset: 4 diff --git a/generic/tkText.h b/generic/tkText.h index 49ee479..ea8ce07 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -782,7 +782,8 @@ typedef struct TkText { * statements. */ int autoSeparators; /* Non-zero means the separators will be * inserted automatically. */ - Tcl_Obj *afterSyncCmd; /* Command to be executed when lines are up to date */ + Tcl_Obj *afterSyncCmd; /* Command to be executed when lines are up to + * date */ } TkText; /* diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index ba584ac..39311a6 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2958,18 +2958,18 @@ AsyncUpdateLineMetrics( * above). If there is a registered aftersync command, run that first. */ - if (textPtr->afterSyncCmd != NULL) { - int code; - Tcl_Preserve((ClientData)textPtr->interp); - code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, TCL_EVAL_GLOBAL); - if (code != TCL_OK && code != TCL_CONTINUE - && code != TCL_BREAK) { - Tcl_AddErrorInfo(textPtr->interp, "\n (text sync)"); - Tcl_BackgroundError(textPtr->interp); + if (textPtr->afterSyncCmd) { + int code; + Tcl_Preserve((ClientData) textPtr->interp); + code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, + TCL_EVAL_GLOBAL); + if (code == TCL_ERROR) { + Tcl_AddErrorInfo(textPtr->interp, "\n (text sync)"); + Tcl_BackgroundError(textPtr->interp); } - Tcl_Release((ClientData)textPtr->interp); - Tcl_DecrRefCount(textPtr->afterSyncCmd); - textPtr->afterSyncCmd = 0; + Tcl_Release((ClientData) textPtr->interp); + Tcl_DecrRefCount(textPtr->afterSyncCmd); + textPtr->afterSyncCmd = NULL; } /* -- cgit v0.12 From eaa2bc5a17aaa0d49db3353dff3d73e09169394a Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 30 Dec 2015 22:07:25 +0000 Subject: Fixed bug [1288433] - LisboxSelect event triggers when listbox state is disabled --- doc/listbox.n | 9 ++++++--- library/listbox.tcl | 36 +++++++++++++++++++++++++----------- tests/listbox.test | 24 ++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 14 deletions(-) diff --git a/doc/listbox.n b/doc/listbox.n index 642e1f0..aecc8e2 100644 --- a/doc/listbox.n +++ b/doc/listbox.n @@ -431,9 +431,12 @@ Most people will probably want to use \fBbrowse\fR mode for single selections and \fBextended\fR mode for multiple selections; the other modes appear to be useful only in special situations. .PP -Any time the selection changes in the listbox, the virtual event -\fB<>\fR will be generated. It is easiest to bind -to this event to be made aware of any changes to listbox selection. +Any time the set of selected item(s) in the listbox is updated by the +user through the keyboard or mouse, the virtual event +\fB<>\fR will be generated. This virtual event will not +be generated when adjusting the selection with the \fIpathName +\fBselection\fR command. It is easiest to bind to this event to be +made aware of any user changes to listbox selection. .PP In addition to the above behavior, the following additional behavior is defined by the default bindings: diff --git a/library/listbox.tcl b/library/listbox.tcl index 2d9af20..5087786 100644 --- a/library/listbox.tcl +++ b/library/listbox.tcl @@ -118,7 +118,7 @@ bind Listbox { %W see 0 %W selection clear 0 end %W selection set 0 - event generate %W <> + tk::FireListboxSelectEvent %W } bind Listbox { tk::ListboxDataExtend %W 0 @@ -128,7 +128,7 @@ bind Listbox { %W see end %W selection clear 0 end %W selection set end - event generate %W <> + tk::FireListboxSelectEvent %W } bind Listbox { tk::ListboxDataExtend %W [%W index end] @@ -163,7 +163,7 @@ bind Listbox { bind Listbox { if {[%W cget -selectmode] ne "browse"} { %W selection clear 0 end - event generate %W <> + tk::FireListboxSelectEvent %W } } @@ -243,7 +243,7 @@ proc ::tk::ListboxBeginSelect {w el {focus 1}} { set Priv(listboxSelection) {} set Priv(listboxPrev) $el } - event generate $w <> + tk::FireListboxSelectEvent $w # check existence as ListboxSelect may destroy us if {$focus && [winfo exists $w] && [$w cget -state] eq "normal"} { focus $w @@ -271,7 +271,7 @@ proc ::tk::ListboxMotion {w el} { $w selection clear 0 end $w selection set $el set Priv(listboxPrev) $el - event generate $w <> + tk::FireListboxSelectEvent $w } extended { set i $Priv(listboxPrev) @@ -302,7 +302,7 @@ proc ::tk::ListboxMotion {w el} { incr i -1 } set Priv(listboxPrev) $el - event generate $w <> + tk::FireListboxSelectEvent $w } } } @@ -353,7 +353,7 @@ proc ::tk::ListboxBeginToggle {w el} { } else { $w selection set $el } - event generate $w <> + tk::FireListboxSelectEvent $w } } @@ -405,7 +405,7 @@ proc ::tk::ListboxUpDown {w amount} { browse { $w selection clear 0 end $w selection set active - event generate $w <> + tk::FireListboxSelectEvent $w } extended { $w selection clear 0 end @@ -413,7 +413,7 @@ proc ::tk::ListboxUpDown {w amount} { $w selection anchor active set Priv(listboxPrev) [$w index active] set Priv(listboxSelection) {} - event generate $w <> + tk::FireListboxSelectEvent $w } } } @@ -501,7 +501,7 @@ proc ::tk::ListboxCancel w { } incr first } - event generate $w <> + tk::FireListboxSelectEvent $w } # ::tk::ListboxSelectAll @@ -521,5 +521,19 @@ proc ::tk::ListboxSelectAll w { } else { $w selection set 0 end } - event generate $w <> + tk::FireListboxSelectEvent $w +} + +# ::tk::FireListboxSelectEvent +# +# Fire the <> event if the listbox is not in disabled +# state. +# +# Arguments: +# w - The listbox widget. + +proc ::tk::FireListboxSelectEvent w { + if {[$w cget -state] eq "normal"} { + event generate $w <> + } } diff --git a/tests/listbox.test b/tests/listbox.test index b4046b6..b01652b 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -2169,6 +2169,30 @@ test listbox-30.1 {Bug 3607326} -setup { unset -nocomplain a } -result * -match glob -returnCodes error +test listbox-31.1 {<> event} -setup { + destroy .l + unset -nocomplain res +} -body { + pack [listbox .l -state normal] + update + bind .l <> {lappend res [%W curselection]} + .l insert end a b c + focus -force .l + event generate .l <1> -x 5 -y 5 ; # <> fires + .l configure -state disabled + focus -force .l + event generate .l ; # <> does NOT fire + .l configure -state normal + focus -force .l + event generate .l ; # <> fires + .l selection clear 0 end ; # <> does NOT fire + .l selection set 1 1 ; # <> does NOT fire + lappend res [.l curselection] +} -cleanup { + destroy .l + unset -nocomplain res +} -result {0 2 1} + resetGridInfo deleteWindows option clear -- cgit v0.12 From 13cdecd256069109fe277a62a153cb31b3a1348b Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 31 Dec 2015 13:50:50 +0000 Subject: Fixed bug [3102228] - <> doesn't fire when selection lost --- generic/tkListbox.c | 35 +++++++++++++++++++++++++++++++++++ tests/listbox.test | 15 +++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 248dd7b..ff72596 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -401,6 +401,7 @@ static void ListboxEventProc(ClientData clientData, static int ListboxFetchSelection(ClientData clientData, int offset, char *buffer, int maxBytes); static void ListboxLostSelection(ClientData clientData); +static void GenerateListboxSelectEvent(Listbox *listPtr); static void EventuallyRedrawRange(Listbox *listPtr, int first, int last); static void ListboxScanTo(Listbox *listPtr, int x, int y); @@ -3177,12 +3178,46 @@ ListboxLostSelection( if ((listPtr->exportSelection) && (listPtr->nElements > 0)) { ListboxSelect(listPtr, 0, listPtr->nElements-1, 0); + GenerateListboxSelectEvent(listPtr); } } /* *---------------------------------------------------------------------- * + * GenerateListboxSelectEvent -- + * + * Send an event that the listbox selection was updated. This is + * equivalent to event generate $listboxWidget <> + * + * Results: + * None + * + * Side effects: + * Any side effect possible, depending on bindings to this event. + * + *---------------------------------------------------------------------- + */ + +static void +GenerateListboxSelectEvent( + Listbox *listPtr) /* Information about widget. */ +{ + union {XEvent general; XVirtualEvent virtual;} event; + + memset(&event, 0, sizeof(event)); + event.general.xany.type = VirtualEvent; + event.general.xany.serial = NextRequest(Tk_Display(listPtr->tkwin)); + event.general.xany.send_event = False; + event.general.xany.window = Tk_WindowId(listPtr->tkwin); + event.general.xany.display = Tk_Display(listPtr->tkwin); + event.virtual.name = Tk_GetUid("ListboxSelect"); + Tk_HandleEvent(&event.general); +} + +/* + *---------------------------------------------------------------------- + * * EventuallyRedrawRange -- * * Ensure that a given range of elements is eventually redrawn on the diff --git a/tests/listbox.test b/tests/listbox.test index b4046b6..7952abd 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -2169,6 +2169,21 @@ test listbox-30.1 {Bug 3607326} -setup { unset -nocomplain a } -result * -match glob -returnCodes error +test listbox-31.2 {<> event on lost selection} -setup { + destroy .l +} -body { + pack [listbox .l -exportselection true] + update + bind .l <> {lappend res [list [selection own] [%W curselection]]} + .l insert end a b c + focus -force .l + event generate .l <1> -x 5 -y 5 ; # <> fires + selection clear ; # <> fires again + set res +} -cleanup { + destroy .l +} -result {{.l 0} {{} {}}} + resetGridInfo deleteWindows option clear -- cgit v0.12 From 915557944f9230377dfa08852f0f51d1c6e9dadf Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 4 Jan 2016 17:34:53 +0000 Subject: Fixed bug [1510538] - Wrong initial scrollbar width --- win/tkWinScrlbr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index 46aad58..fc9685d 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.c @@ -218,10 +218,10 @@ CreateProc( if (scrollPtr->info.vertical) { style = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS - | SBS_VERT | SBS_RIGHTALIGN; + | SBS_VERT; } else { style = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS - | SBS_HORZ | SBS_BOTTOMALIGN; + | SBS_HORZ; } scrollPtr->hwnd = CreateWindow("SCROLLBAR", NULL, style, -- cgit v0.12 From 24e81e277b14fd83eab9b110fbb9ea459baef7d2 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 5 Jan 2016 15:32:27 +0000 Subject: Fixed bug [1305128] - Scrollbar doesn't receive event --- generic/tkScrollbar.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index 3fff58d..ba42c20 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -627,6 +627,8 @@ TkScrollbarEventProc( TkScrollbarEventuallyRedraw(scrollPtr); } } + } else if (eventPtr->type == MapNotify) { + TkScrollbarEventuallyRedraw(scrollPtr); } } -- cgit v0.12 From d429b10b89cba5a8dd80ca4eb3874dea424e5fb7 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 5 Jan 2016 16:12:39 +0000 Subject: Typo fixed in comment --- generic/tkText.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkText.c b/generic/tkText.c index 0cb8431..c12c9a5 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -6752,7 +6752,7 @@ TkpTesttextCmd( * * RunAfterSyncCmd -- * - * This function is called by the event loop and excutes the command + * This function is called by the event loop and executes the command * scheduled by [.text sync -command $cmd]. * * Results: -- cgit v0.12 From e4067df1777998f73378f3a6e18f372a985bad0c Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 5 Jan 2016 16:25:50 +0000 Subject: Moved RunAfterSyncCmd procedure --- generic/tkText.c | 94 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index c12c9a5..3389733 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -388,6 +388,7 @@ static Tcl_Obj * TextGetText(const TkText *textPtr, const TkTextIndex *index2, int visibleOnly); static void GenerateModifiedEvent(TkText *textPtr); static void UpdateDirtyFlag(TkSharedText *sharedPtr); +static void RunAfterSyncCmd(ClientData clientData); static void TextPushUndoAction(TkText *textPtr, Tcl_Obj *undoString, int insert, const TkTextIndex *index1Ptr, @@ -397,7 +398,6 @@ static int TextSearchIndexInLine(const SearchSpec *searchSpecPtr, static int TextPeerCmd(TkText *textPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static TkUndoProc TextUndoRedoCallback; -static void RunAfterSyncCmd(ClientData clientData); /* * Declarations of the three search procs required by the multi-line search @@ -5377,6 +5377,52 @@ UpdateDirtyFlag( /* *---------------------------------------------------------------------- * + * RunAfterSyncCmd -- + * + * This function is called by the event loop and executes the command + * scheduled by [.text sync -command $cmd]. + * + * Results: + * None. + * + * Side effects: + * Anything may happen, depending on $cmd contents. + * + *---------------------------------------------------------------------- + */ + +static void +RunAfterSyncCmd( + ClientData clientData) /* Information about text widget. */ +{ + register TkText *textPtr = (TkText *) clientData; + int code; + + if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { + /* + * The widget has been deleted. Don't do anything. + */ + + if (--textPtr->refCount == 0) { + ckfree((char *) textPtr); + } + return; + } + + Tcl_Preserve((ClientData) textPtr->interp); + code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, TCL_EVAL_GLOBAL); + if (code == TCL_ERROR) { + Tcl_AddErrorInfo(textPtr->interp, "\n (text sync)"); + Tcl_BackgroundError(textPtr->interp); + } + Tcl_Release((ClientData) textPtr->interp); + Tcl_DecrRefCount(textPtr->afterSyncCmd); + textPtr->afterSyncCmd = NULL; +} + +/* + *---------------------------------------------------------------------- + * * SearchPerform -- * * Overall control of search process. Is given a pattern, a starting @@ -6748,52 +6794,6 @@ TkpTesttextCmd( } /* - *---------------------------------------------------------------------- - * - * RunAfterSyncCmd -- - * - * This function is called by the event loop and executes the command - * scheduled by [.text sync -command $cmd]. - * - * Results: - * None. - * - * Side effects: - * Anything may happen, depending on $cmd contents. - * - *---------------------------------------------------------------------- - */ - -static void -RunAfterSyncCmd( - ClientData clientData) /* Information about text widget. */ -{ - register TkText *textPtr = (TkText *) clientData; - int code; - - if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { - /* - * The widget has been deleted. Don't do anything. - */ - - if (--textPtr->refCount == 0) { - ckfree((char *) textPtr); - } - return; - } - - Tcl_Preserve((ClientData) textPtr->interp); - code = Tcl_EvalObjEx(textPtr->interp, textPtr->afterSyncCmd, TCL_EVAL_GLOBAL); - if (code == TCL_ERROR) { - Tcl_AddErrorInfo(textPtr->interp, "\n (text sync)"); - Tcl_BackgroundError(textPtr->interp); - } - Tcl_Release((ClientData) textPtr->interp); - Tcl_DecrRefCount(textPtr->afterSyncCmd); - textPtr->afterSyncCmd = NULL; -} - -/* * Local Variables: * mode: c * c-basic-offset: 4 -- cgit v0.12 From 2e67237b8b1fa6815d9e318f28d2f50674bafde6 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 5 Jan 2016 16:48:20 +0000 Subject: Polished documentation a bit --- doc/text.n | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/text.n b/doc/text.n index c55b4cf..536a3a5 100644 --- a/doc/text.n +++ b/doc/text.n @@ -1089,12 +1089,13 @@ the widget is in sync) or false (when it is not). Examples of use: .CS ## Example 1: -# runtime, immediately complete line metrics at any cost (GUI unresponsive) +# immediately complete line metrics at any cost (GUI unresponsive) $w sync $w yview moveto $fraction ## Example 2: -# runtime, synchronously wait for up-to-date line metrics (GUI responsive) +# synchronously wait for up-to-date line metrics (GUI responsive) +# before executing the scheduled command, but don't block execution flow $w sync -command [list $w yview moveto $fraction] ## Example 3: @@ -1783,7 +1784,7 @@ If \fIindex\fR is far out of view, then the command centers \fIindex\fR in the window. .TP \fIpathName \fBsync\fR ?\fB-command \fIcommand\fR? -Control the synchronization of the view of text widget. +Controls the synchronization of the view of the text widget. .RS .TP \fIpathName \fBsync\fR @@ -1793,10 +1794,10 @@ outdated line heights, otherwise it returns only at the end of the computation. The command returns an empty string. .TP \fIpathName \fBsync -command \fIcommand\fR -Schedule \fIcommand\fR to be executed exactly once as soon as all line heights -are up-to-date. If there are no pending line metrics calculations, the -scheduling is immediate. The command returns the empty string. \fBbgerror\fR is -called on \fIcommand\fR failure. +Schedules \fIcommand\fR to be executed (by the event loop) exactly once as soon +as all line heights are up-to-date. If there are no pending line metrics +calculations, the scheduling is immediate. The command returns the empty +string. \fBbgerror\fR is called on \fIcommand\fR failure. .RE .TP \fIpathName \fBtag \fIoption \fR?\fIarg arg ...\fR? -- cgit v0.12 From 5faa9a11695c74d40ca830ee4dcd68cfc9011e89 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 5 Jan 2016 17:00:48 +0000 Subject: Harmonized use of NULL for textPtr->afterSyncCmd --- generic/tkText.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 3389733..8dbe13e 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2015,9 +2015,9 @@ DestroyText( textPtr->tkwin = NULL; textPtr->refCount--; Tcl_DeleteCommandFromToken(textPtr->interp, textPtr->widgetCmd); - if (textPtr->afterSyncCmd != 0){ + if (textPtr->afterSyncCmd){ Tcl_DecrRefCount(textPtr->afterSyncCmd); - textPtr->afterSyncCmd = 0; + textPtr->afterSyncCmd = NULL; } if (textPtr->refCount == 0) { ckfree((char *) textPtr); -- cgit v0.12 From 975963bc1eb5cfb0c4b01b258dbe9a08269217dc Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 6 Jan 2016 13:22:06 +0000 Subject: Fixed bug [3e3e25f483] - winbutton-1.[12] fails on Win7 --- tests/winButton.test | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/winButton.test b/tests/winButton.test index 5bf6867..5e3dcfb 100644 --- a/tests/winButton.test +++ b/tests/winButton.test @@ -29,7 +29,9 @@ radiobutton .r -text Radiobutton pack .l .b .c .r update -test winbutton-1.1 {TkpComputeButtonGeometry procedure} {testImageType win} { +test winbutton-1.1 {TkpComputeButtonGeometry procedure} {testImageType win nonPortable} { + # nonPortable because of [3e3e25f483]: on Win7 first started with a high DPI screen + # the smallest size (i.e. 8) is not available for "MS Sans Serif" font deleteWindows image create test image1 image1 changed 0 0 0 0 60 40 @@ -46,7 +48,9 @@ test winbutton-1.1 {TkpComputeButtonGeometry procedure} {testImageType win} { [winfo reqwidth .b3] [winfo reqheight .b3] \ [winfo reqwidth .b4] [winfo reqheight .b4] } {68 48 70 50 90 52 90 52} -test winbutton-1.2 {TkpComputeButtonGeometry procedure} win { +test winbutton-1.2 {TkpComputeButtonGeometry procedure} {win nonPortable} { + # nonPortable because of [3e3e25f483]: on Win7 first started with a high DPI screen + # the smallest size (i.e. 8) is not available for "MS Sans Serif" font deleteWindows label .b1 -bitmap question -bd 3 -padx 0 -pady 2 button .b2 -bitmap question -bd 3 -padx 0 -pady 2 -- cgit v0.12 From 46dd965d3c6d8b9617e6f4edb792a79b08730423 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 6 Jan 2016 15:59:47 +0000 Subject: Fixed bug [1927212] - MouseWheel unbound for non-aqua scrollbars --- library/scrlbar.tcl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index 4b25325..7cec556 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -141,6 +141,10 @@ if {[tk windowingsystem] eq "aqua"} { bind Scrollbar { tk::ScrollByUnits %W h [expr {-10 * (%D)}] } +} else { + bind Scrollbar { + tk::ScrollByUnits %W v [expr {- (%D/120)}] + } } # tk::ScrollButtonDown -- # This procedure is invoked when a button is pressed in a scrollbar. -- cgit v0.12 From 8e521a94152cd4546be53ea626f09f96f1f102d4 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 7 Jan 2016 14:49:18 +0000 Subject: Added non-regression test for [1927212] --- tests/scrollbar.test | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/scrollbar.test b/tests/scrollbar.test index 5d4334f..10aa7d6 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -632,6 +632,21 @@ test scrollbar-9.1 {scrollbar widget vs hidden commands} { list [winfo children .] [interp hidden] } [list {} $l] +test scrollbar-10.1 { event on scrollbar} -constraints win -setup { + destroy .t .s +} -body { + pack [text .t -yscrollcommand {.s set}] -side left + for {set i 1} {$i < 100} {incr i} {.t insert end "Line $i\n"} + pack [scrollbar .s -command {.t yview}] -fill y -expand 1 -side left + update + focus -force .s + event generate .s -delta -120 + after 200 {set eventprocessed 1} ; vwait eventprocessed + .t index @0,0 +} -cleanup { + destroy .t .s +} -result {2.0} + catch {destroy .s} catch {destroy .t} -- cgit v0.12 From 1ce29cc9feab7c14297627f4306c8e1db96bfd09 Mon Sep 17 00:00:00 2001 From: oehhar Date: Thu, 7 Jan 2016 17:20:57 +0000 Subject: Prefix "system" of all Windows System Colors was documented --- doc/colors.n | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/colors.n b/doc/colors.n index d121248..dc7007b 100644 --- a/doc/colors.n +++ b/doc/colors.n @@ -933,19 +933,19 @@ On Windows, the following additional system colors are available .RS .DS .ta 6c -3dDarkShadow Highlight -3dLight HighlightText -ActiveBorder InactiveBorder -ActiveCaption InactiveCaption -AppWorkspace InactiveCaptionText -Background InfoBackground -ButtonFace InfoText -ButtonHighlight Menu -ButtonShadow MenuText -ButtonText Scrollbar -CaptionText Window -DisabledText WindowFrame -GrayText WindowText +system3dDarkShadow systemHighlight +system3dLight systemHighlightText +systemActiveBorder systemInactiveBorder +systemActiveCaption systemInactiveCaption +systemAppWorkspace systemInactiveCaptionText +systemBackground systemInfoBackground +systemButtonFace systemInfoText +systemButtonHighlight systemMenu +systemButtonShadow systemMenuText +systemButtonText systemScrollbar +systemCaptionText systemWindow +systemDisabledText systemWindowFrame +systemGrayText systemWindowText .DE .RE .SH "SEE ALSO" -- cgit v0.12 From d5dafd4448afb44a00d980a50478b1c2b83fea3f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Jan 2016 10:52:18 +0000 Subject: (cherry-pick) Prefix "system" of all Windows System Colors was documented --- doc/colors.n | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/colors.n b/doc/colors.n index 46c35aa..584e0ca 100644 --- a/doc/colors.n +++ b/doc/colors.n @@ -933,19 +933,19 @@ On Windows, the following additional system colors are available .RS .DS .ta 6c -3dDarkShadow Highlight -3dLight HighlightText -ActiveBorder InactiveBorder -ActiveCaption InactiveCaption -AppWorkspace InactiveCaptionText -Background InfoBackground -ButtonFace InfoText -ButtonHighlight Menu -ButtonShadow MenuText -ButtonText Scrollbar -CaptionText Window -DisabledText WindowFrame -GrayText WindowText +system3dDarkShadow systemHighlight +system3dLight systemHighlightText +systemActiveBorder systemInactiveBorder +systemActiveCaption systemInactiveCaption +systemAppWorkspace systemInactiveCaptionText +systemBackground systemInfoBackground +systemButtonFace systemInfoText +systemButtonHighlight systemMenu +systemButtonShadow systemMenuText +systemButtonText systemScrollbar +systemCaptionText systemWindow +systemDisabledText systemWindowFrame +systemGrayText systemWindowText .DE .RE .SH "SEE ALSO" -- cgit v0.12 From 7bec4099c70b8fd5cc9e269e5bf6c7870f45b47a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Jan 2016 11:21:01 +0000 Subject: (cherry-pick) Fixed bug [1510538] - Wrong initial scrollbar width --- win/tkWinScrlbr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index 46aad58..fc9685d 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.c @@ -218,10 +218,10 @@ CreateProc( if (scrollPtr->info.vertical) { style = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS - | SBS_VERT | SBS_RIGHTALIGN; + | SBS_VERT; } else { style = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS - | SBS_HORZ | SBS_BOTTOMALIGN; + | SBS_HORZ; } scrollPtr->hwnd = CreateWindow("SCROLLBAR", NULL, style, -- cgit v0.12 From e68d114c24b86c56fc9ddadb2b99dbbaf3445f23 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Jan 2016 11:24:02 +0000 Subject: (cherry-pick) Fixed bug [1305128] - Scrollbar doesn't receive event --- generic/tkScrollbar.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index 3fff58d..ba42c20 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -627,6 +627,8 @@ TkScrollbarEventProc( TkScrollbarEventuallyRedraw(scrollPtr); } } + } else if (eventPtr->type == MapNotify) { + TkScrollbarEventuallyRedraw(scrollPtr); } } -- cgit v0.12 From 9585548e0c8e9888638122b776be2e37e92bd271 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Jan 2016 11:34:46 +0000 Subject: (cherry-pick) Fixed bug [3e3e25f483] - winbutton-1.[12] fails on Win7 --- tests/winButton.test | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/winButton.test b/tests/winButton.test index 5bf6867..5e3dcfb 100644 --- a/tests/winButton.test +++ b/tests/winButton.test @@ -29,7 +29,9 @@ radiobutton .r -text Radiobutton pack .l .b .c .r update -test winbutton-1.1 {TkpComputeButtonGeometry procedure} {testImageType win} { +test winbutton-1.1 {TkpComputeButtonGeometry procedure} {testImageType win nonPortable} { + # nonPortable because of [3e3e25f483]: on Win7 first started with a high DPI screen + # the smallest size (i.e. 8) is not available for "MS Sans Serif" font deleteWindows image create test image1 image1 changed 0 0 0 0 60 40 @@ -46,7 +48,9 @@ test winbutton-1.1 {TkpComputeButtonGeometry procedure} {testImageType win} { [winfo reqwidth .b3] [winfo reqheight .b3] \ [winfo reqwidth .b4] [winfo reqheight .b4] } {68 48 70 50 90 52 90 52} -test winbutton-1.2 {TkpComputeButtonGeometry procedure} win { +test winbutton-1.2 {TkpComputeButtonGeometry procedure} {win nonPortable} { + # nonPortable because of [3e3e25f483]: on Win7 first started with a high DPI screen + # the smallest size (i.e. 8) is not available for "MS Sans Serif" font deleteWindows label .b1 -bitmap question -bd 3 -padx 0 -pady 2 button .b2 -bitmap question -bd 3 -padx 0 -pady 2 -- cgit v0.12 From 93871e55e0916c42bc9d393fdba3814b1b45e285 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Jan 2016 11:39:08 +0000 Subject: (cherry-pick) Fixed bug [1927212] - MouseWheel unbound for non-aqua scrollbars --- library/scrlbar.tcl | 4 ++++ tests/scrollbar.test | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index 4b25325..7cec556 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -141,6 +141,10 @@ if {[tk windowingsystem] eq "aqua"} { bind Scrollbar { tk::ScrollByUnits %W h [expr {-10 * (%D)}] } +} else { + bind Scrollbar { + tk::ScrollByUnits %W v [expr {- (%D/120)}] + } } # tk::ScrollButtonDown -- # This procedure is invoked when a button is pressed in a scrollbar. diff --git a/tests/scrollbar.test b/tests/scrollbar.test index 5d4334f..10aa7d6 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -632,6 +632,21 @@ test scrollbar-9.1 {scrollbar widget vs hidden commands} { list [winfo children .] [interp hidden] } [list {} $l] +test scrollbar-10.1 { event on scrollbar} -constraints win -setup { + destroy .t .s +} -body { + pack [text .t -yscrollcommand {.s set}] -side left + for {set i 1} {$i < 100} {incr i} {.t insert end "Line $i\n"} + pack [scrollbar .s -command {.t yview}] -fill y -expand 1 -side left + update + focus -force .s + event generate .s -delta -120 + after 200 {set eventprocessed 1} ; vwait eventprocessed + .t index @0,0 +} -cleanup { + destroy .t .s +} -result {2.0} + catch {destroy .s} catch {destroy .t} -- cgit v0.12 From 43554959e209cc2aaf81dbbb6909cf9d77cf57f4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Jan 2016 14:39:48 +0000 Subject: Backout previous commit: it causes many event-related test-failures in Tk test suite --- library/scrlbar.tcl | 4 ---- tests/scrollbar.test | 15 --------------- 2 files changed, 19 deletions(-) diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index 2a70b97..e17442f 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -157,10 +157,6 @@ switch [tk windowingsystem] { bind Scrollbar {tk::ScrollByUnits %W h -5} bind Scrollbar {tk::ScrollByUnits %W h 5} } -} else { - bind Scrollbar { - tk::ScrollByUnits %W v [expr {- (%D/120)}] - } } # tk::ScrollButtonDown -- # This procedure is invoked when a button is pressed in a scrollbar. diff --git a/tests/scrollbar.test b/tests/scrollbar.test index 8f92c93..c6a5a90 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -632,21 +632,6 @@ test scrollbar-9.1 {scrollbar widget vs hidden commands} { list [winfo children .] [interp hidden] } [list {} $l] -test scrollbar-10.1 { event on scrollbar} -constraints win -setup { - destroy .t .s -} -body { - pack [text .t -yscrollcommand {.s set}] -side left - for {set i 1} {$i < 100} {incr i} {.t insert end "Line $i\n"} - pack [scrollbar .s -command {.t yview}] -fill y -expand 1 -side left - update - focus -force .s - event generate .s -delta -120 - after 200 {set eventprocessed 1} ; vwait eventprocessed - .t index @0,0 -} -cleanup { - destroy .t .s -} -result {2.0} - catch {destroy .s} catch {destroy .t} -- cgit v0.12 From 52598f831a2b67fd2feb6317fb7fca9828712cf5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Jan 2016 14:41:58 +0000 Subject: (cherry-pick) Backout previous commit: it causes many event-related test-failures in Tk test suite --- library/scrlbar.tcl | 4 ---- tests/scrollbar.test | 15 --------------- 2 files changed, 19 deletions(-) diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index 7cec556..4b25325 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -141,10 +141,6 @@ if {[tk windowingsystem] eq "aqua"} { bind Scrollbar { tk::ScrollByUnits %W h [expr {-10 * (%D)}] } -} else { - bind Scrollbar { - tk::ScrollByUnits %W v [expr {- (%D/120)}] - } } # tk::ScrollButtonDown -- # This procedure is invoked when a button is pressed in a scrollbar. diff --git a/tests/scrollbar.test b/tests/scrollbar.test index 10aa7d6..5d4334f 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -632,21 +632,6 @@ test scrollbar-9.1 {scrollbar widget vs hidden commands} { list [winfo children .] [interp hidden] } [list {} $l] -test scrollbar-10.1 { event on scrollbar} -constraints win -setup { - destroy .t .s -} -body { - pack [text .t -yscrollcommand {.s set}] -side left - for {set i 1} {$i < 100} {incr i} {.t insert end "Line $i\n"} - pack [scrollbar .s -command {.t yview}] -fill y -expand 1 -side left - update - focus -force .s - event generate .s -delta -120 - after 200 {set eventprocessed 1} ; vwait eventprocessed - .t index @0,0 -} -cleanup { - destroy .t .s -} -result {2.0} - catch {destroy .s} catch {destroy .t} -- cgit v0.12 From 3b7649bdc1d6357c2c3145879d0720493e784622 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Jan 2016 15:40:47 +0000 Subject: ..... horizontal scrollbar too --- library/scrlbar.tcl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index 7b1c3af..b1658ac 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -153,7 +153,10 @@ switch [tk windowingsystem] { } "x11" { bind Scrollbar { - tk::ScrollByUnits %W v [expr {- (%D/120)}] + tk::ScrollByUnits %W v [expr {- (%D /120 )}] + } + bind Scrollbar { + tk::ScrollByUnits %W h [expr {- (%D /120 )}] } bind Scrollbar <4> {tk::ScrollByUnits %W v -5} bind Scrollbar <5> {tk::ScrollByUnits %W v 5} -- cgit v0.12 From a74bdffd9369f2ed76ba90a5497e5a4f7b2475cd Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 8 Jan 2016 22:10:59 +0000 Subject: Make test-case and binding equal for win32 and x11. Test-case doesn't pass yet --- library/scrlbar.tcl | 4 ++-- tests/scrollbar.test | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index b1658ac..b7be014 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -153,10 +153,10 @@ switch [tk windowingsystem] { } "x11" { bind Scrollbar { - tk::ScrollByUnits %W v [expr {- (%D /120 )}] + tk::ScrollByUnits %W v [expr {- (%D /120 ) * 4}] } bind Scrollbar { - tk::ScrollByUnits %W h [expr {- (%D /120 )}] + tk::ScrollByUnits %W h [expr {- (%D /120 ) * 4}] } bind Scrollbar <4> {tk::ScrollByUnits %W v -5} bind Scrollbar <5> {tk::ScrollByUnits %W v 5} diff --git a/tests/scrollbar.test b/tests/scrollbar.test index 8f92c93..6717deb 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -632,7 +632,7 @@ test scrollbar-9.1 {scrollbar widget vs hidden commands} { list [winfo children .] [interp hidden] } [list {} $l] -test scrollbar-10.1 { event on scrollbar} -constraints win -setup { +test scrollbar-10.1 { event on scrollbar} -setup { destroy .t .s } -body { pack [text .t -yscrollcommand {.s set}] -side left @@ -647,6 +647,21 @@ test scrollbar-10.1 { event on scrollbar} -constraints win -setup { destroy .t .s } -result {2.0} +test scrollbar-10.2 { event on scrollbar} -setup { + destroy .t .s +} -body { + pack [text .t -xscrollcommand {.s set}] -side top + for {set i 1} {$i < 100} {incr i} {.t insert end "Char $i "} + pack [scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top + update + focus -force .s + event generate .s -delta -120 + after 200 {set eventprocessed 1} ; vwait eventprocessed + .t index @0,0 +} -cleanup { + destroy .t .s +} -result {2.0} + catch {destroy .s} catch {destroy .t} -- cgit v0.12 From c0690b39259579097efedce36dffdc37d3626be2 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 8 Jan 2016 22:46:35 +0000 Subject: Bug [2049429] - Documented TK_OPTION_DONT_SET_DEFAULT --- doc/SetOptions.3 | 50 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/doc/SetOptions.3 b/doc/SetOptions.3 index 028467a..f12a00f 100644 --- a/doc/SetOptions.3 +++ b/doc/SetOptions.3 @@ -129,19 +129,21 @@ option table is no longer needed \fBTk_DeleteOptionTable\fR should be called to free all of its resources. All of the option tables for a Tcl interpreter are freed automatically if the interpreter is deleted. .PP -\fBTk_InitOptions\fR is invoked when a new widget is created to set -the default values for all of the widget's configuration options. -\fBTk_InitOptions\fR is passed a token for an option table (\fIoptionTable\fR) -and a pointer to a widget record (\fIrecordPtr\fR), which is the C -structure that holds information about this widget. \fBTk_InitOptions\fR -uses the information in the option table to -choose an appropriate default for each option, then it stores the default -value directly into the widget record, overwriting any information that -was already present in the widget record. \fBTk_InitOptions\fR normally -returns \fBTCL_OK\fR. If an error occurred while setting the default values -(e.g., because a default value was erroneous) then \fBTCL_ERROR\fR is returned -and an error message is left in \fIinterp\fR's result if \fIinterp\fR -is not NULL. +\fBTk_InitOptions\fR is invoked when a new widget is created to set the +default values for all of the widget's configuration options that do not +have \fBTK_OPTION_DONT_SET_DEFAULT\fR set in their \fIflags\fR field. +\fBTk_InitOptions\fR is passed a token for an option table +(\fIoptionTable\fR) and a pointer to a widget record (\fIrecordPtr\fR), +which is the C structure that holds information about this widget. +\fBTk_InitOptions\fR uses the information in the option table to choose an +appropriate default for each option, except those having +\fBTK_OPTION_DONT_SET_DEFAULT\fR set, then it stores the default value +directly into the widget record, overwriting any information that was +already present in the widget record. \fBTk_InitOptions\fR normally +returns \fBTCL_OK\fR. If an error occurred while setting the default +values (e.g., because a default value was erroneous) then \fBTCL_ERROR\fR +is returned and an error message is left in \fIinterp\fR's result if +\fIinterp\fR is not NULL. .PP \fBTk_SetOptions\fR is invoked to modify configuration options based on information specified in a Tcl command. The command might be one that @@ -306,19 +308,27 @@ given by \fIinternalOffset\fR. For example, if the option's type is value is not stored in that form. At least one of the offsets must be greater than or equal to zero. .PP -The \fIflags\fR field consists of one or more bits ORed together. At -present only a single flag is supported: \fBTK_OPTION_NULL_OK\fR. If -this bit is set for an option then an empty string will be accepted as -the value for the option and the resulting internal form will be a -NULL pointer, a zero value, or \fBNone\fR, depending on the type of -the option. If the flag is not set then empty strings will result -in errors. +The \fIflags\fR field consists of one or more bits ORed together. The +following flags are supported: +.TP +\fBTK_OPTION_NULL_OK\fR +If this bit is set for an option then an empty string will be accepted as +the value for the option and the resulting internal form will be a NULL +pointer, a zero value, or \fBNone\fR, depending on the type of the option. +If the flag is not set then empty strings will result in errors. \fBTK_OPTION_NULL_OK\fR is typically used to allow a feature to be turned off entirely, e.g. set a cursor value to \fBNone\fR so that a window simply inherits its parent's cursor. Not all option types support the \fBTK_OPTION_NULL_OK\fR flag; for those that do, there is an explicit indication of that fact in the descriptions below. +.TP +\fBTK_OPTION_DONT_SET_DEFAULT\fR +If this bit is set for an option then no default value will be set in +\fBTk_InitOptions\fR for this option. Neither the option database, nor any +system default value, nor \fIoptionTable\fR are used to give a default +value to this option. Instead it is assumed that the caller has already +supplied a default value in the widget code. .PP The \fItype\fR field of each Tk_OptionSpec structure determines how to parse the value of that configuration option. The -- cgit v0.12 From f1ad837bb6dfcf955f3b560dc34892e9031dd7bd Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 8 Jan 2016 23:22:29 +0000 Subject: Use TK_OPTION_NULL_OK instead of TK_CONFIG_NULL_OK --- generic/tkEntry.c | 12 ++++++------ generic/tkListbox.c | 2 +- generic/tkText.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 338652b..8c8cd90 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -133,7 +133,7 @@ static const Tk_OptionSpec entryOptSpec[] = { 0, (ClientData) DEF_ENTRY_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_ENTRY_SELECT_FG_COLOR, -1, Tk_Offset(Entry, selFgColorPtr), - TK_CONFIG_NULL_OK, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0}, + TK_OPTION_NULL_OK, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0}, {TK_OPTION_STRING, "-show", "show", "Show", DEF_ENTRY_SHOW, -1, Tk_Offset(Entry, showChar), TK_OPTION_NULL_OK, 0, 0}, @@ -279,23 +279,23 @@ static const Tk_OptionSpec sbOptSpec[] = { 0, (ClientData) DEF_ENTRY_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_ENTRY_SELECT_FG_COLOR, -1, Tk_Offset(Entry, selFgColorPtr), - TK_CONFIG_NULL_OK, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0}, + TK_OPTION_NULL_OK, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_ENTRY_STATE, -1, Tk_Offset(Entry, state), 0, (ClientData) stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_ENTRY_TAKE_FOCUS, -1, Tk_Offset(Entry, takeFocus), - TK_CONFIG_NULL_OK, 0, 0}, + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", DEF_ENTRY_TEXT_VARIABLE, -1, Tk_Offset(Entry, textVarName), - TK_CONFIG_NULL_OK, 0, 0}, + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_DOUBLE, "-to", "to", "To", DEF_SPINBOX_TO, -1, Tk_Offset(Spinbox, toValue), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate", DEF_ENTRY_VALIDATE, -1, Tk_Offset(Entry, validate), 0, (ClientData) validateStrings, 0}, {TK_OPTION_STRING, "-validatecommand", "validateCommand","ValidateCommand", - NULL, -1, Tk_Offset(Entry, validateCmd), TK_CONFIG_NULL_OK, 0, 0}, + NULL, -1, Tk_Offset(Entry, validateCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-values", "values", "Values", DEF_SPINBOX_VALUES, -1, Tk_Offset(Spinbox, valueStr), TK_OPTION_NULL_OK, 0, 0}, @@ -307,7 +307,7 @@ static const Tk_OptionSpec sbOptSpec[] = { DEF_SPINBOX_WRAP, -1, Tk_Offset(Spinbox, wrap), 0, 0, 0}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", DEF_ENTRY_SCROLL_COMMAND, -1, Tk_Offset(Entry, scrollCmd), - TK_CONFIG_NULL_OK, 0, 0}, + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} }; diff --git a/generic/tkListbox.c b/generic/tkListbox.c index ff72596..537bbfc 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -278,7 +278,7 @@ static const Tk_OptionSpec optionSpecs[] = { Tk_Offset(Listbox, selBorderWidth), 0, 0, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_LISTBOX_SELECT_FG_COLOR, -1, Tk_Offset(Listbox, selFgColorPtr), - TK_CONFIG_NULL_OK, (ClientData) DEF_LISTBOX_SELECT_FG_MONO, 0}, + TK_OPTION_NULL_OK, (ClientData) DEF_LISTBOX_SELECT_FG_MONO, 0}, {TK_OPTION_STRING, "-selectmode", "selectMode", "SelectMode", DEF_LISTBOX_SELECT_MODE, -1, Tk_Offset(Listbox, selectMode), TK_OPTION_NULL_OK, 0, 0}, diff --git a/generic/tkText.c b/generic/tkText.c index 6e982b0..5694700 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -197,7 +197,7 @@ static const Tk_OptionSpec optionSpecs[] = { TK_OPTION_NULL_OK, (ClientData) DEF_TEXT_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_TEXT_SELECT_FG_COLOR, -1, Tk_Offset(TkText, selFgColorPtr), - TK_CONFIG_NULL_OK, (ClientData) DEF_TEXT_SELECT_FG_MONO, 0}, + TK_OPTION_NULL_OK, (ClientData) DEF_TEXT_SELECT_FG_MONO, 0}, {TK_OPTION_BOOLEAN, "-setgrid", "setGrid", "SetGrid", DEF_TEXT_SET_GRID, -1, Tk_Offset(TkText, setGrid), 0, 0, 0}, {TK_OPTION_PIXELS, "-spacing1", "spacing1", "Spacing", -- cgit v0.12 From cf5e1ec939d60bdf2c3440acc22e33dcadfb5dc0 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 8 Jan 2016 23:35:37 +0000 Subject: Removed unused flags argument in Configure function since Tk_ConfigureWidget is no longer used there since last century --- generic/tkEntry.c | 13 ++++++------- generic/tkListbox.c | 9 ++++----- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 8c8cd90..9f43f90 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -390,7 +390,7 @@ static const char *selElementNames[] = { */ static int ConfigureEntry(Tcl_Interp *interp, Entry *entryPtr, - int objc, Tcl_Obj *const objv[], int flags); + int objc, Tcl_Obj *const objv[]); static int DeleteChars(Entry *entryPtr, int index, int count); static void DestroyEntry(char *memPtr); static void DisplayEntry(ClientData clientData); @@ -553,7 +553,7 @@ Tk_EntryObjCmd( if ((Tk_InitOptions(interp, (char *) entryPtr, optionTable, tkwin) != TCL_OK) || - (ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0) != TCL_OK)) { + (ConfigureEntry(interp, entryPtr, objc-2, objv+2) != TCL_OK)) { Tk_DestroyWindow(entryPtr->tkwin); return TCL_ERROR; } @@ -658,7 +658,7 @@ EntryWidgetObjCmd( Tcl_SetObjResult(interp, objPtr); } } else { - result = ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0); + result = ConfigureEntry(interp, entryPtr, objc-2, objv+2); } break; @@ -1086,8 +1086,7 @@ ConfigureEntry( Entry *entryPtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in argv. */ - Tcl_Obj *const objv[], /* Argument objects. */ - int flags) /* Flags to pass to Tk_ConfigureWidget. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_SavedOptions savedOptions; Tk_3DBorder border; @@ -3637,7 +3636,7 @@ Tk_SpinboxObjCmd( Tk_DestroyWindow(entryPtr->tkwin); return TCL_ERROR; } - if (ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0) != TCL_OK) { + if (ConfigureEntry(interp, entryPtr, objc-2, objv+2) != TCL_OK) { goto error; } @@ -3747,7 +3746,7 @@ SpinboxWidgetObjCmd( Tcl_SetObjResult(interp, objPtr); } } else { - result = ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0); + result = ConfigureEntry(interp, entryPtr, objc-2, objv+2); } break; diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 537bbfc..86fb671 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -379,7 +379,7 @@ enum indices { static void ChangeListboxOffset(Listbox *listPtr, int offset); static void ChangeListboxView(Listbox *listPtr, int index); static int ConfigureListbox(Tcl_Interp *interp, Listbox *listPtr, - int objc, Tcl_Obj *const objv[], int flags); + int objc, Tcl_Obj *const objv[]); static int ConfigureListboxItem(Tcl_Interp *interp, Listbox *listPtr, ItemAttr *attrs, int objc, Tcl_Obj *const objv[], int index); @@ -564,7 +564,7 @@ Tk_ListboxObjCmd( return TCL_ERROR; } - if (ConfigureListbox(interp, listPtr, objc-2, objv+2, 0) != TCL_OK) { + if (ConfigureListbox(interp, listPtr, objc-2, objv+2) != TCL_OK) { Tk_DestroyWindow(listPtr->tkwin); return TCL_ERROR; } @@ -700,7 +700,7 @@ ListboxWidgetObjCmd( result = TCL_OK; } } else { - result = ConfigureListbox(interp, listPtr, objc-2, objv+2, 0); + result = ConfigureListbox(interp, listPtr, objc-2, objv+2); } break; } @@ -1544,8 +1544,7 @@ ConfigureListbox( register Listbox *listPtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in argv. */ - Tcl_Obj *const objv[], /* Arguments. */ - int flags) /* Flags to pass to Tk_ConfigureWidget. */ + Tcl_Obj *const objv[]) /* Arguments. */ { Tk_SavedOptions savedOptions; Tcl_Obj *oldListObj = NULL; -- cgit v0.12 From ac43dfdc269f9ea9dc7448bc815aba5f28a96efc Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 9 Jan 2016 00:03:22 +0000 Subject: Test cases scrollbar-10.[12] pass --- tests/scrollbar.test | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/scrollbar.test b/tests/scrollbar.test index 6717deb..85ee8b9 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -632,7 +632,7 @@ test scrollbar-9.1 {scrollbar widget vs hidden commands} { list [winfo children .] [interp hidden] } [list {} $l] -test scrollbar-10.1 { event on scrollbar} -setup { +test scrollbar-10.1 { event on scrollbar} -constraints {win unix} -setup { destroy .t .s } -body { pack [text .t -yscrollcommand {.s set}] -side left @@ -645,12 +645,12 @@ test scrollbar-10.1 { event on scrollbar} -setup { .t index @0,0 } -cleanup { destroy .t .s -} -result {2.0} +} -result {5.0} -test scrollbar-10.2 { event on scrollbar} -setup { +test scrollbar-10.2 { event on scrollbar} -constraints {win unix} -setup { destroy .t .s } -body { - pack [text .t -xscrollcommand {.s set}] -side top + pack [text .t -xscrollcommand {.s set} -wrap none] -side top for {set i 1} {$i < 100} {incr i} {.t insert end "Char $i "} pack [scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top update @@ -660,7 +660,7 @@ test scrollbar-10.2 { event on scrollbar} -setup { .t index @0,0 } -cleanup { destroy .t .s -} -result {2.0} +} -result {1.4} catch {destroy .s} catch {destroy .t} -- cgit v0.12 From 631b7815fb57704361344f53cad675ffdbbd6d13 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 9 Jan 2016 00:06:49 +0000 Subject: Fixed test constraints --- tests/scrollbar.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/scrollbar.test b/tests/scrollbar.test index 85ee8b9..3b16821 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -632,7 +632,7 @@ test scrollbar-9.1 {scrollbar widget vs hidden commands} { list [winfo children .] [interp hidden] } [list {} $l] -test scrollbar-10.1 { event on scrollbar} -constraints {win unix} -setup { +test scrollbar-10.1 { event on scrollbar} -constraints {win|unix} -setup { destroy .t .s } -body { pack [text .t -yscrollcommand {.s set}] -side left @@ -647,7 +647,7 @@ test scrollbar-10.1 { event on scrollbar} -constraints {win unix} -s destroy .t .s } -result {5.0} -test scrollbar-10.2 { event on scrollbar} -constraints {win unix} -setup { +test scrollbar-10.2 { event on scrollbar} -constraints {win|unix} -setup { destroy .t .s } -body { pack [text .t -xscrollcommand {.s set} -wrap none] -side top -- cgit v0.12 From 3e525786724c39e02e20eda8c5684ce7c0ec7e00 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 9 Jan 2016 02:58:47 +0000 Subject: Additional fixes for memory leaks, window flickering on OS X 10.11; thanks to Marc Culler for patch --- macosx/tkMacOSXInit.c | 4 +--- macosx/tkMacOSXWindowEvent.c | 10 ++++++---- macosx/tkMacOSXWm.c | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 997d306..b965a38 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -105,10 +105,9 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt - (void) _setup: (Tcl_Interp *) interp { _eventInterp = interp; - _mainPool = nil; + _mainPool = [NSAutoreleasePool new]; [NSApp setPoolProtected:NO]; _defaultMainMenu = nil; - NSAutoreleasePool *pool = [NSAutoreleasePool new]; [self _setupMenus]; [self setDelegate:self]; #ifdef TK_MAC_DEBUG_NOTIFICATIONS @@ -117,7 +116,6 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt #endif [self _setupWindowNotifications]; [self _setupApplicationNotifications]; - [pool drain]; } - (NSString *) tkFrameworkImagePath: (NSString *) image diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 95ebb25..461a94c 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -165,6 +165,10 @@ extern BOOL opaqueTag; if (winPtr) { TkGenWMDestroyEvent((Tk_Window) winPtr); + if (_windowWithMouse == w) { + _windowWithMouse = nil; + [w release]; + } } /* @@ -858,12 +862,9 @@ ConfigureRestrictProc( /* * Try to prevent flickers and flashes. - * - * This stops the flickers on OSX 10.11. But flashes still occur when - * the width of the window is 16, 32, 48, 64, 80, 96, 112, 256, 512, - * 768, ... :^( */ [w disableFlushWindow]; + NSDisableScreenUpdates(); /* Disable Tk drawing until the window has been completely configured.*/ TkMacOSXSetDrawingEnabled(winPtr, 0); @@ -887,6 +888,7 @@ ConfigureRestrictProc( while (Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT)) {} [w enableFlushWindow]; [w flushWindowIfNeeded]; + NSEnableScreenUpdates(); [NSApp setPoolProtected:NO]; } } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 308ee11..3ea2f51 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -902,6 +902,8 @@ TkWmDeadWindow( [front makeKeyAndOrderFront:NSApp]; } } + [NSApp _resetAutoreleasePool]; + #if DEBUG_ZOMBIES > 0 fprintf(stderr, "================= Pool dump ===================\n"); [NSAutoreleasePool showPools]; -- cgit v0.12 From e07b10f1a79f05875a092a57edd405f0e23f7345 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 9 Jan 2016 03:03:29 +0000 Subject: Additional fixes for memory leaks, window flickering on OS X 10.11; thanks to Marc Culler for patch --- macosx/tkMacOSXInit.c | 9 ++++++--- macosx/tkMacOSXWindowEvent.c | 10 ++++++---- macosx/tkMacOSXWm.c | 2 ++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index cb97f47..26eb3f5 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -72,11 +72,13 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt _mainPool = [NSAutoreleasePool new]; } } + #ifdef TK_MAC_DEBUG_NOTIFICATIONS - (void)_postedNotification:(NSNotification *)notification { TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); } #endif + - (void)_setupApplicationNotifications { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; #define observe(n, s) [nc addObserver:self selector:@selector(s) name:(n) object:nil] @@ -91,18 +93,19 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt CFNotificationCenterAddObserver(CFNotificationCenterGetDistributedCenter(), NULL, &keyboardChanged, kTISNotifySelectedKeyboardInputSourceChanged, NULL, CFNotificationSuspensionBehaviorCoalesce); #endif } + - (void)_setupEventLoop { NSAutoreleasePool *pool = [NSAutoreleasePool new]; [self finishLaunching]; [self setWindowsNeedUpdate:YES]; [pool drain]; } + - (void)_setup:(Tcl_Interp *)interp { _eventInterp = interp; - _mainPool = nil; + _mainPool = [NSAutoreleasePool new]; [NSApp setPoolProtected:NO]; _defaultMainMenu = nil; - NSAutoreleasePool *pool = [NSAutoreleasePool new]; [self _setupMenus]; [self setDelegate:self]; #ifdef TK_MAC_DEBUG_NOTIFICATIONS @@ -111,8 +114,8 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt #endif [self _setupWindowNotifications]; [self _setupApplicationNotifications]; - [pool drain]; } + - (NSString *)tkFrameworkImagePath:(NSString*)image { NSString *path = nil; NSAutoreleasePool *pool = [NSAutoreleasePool new]; diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 91cc348..fce3801 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -165,6 +165,10 @@ extern BOOL opaqueTag; if (winPtr) { TkGenWMDestroyEvent((Tk_Window) winPtr); + if (_windowWithMouse == w) { + _windowWithMouse = nil; + [w release]; + } } /* @@ -862,12 +866,9 @@ ConfigureRestrictProc( /* * Try to prevent flickers and flashes. - * - * This stops the flickers, but on OSX 10.11 flashes still occur when - * the width of the window is 16, 32, 48, 64, 80, 96, 112, 256, 512, - * 768, ... */ [w disableFlushWindow]; + NSDisableScreenUpdates(); /* Disable Tk drawing until the window has been completely configured.*/ TkMacOSXSetDrawingEnabled(winPtr, 0); @@ -891,6 +892,7 @@ ConfigureRestrictProc( while (Tk_DoOneEvent(TK_ALL_EVENTS|TK_DONT_WAIT)) {} [w enableFlushWindow]; [w flushWindowIfNeeded]; + NSEnableScreenUpdates(); [NSApp setPoolProtected:NO]; } } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 50cac20..5df72f0 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -907,6 +907,8 @@ TkWmDeadWindow( [front makeKeyAndOrderFront:NSApp]; } } + [NSApp _resetAutoreleasePool]; + #if DEBUG_ZOMBIES > 0 fprintf(stderr, "================= Pool dump ===================\n"); [NSAutoreleasePool showPools]; -- cgit v0.12 -- cgit v0.12 From 2987950f24f7b2fda46de8d528a3693ccf7943b9 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 9 Jan 2016 08:29:15 +0000 Subject: -spacing[123] use TK_OPTION_NULL_OK instead of TK_OPTION_DONT_SET_DEFAULT --- generic/tkText.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 5694700..f884239 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -202,13 +202,13 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_TEXT_SET_GRID, -1, Tk_Offset(TkText, setGrid), 0, 0, 0}, {TK_OPTION_PIXELS, "-spacing1", "spacing1", "Spacing", DEF_TEXT_SPACING1, -1, Tk_Offset(TkText, spacing1), - TK_OPTION_DONT_SET_DEFAULT, 0 , TK_TEXT_LINE_GEOMETRY }, + TK_OPTION_NULL_OK, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_PIXELS, "-spacing2", "spacing2", "Spacing", DEF_TEXT_SPACING2, -1, Tk_Offset(TkText, spacing2), - TK_OPTION_DONT_SET_DEFAULT, 0 , TK_TEXT_LINE_GEOMETRY }, + TK_OPTION_NULL_OK, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_PIXELS, "-spacing3", "spacing3", "Spacing", DEF_TEXT_SPACING3, -1, Tk_Offset(TkText, spacing3), - TK_OPTION_DONT_SET_DEFAULT, 0 , TK_TEXT_LINE_GEOMETRY }, + TK_OPTION_NULL_OK, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_CUSTOM, "-startline", NULL, NULL, NULL, -1, Tk_Offset(TkText, start), TK_OPTION_NULL_OK, (ClientData) &lineOption, TK_TEXT_LINE_RANGE}, -- cgit v0.12 From 1495c801841af36629d7d985074d43ddc31f62fe Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 9 Jan 2016 22:30:01 +0000 Subject: (cherry-pick) Fix [1927212]: MouseWheel unbound for non-aqua scrollbars. Thanks to Francois Vogel for the actual work --- library/scrlbar.tcl | 7 +++++++ tests/scrollbar.test | 30 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index 4b25325..43ce4ae 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -141,6 +141,13 @@ if {[tk windowingsystem] eq "aqua"} { bind Scrollbar { tk::ScrollByUnits %W h [expr {-10 * (%D)}] } +} else { + bind Scrollbar { + tk::ScrollByUnits %W v [expr {- (%D /120 ) * 4}] + } + bind Scrollbar { + tk::ScrollByUnits %W h [expr {- (%D /120 ) * 4}] + } } # tk::ScrollButtonDown -- # This procedure is invoked when a button is pressed in a scrollbar. diff --git a/tests/scrollbar.test b/tests/scrollbar.test index 5d4334f..35f48bd 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -632,6 +632,36 @@ test scrollbar-9.1 {scrollbar widget vs hidden commands} { list [winfo children .] [interp hidden] } [list {} $l] +test scrollbar-10.1 { event on scrollbar} -constraints {win|unix} -setup { + destroy .t .s +} -body { + pack [text .t -yscrollcommand {.s set}] -side left + for {set i 1} {$i < 100} {incr i} {.t insert end "Line $i\n"} + pack [scrollbar .s -command {.t yview}] -fill y -expand 1 -side left + update + focus -force .s + event generate .s -delta -120 + after 200 {set eventprocessed 1} ; vwait eventprocessed + .t index @0,0 +} -cleanup { + destroy .t .s +} -result {5.0} + +test scrollbar-10.2 { event on scrollbar} -constraints {win|unix} -setup { + destroy .t .s +} -body { + pack [text .t -xscrollcommand {.s set} -wrap none] -side top + for {set i 1} {$i < 100} {incr i} {.t insert end "Char $i "} + pack [scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top + update + focus -force .s + event generate .s -delta -120 + after 200 {set eventprocessed 1} ; vwait eventprocessed + .t index @0,0 +} -cleanup { + destroy .t .s +} -result {1.4} + catch {destroy .s} catch {destroy .t} -- cgit v0.12 From c2aba2ca12911e5c707679168da5a09f0f779977 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Mon, 11 Jan 2016 00:24:47 +0000 Subject: Fix for 63c3542c06, messageboxes in Tk-Cocoa; thanks to Marc Culler for patch --- macosx/tkMacOSXDialog.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index a3510f8..3523bc4 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -1016,7 +1016,8 @@ Tk_MessageBoxObjCmd( NSArray *buttons; NSAlert *alert = [NSAlert new]; NSInteger modalReturnCode = 1; - + BOOL parentIsKey = NO; + iconIndex = ICON_INFO; typeIndex = TYPE_OK; for (i = 1; i < objc; i += 2) { @@ -1142,6 +1143,7 @@ Tk_MessageBoxObjCmd( callbackInfo->typeIndex = typeIndex; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { + parentIsKey = [parent isKeyWindow]; #if MAC_OS_X_VERSION_MIN_REQUIRED > 1090 [alert beginSheetModalForWindow:parent completionHandler:^(NSModalResponse returnCode) @@ -1164,6 +1166,9 @@ Tk_MessageBoxObjCmd( result = (modalReturnCode >= NSAlertFirstButtonReturn) ? TCL_OK : TCL_ERROR; end: [alert release]; + if (parentIsKey) { + [parent makeKeyWindow]; + } return result; } -- cgit v0.12 From 651d6089bd63522c1a689dabead4ed1c6c4a5f17 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Mon, 11 Jan 2016 00:28:14 +0000 Subject: Fix for 63c3542c06, messageboxes in Tk-Cocoa; thanks to Marc Culler for patch --- macosx/tkMacOSXDialog.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index eebff3c..4ceb010 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -1013,7 +1013,8 @@ Tk_MessageBoxObjCmd( NSArray *buttons; NSAlert *alert = [NSAlert new]; NSInteger modalReturnCode = 1; - + BOOL parentIsKey = NO; + iconIndex = ICON_INFO; typeIndex = TYPE_OK; for (i = 1; i < objc; i += 2) { @@ -1139,6 +1140,7 @@ Tk_MessageBoxObjCmd( callbackInfo->typeIndex = typeIndex; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { + parentIsKey = [parent isKeyWindow]; #if MAC_OS_X_VERSION_MIN_REQUIRED > 1090 [alert beginSheetModalForWindow:parent completionHandler:^(NSModalResponse returnCode) @@ -1161,6 +1163,9 @@ Tk_MessageBoxObjCmd( result = (modalReturnCode >= NSAlertFirstButtonReturn) ? TCL_OK : TCL_ERROR; end: [alert release]; + if (parentIsKey) { + [parent makeKeyWindow]; + } return result; } -- cgit v0.12 From ad1f3c6bd527110188baf7a518480c669cb92306 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Mon, 11 Jan 2016 00:44:22 +0000 Subject: Additional tweaks for dialog --- macosx/tkMacOSXDialog.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 3523bc4..257f16d 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -398,6 +398,7 @@ Tk_GetOpenFileObjCmd( NSMutableArray *fileTypes = nil; NSOpenPanel *panel = [NSOpenPanel openPanel]; NSInteger modalReturnCode = modalError; + BOOL parentIsKey = NO; TkInitFileFilters(&fl); for (i = 1; i < objc; i += 2) { @@ -513,6 +514,7 @@ Tk_GetOpenFileObjCmd( callbackInfo->multiple = multiple; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { + parentIsKey = [parent isKeyWindow]; #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 [panel beginSheetForDirectory:directory file:filename @@ -544,6 +546,9 @@ Tk_GetOpenFileObjCmd( contextInfo:callbackInfo]; } result = (modalReturnCode != modalError) ? TCL_OK : TCL_ERROR; + if (parentIsKey) { + [parent makeKeyWindow]; + } if (typeVariablePtr && result == TCL_OK) { /* * The -typevariable option is not really supported. @@ -596,6 +601,7 @@ Tk_GetSaveFileObjCmd( NSMutableArray *fileTypes = nil; NSSavePanel *panel = [NSSavePanel savePanel]; NSInteger modalReturnCode = modalError; + BOOL parentIsKey = NO; TkInitFileFilters(&fl); for (i = 1; i < objc; i += 2) { @@ -712,6 +718,7 @@ Tk_GetSaveFileObjCmd( callbackInfo->multiple = 0; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { + parentIsKey = [parent isKeyWindow]; #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 [panel beginSheetForDirectory:directory file:filename @@ -740,7 +747,9 @@ Tk_GetSaveFileObjCmd( contextInfo:callbackInfo]; } result = (modalReturnCode != modalError) ? TCL_OK : TCL_ERROR; - + if (parentIsKey) { + [parent makeKeyWindow]; + } end: TkFreeFileFilters(&fl); return result; @@ -783,6 +792,7 @@ Tk_ChooseDirectoryObjCmd( NSWindow *parent; NSOpenPanel *panel = [NSOpenPanel openPanel]; NSInteger modalReturnCode = modalError; + BOOL parentIsKey = NO; for (i = 1; i < objc; i += 2) { if (Tcl_GetIndexFromObjStruct(interp, objv[i], chooseOptionStrings, @@ -850,6 +860,7 @@ Tk_ChooseDirectoryObjCmd( callbackInfo->multiple = 0; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { + parentIsKey = [parent isKeyWindow]; #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 [panel beginSheetForDirectory:directory file:filename @@ -877,7 +888,9 @@ Tk_ChooseDirectoryObjCmd( contextInfo:callbackInfo]; } result = (modalReturnCode != modalError) ? TCL_OK : TCL_ERROR; - + if (parentIsKey) { + [parent makeKeyWindow]; + } end: return result; } -- cgit v0.12 From 44cda04c842ee384d0e830bbb247787ee0819fee Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Mon, 11 Jan 2016 00:45:56 +0000 Subject: Additional tweaks for dialog --- macosx/tkMacOSXDialog.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 4ceb010..6af6b33 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -398,6 +398,7 @@ Tk_GetOpenFileObjCmd( TkInitFileFilters(&fl); for (i = 1; i < objc; i += 2) { + BOOL parentIsKey = NO; if (Tcl_GetIndexFromObjStruct(interp, objv[i], openOptionStrings, sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) { goto end; @@ -513,6 +514,7 @@ Tk_GetOpenFileObjCmd( #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 [panel beginSheetForDirectory:directory file:filename + parentIsKey = [parent isKeyWindow]; types:fileTypes modalForWindow:parent modalDelegate:NSApp @@ -544,6 +546,9 @@ Tk_GetOpenFileObjCmd( if (typeVariablePtr && result == TCL_OK) { /* * The -typevariable option is not really supported. + if (parentIsKey) { + [parent makeKeyWindow]; + } */ Tcl_SetVar2(interp, Tcl_GetString(typeVariablePtr), NULL, @@ -596,6 +601,7 @@ Tk_GetSaveFileObjCmd( TkInitFileFilters(&fl); for (i = 1; i < objc; i += 2) { + BOOL parentIsKey = NO; if (Tcl_GetIndexFromObjStruct(interp, objv[i], saveOptionStrings, sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) { goto end; @@ -712,6 +718,7 @@ Tk_GetSaveFileObjCmd( #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 [panel beginSheetForDirectory:directory file:filename + parentIsKey = [parent isKeyWindow]; modalForWindow:parent modalDelegate:NSApp didEndSelector: @@ -737,7 +744,9 @@ Tk_GetSaveFileObjCmd( contextInfo:callbackInfo]; } result = (modalReturnCode != modalError) ? TCL_OK : TCL_ERROR; - + if (parentIsKey) { + [parent makeKeyWindow]; + } end: TkFreeFileFilters(&fl); return result; @@ -780,6 +789,7 @@ Tk_ChooseDirectoryObjCmd( NSWindow *parent; NSOpenPanel *panel = [NSOpenPanel openPanel]; NSInteger modalReturnCode = modalError; + BOOL parentIsKey = NO; for (i = 1; i < objc; i += 2) { if (Tcl_GetIndexFromObjStruct(interp, objv[i], chooseOptionStrings, @@ -847,6 +857,7 @@ Tk_ChooseDirectoryObjCmd( callbackInfo->multiple = 0; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { + parentIsKey = [parent isKeyWindow]; #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 [panel beginSheetForDirectory:directory file:filename @@ -874,7 +885,9 @@ Tk_ChooseDirectoryObjCmd( contextInfo:callbackInfo]; } result = (modalReturnCode != modalError) ? TCL_OK : TCL_ERROR; - + if (parentIsKey) { + [parent makeKeyWindow]; + } end: return result; } -- cgit v0.12 -- cgit v0.12 From 5147bd27c61d07d5acfdd82046fccfdbb1aa38df Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 11 Jan 2016 14:32:00 +0000 Subject: Improved patch formatting. No functional change --- generic/tkListbox.c | 70 ++++++++++++++++++++++++++++++------------------ macosx/tkMacOSXDefault.h | 2 +- unix/tkUnixDefault.h | 2 +- win/tkWinDefault.h | 2 +- 4 files changed, 47 insertions(+), 29 deletions(-) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index f16218b..2929882 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -165,8 +165,9 @@ typedef struct { Pixmap gray; /* Pixmap for displaying disabled text. */ int flags; /* Various flag bits: see below for * definitions. */ - Tk_Justify justify; /* Justification */ - int oldMaxOffset; /* Used in scrolling for right/center justification */ + Tk_Justify justify; /* Justification. */ + int oldMaxOffset; /* Used in scrolling for right/center + * justification. */ } Listbox; /* @@ -277,6 +278,8 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", DEF_LISTBOX_HIGHLIGHT_WIDTH, -1, Tk_Offset(Listbox, highlightWidth), 0, 0, 0}, + {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", + DEF_LISTBOX_JUSTIFY, -1, Tk_Offset(Listbox, justify), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_LISTBOX_RELIEF, -1, Tk_Offset(Listbox, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", @@ -310,8 +313,6 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING, "-listvariable", "listVariable", "Variable", DEF_LISTBOX_LIST_VARIABLE, -1, Tk_Offset(Listbox, listVarName), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - DEF_LISTBOX_JUSTIFY, -1, Tk_Offset(Listbox, justify), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} }; @@ -440,7 +441,7 @@ static char * ListboxListVarProc(ClientData clientData, const char *name2, int flags); static void MigrateHashEntries(Tcl_HashTable *table, int first, int last, int offset); -static int GetMaxOffset(Listbox *listPtr); +static int GetMaxOffset(Listbox *listPtr); /* * The structure below defines button class behavior by means of procedures @@ -1125,7 +1126,7 @@ ListboxBboxSubCmd( Tk_GetFontMetrics(listPtr->tkfont, &fm); pixelWidth = Tk_TextWidth(listPtr->tkfont, stringRep, stringLen); - x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset; + x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset; y = ((index - listPtr->topIndex)*listPtr->lineHeight) + listPtr->inset + listPtr->selBorderWidth; results[0] = Tcl_NewIntObj(x); @@ -2071,23 +2072,27 @@ DisplayListbox( /* * Draw the actual text of this item. */ - Tcl_ListObjIndex(listPtr->interp, listPtr->listObj, i, &curElement); - stringRep = Tcl_GetStringFromObj(curElement, &stringLen); - Tk_ComputeTextLayout(listPtr->tkfont, - stringRep, stringLen, 0, - listPtr->justify, TK_IGNORE_NEWLINES, &totalLength, &height); + + Tcl_ListObjIndex(listPtr->interp, listPtr->listObj, i, &curElement); + stringRep = Tcl_GetStringFromObj(curElement, &stringLen); + Tk_ComputeTextLayout(listPtr->tkfont, stringRep, stringLen, 0, + listPtr->justify, TK_IGNORE_NEWLINES, &totalLength, &height); Tk_GetFontMetrics(listPtr->tkfont, &fm); y += fm.ascent + listPtr->selBorderWidth; - if (listPtr->justify == TK_JUSTIFY_LEFT) { - x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset; - } else if (listPtr->justify == TK_JUSTIFY_RIGHT) { - x = width - totalLength - listPtr->inset - listPtr->selBorderWidth - listPtr->xOffset + GetMaxOffset(listPtr) - 1; - } else { - x = (width + GetMaxOffset(listPtr))/2 - totalLength/2 - listPtr->xOffset; - } - Tk_DrawChars(listPtr->display, pixmap, gc, listPtr->tkfont, + if (listPtr->justify == TK_JUSTIFY_LEFT) { + x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset; + } else if (listPtr->justify == TK_JUSTIFY_RIGHT) { + x = width - totalLength - listPtr->inset - + listPtr->selBorderWidth - listPtr->xOffset + + GetMaxOffset(listPtr) - 1; + } else { + x = (width + GetMaxOffset(listPtr))/2 - totalLength/2 - + listPtr->xOffset; + } + + Tk_DrawChars(listPtr->display, pixmap, gc, listPtr->tkfont, stringRep, stringLen, x, y); /* @@ -2641,7 +2646,12 @@ ListboxEventProc( ChangeListboxView(listPtr, listPtr->topIndex); if (listPtr->justify == TK_JUSTIFY_RIGHT) { maxOffset = GetMaxOffset(listPtr); - if (maxOffset != listPtr->oldMaxOffset && listPtr->oldMaxOffset > 0) { // window has shrunk + if (maxOffset != listPtr->oldMaxOffset && listPtr->oldMaxOffset > 0) { + + /* + * Window has shrunk. + */ + if (maxOffset > listPtr->oldMaxOffset) { tmpOffset = maxOffset - listPtr->oldMaxOffset; } else { @@ -2661,7 +2671,12 @@ ListboxEventProc( listPtr->oldMaxOffset = maxOffset; } else if (listPtr->justify == TK_JUSTIFY_CENTER) { maxOffset = GetMaxOffset(listPtr); - if (maxOffset != listPtr->oldMaxOffset && listPtr->oldMaxOffset > 0) { // window has shrunk + if (maxOffset != listPtr->oldMaxOffset && listPtr->oldMaxOffset > 0) { + + /* + * Window has shrunk. + */ + tmpOffset2 = maxOffset / 2; if (maxOffset > listPtr->oldMaxOffset) { tmpOffset = maxOffset/2 - listPtr->oldMaxOffset/2; @@ -3661,21 +3676,24 @@ MigrateHashEntries( * * GetMaxOffset -- * - * Passing in a listbox pointer, returns the maximum offset for the box + * Passing in a listbox pointer, returns the maximum offset for the box. * * Results: - * Listbox's maxOffset + * Listbox's maxOffset. * * Side effects: - * None + * None. * *---------------------------------------------------------------------- */ -static int GetMaxOffset(register Listbox *listPtr) +static int GetMaxOffset( + register Listbox *listPtr) { int maxOffset; - maxOffset = listPtr->maxWidth - (Tk_Width(listPtr->tkwin) - 2*listPtr->inset - 2*listPtr->selBorderWidth) + listPtr->xScrollUnit - 1; + maxOffset = listPtr->maxWidth - + (Tk_Width(listPtr->tkwin) - 2*listPtr->inset - + 2*listPtr->selBorderWidth) + listPtr->xScrollUnit - 1; if (maxOffset < 0) { maxOffset = 0; } diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index dc73188..65762b7 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -259,10 +259,10 @@ #define DEF_LISTBOX_HIGHLIGHT_BG NORMAL_BG #define DEF_LISTBOX_HIGHLIGHT BLACK #define DEF_LISTBOX_HIGHLIGHT_WIDTH "0" +#define DEF_LISTBOX_JUSTIFY "left" #define DEF_LISTBOX_RELIEF "solid" #define DEF_LISTBOX_SCROLL_COMMAND "" #define DEF_LISTBOX_LIST_VARIABLE "" -#define DEF_LISTBOX_JUSTIFY "left" #define DEF_LISTBOX_SELECT_COLOR SELECT_BG #define DEF_LISTBOX_SELECT_MONO BLACK #define DEF_LISTBOX_SELECT_BD "0" diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h index ac7bc4d..2c3854d 100644 --- a/unix/tkUnixDefault.h +++ b/unix/tkUnixDefault.h @@ -221,10 +221,10 @@ #define DEF_LISTBOX_HIGHLIGHT_BG NORMAL_BG #define DEF_LISTBOX_HIGHLIGHT BLACK #define DEF_LISTBOX_HIGHLIGHT_WIDTH "1" +#define DEF_LISTBOX_JUSTIFY "left" #define DEF_LISTBOX_RELIEF "sunken" #define DEF_LISTBOX_SCROLL_COMMAND "" #define DEF_LISTBOX_LIST_VARIABLE "" -#define DEF_LISTBOX_JUSTIFY "left" #define DEF_LISTBOX_SELECT_COLOR SELECT_BG #define DEF_LISTBOX_SELECT_MONO BLACK #define DEF_LISTBOX_SELECT_BD "0" diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h index 29fe4ee..f389075 100644 --- a/win/tkWinDefault.h +++ b/win/tkWinDefault.h @@ -224,10 +224,10 @@ #define DEF_LISTBOX_HIGHLIGHT_BG NORMAL_BG #define DEF_LISTBOX_HIGHLIGHT HIGHLIGHT #define DEF_LISTBOX_HIGHLIGHT_WIDTH "1" +#define DEF_LISTBOX_JUSTIFY "left" #define DEF_LISTBOX_RELIEF "sunken" #define DEF_LISTBOX_SCROLL_COMMAND "" #define DEF_LISTBOX_LIST_VARIABLE "" -#define DEF_LISTBOX_JUSTIFY "left" #define DEF_LISTBOX_SELECT_COLOR SELECT_BG #define DEF_LISTBOX_SELECT_MONO BLACK #define DEF_LISTBOX_SELECT_BD "0" -- cgit v0.12 From 5de259d30a538e9ede43cea981bdf0002bb0601d Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 11 Jan 2016 16:23:55 +0000 Subject: Polished listbox justification demo --- library/demos/states.tcl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/library/demos/states.tcl b/library/demos/states.tcl index 41ce0bf..aeb3d5b 100644 --- a/library/demos/states.tcl +++ b/library/demos/states.tcl @@ -19,14 +19,16 @@ positionWindow $w label $w.msg -font $font -wraplength 4i -justify left -text "A listbox containing the 50 states is displayed below, along with a scrollbar. You can scan the list either using the scrollbar or by scanning. To scan, press button 2 in the widget and drag up or down." pack $w.msg -side top +labelframe $w.justif -text Justification foreach c {Left Center Right} { set lower [string tolower $c] - radiobutton $w.$lower -text $c -variable just \ - -relief flat -value $lower -anchor w \ - -command "$w.frame.list configure -justify \$just" \ - -tristatevalue "multi" - pack $w.$lower -side left -pady 2 -fill x + radiobutton $w.justif.$lower -text $c -variable just \ + -relief flat -value $lower -anchor w \ + -command "$w.frame.list configure -justify \$just" \ + -tristatevalue "multi" + pack $w.justif.$lower -side left -pady 2 -fill x } +pack $w.justif ## See Code / Dismiss buttons set btns [addSeeDismiss $w.buttons $w] -- cgit v0.12 From 2ab896442a6992390a79803686b3aa3abe266cc6 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 11 Jan 2016 18:00:11 +0000 Subject: Added some tests --- tests/listbox.test | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/listbox.test b/tests/listbox.test index 0519e93..effaad8 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -203,6 +203,21 @@ test listbox-1.31 {configuration options} -body { } -cleanup { .l configure -highlightthickness [lindex [.l configure -highlightthickness] 3] } -result {0 0} +test listbox-1.32.1 {configuration options} -setup { + set res {} +} -body { + .l configure -justify left + set res [list [lindex [.l configure -justify] 4] [.l cget -justify]] + .l configure -justify center + lappend res [lindex [.l configure -justify] 4] [.l cget -justify] + .l configure -justify right + lappend res [lindex [.l configure -justify] 4] [.l cget -justify] +} -cleanup { + .l configure -justify [lindex [.l configure -justify] 3] +} -result {left left center center right right} +test listbox-1.32.2 {configuration options} -body { + .l configure -justify bogus +} -returnCodes error -result {bad justification "bogus": must be left, right, or center} test listbox-1.33 {configuration options} -body { .l configure -relief groove list [lindex [.l configure -relief] 4] [.l cget -relief] -- cgit v0.12 From c84948f660d87bfecd5cf830a4986d95f00c1e4a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 12 Jan 2016 09:46:26 +0000 Subject: Bring back DEF_TEXT_SPACING[123], since "0" is not exactly equal to NULL (just to be 100% sure there will not be a behavioral change) --- generic/tkText.c | 12 ++++++------ generic/tkTextTag.c | 4 ++-- macosx/tkMacOSXDefault.h | 3 +++ macosx/tkMacOSXDialog.c | 4 ++-- unix/tkUnixDefault.h | 3 +++ win/tkWinDefault.h | 3 +++ 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index eb9658e..a713e7e 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -215,14 +215,14 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BOOLEAN, "-setgrid", "setGrid", "SetGrid", DEF_TEXT_SET_GRID, -1, Tk_Offset(TkText, setGrid), 0, 0, 0}, {TK_OPTION_PIXELS, "-spacing1", "spacing1", "Spacing", - NULL, -1, Tk_Offset(TkText, spacing1), - TK_OPTION_NULL_OK, 0 , TK_TEXT_LINE_GEOMETRY }, + DEF_TEXT_SPACING1, -1, Tk_Offset(TkText, spacing1), + 0, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_PIXELS, "-spacing2", "spacing2", "Spacing", - NULL, -1, Tk_Offset(TkText, spacing2), - TK_OPTION_NULL_OK, 0 , TK_TEXT_LINE_GEOMETRY }, + DEF_TEXT_SPACING2, -1, Tk_Offset(TkText, spacing2), + 0, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_PIXELS, "-spacing3", "spacing3", "Spacing", - NULL, -1, Tk_Offset(TkText, spacing3), - TK_OPTION_NULL_OK, 0 , TK_TEXT_LINE_GEOMETRY }, + DEF_TEXT_SPACING3, -1, Tk_Offset(TkText, spacing3), + 0, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_CUSTOM, "-startline", NULL, NULL, NULL, -1, Tk_Offset(TkText, start), TK_OPTION_NULL_OK, &lineOption, TK_TEXT_LINE_RANGE}, diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index a433905..3363d25 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -45,10 +45,10 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, -1, Tk_Offset(TkTextTag, bgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", NULL, NULL, NULL, Tk_Offset(TkTextTag, borderWidthPtr), Tk_Offset(TkTextTag, borderWidth), - TK_OPTION_DONT_SET_DEFAULT|TK_OPTION_NULL_OK, 0, 0}, + TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_STRING, "-elide", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, elideString), - TK_OPTION_DONT_SET_DEFAULT|TK_OPTION_NULL_OK, 0, 0}, + TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_BITMAP, "-fgstipple", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, fgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_FONT, "-font", NULL, NULL, diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index b24c540..528ea10 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -536,6 +536,9 @@ #define DEF_TEXT_SELECT_FG_MONO WHITE #define DEF_TEXT_SELECT_RELIEF "flat" #define DEF_TEXT_SET_GRID "0" +#define DEF_TEXT_SPACING1 "0" +#define DEF_TEXT_SPACING2 "0" +#define DEF_TEXT_SPACING3 "0" #define DEF_TEXT_STATE "normal" #define DEF_TEXT_TABS "" #define DEF_TEXT_TABSTYLE "tabular" diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 8e49f65..f6edb6d 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -514,7 +514,7 @@ Tk_GetOpenFileObjCmd( callbackInfo->multiple = multiple; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { - parentIsKey = [parent isKeyWindow]; + parentIsKey = [parent isKeyWindow]; #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 [panel beginSheetForDirectory:directory file:filename @@ -860,7 +860,7 @@ Tk_ChooseDirectoryObjCmd( callbackInfo->multiple = 0; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { - parentIsKey = [parent isKeyWindow]; + parentIsKey = [parent isKeyWindow]; #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 [panel beginSheetForDirectory:directory file:filename diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h index 62e3fec..d214aa5 100644 --- a/unix/tkUnixDefault.h +++ b/unix/tkUnixDefault.h @@ -494,6 +494,9 @@ #define DEF_TEXT_SELECT_FG_MONO WHITE #define DEF_TEXT_SELECT_RELIEF "raised" #define DEF_TEXT_SET_GRID "0" +#define DEF_TEXT_SPACING1 "0" +#define DEF_TEXT_SPACING2 "0" +#define DEF_TEXT_SPACING3 "0" #define DEF_TEXT_STATE "normal" #define DEF_TEXT_TABS "" #define DEF_TEXT_TABSTYLE "tabular" diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h index 3a8ce9b..c52cc4d 100644 --- a/win/tkWinDefault.h +++ b/win/tkWinDefault.h @@ -497,6 +497,9 @@ #define DEF_TEXT_SELECT_FG_MONO WHITE #define DEF_TEXT_SELECT_RELIEF "flat" #define DEF_TEXT_SET_GRID "0" +#define DEF_TEXT_SPACING1 "0" +#define DEF_TEXT_SPACING2 "0" +#define DEF_TEXT_SPACING3 "0" #define DEF_TEXT_STATE "normal" #define DEF_TEXT_TABS "" #define DEF_TEXT_TABSTYLE "tabular" -- cgit v0.12 From bbcec99c56690c05359f41e55c6dd7f3461c9aee Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 12 Jan 2016 09:55:10 +0000 Subject: (cherry-pick) Fix [2049429]: Some options aren't picked up from the options database. --- doc/SetOptions.3 | 50 +++++++++++++++++++++++++++++-------------------- generic/tkEntry.c | 25 ++++++++++++------------- generic/tkListbox.c | 11 +++++------ generic/tkText.c | 8 ++++---- generic/tkTextTag.c | 8 ++++---- generic/ttk/ttkButton.c | 4 ++-- macosx/README | 2 +- macosx/tkMacOSXDialog.c | 2 +- 8 files changed, 59 insertions(+), 51 deletions(-) diff --git a/doc/SetOptions.3 b/doc/SetOptions.3 index 028467a..f12a00f 100644 --- a/doc/SetOptions.3 +++ b/doc/SetOptions.3 @@ -129,19 +129,21 @@ option table is no longer needed \fBTk_DeleteOptionTable\fR should be called to free all of its resources. All of the option tables for a Tcl interpreter are freed automatically if the interpreter is deleted. .PP -\fBTk_InitOptions\fR is invoked when a new widget is created to set -the default values for all of the widget's configuration options. -\fBTk_InitOptions\fR is passed a token for an option table (\fIoptionTable\fR) -and a pointer to a widget record (\fIrecordPtr\fR), which is the C -structure that holds information about this widget. \fBTk_InitOptions\fR -uses the information in the option table to -choose an appropriate default for each option, then it stores the default -value directly into the widget record, overwriting any information that -was already present in the widget record. \fBTk_InitOptions\fR normally -returns \fBTCL_OK\fR. If an error occurred while setting the default values -(e.g., because a default value was erroneous) then \fBTCL_ERROR\fR is returned -and an error message is left in \fIinterp\fR's result if \fIinterp\fR -is not NULL. +\fBTk_InitOptions\fR is invoked when a new widget is created to set the +default values for all of the widget's configuration options that do not +have \fBTK_OPTION_DONT_SET_DEFAULT\fR set in their \fIflags\fR field. +\fBTk_InitOptions\fR is passed a token for an option table +(\fIoptionTable\fR) and a pointer to a widget record (\fIrecordPtr\fR), +which is the C structure that holds information about this widget. +\fBTk_InitOptions\fR uses the information in the option table to choose an +appropriate default for each option, except those having +\fBTK_OPTION_DONT_SET_DEFAULT\fR set, then it stores the default value +directly into the widget record, overwriting any information that was +already present in the widget record. \fBTk_InitOptions\fR normally +returns \fBTCL_OK\fR. If an error occurred while setting the default +values (e.g., because a default value was erroneous) then \fBTCL_ERROR\fR +is returned and an error message is left in \fIinterp\fR's result if +\fIinterp\fR is not NULL. .PP \fBTk_SetOptions\fR is invoked to modify configuration options based on information specified in a Tcl command. The command might be one that @@ -306,19 +308,27 @@ given by \fIinternalOffset\fR. For example, if the option's type is value is not stored in that form. At least one of the offsets must be greater than or equal to zero. .PP -The \fIflags\fR field consists of one or more bits ORed together. At -present only a single flag is supported: \fBTK_OPTION_NULL_OK\fR. If -this bit is set for an option then an empty string will be accepted as -the value for the option and the resulting internal form will be a -NULL pointer, a zero value, or \fBNone\fR, depending on the type of -the option. If the flag is not set then empty strings will result -in errors. +The \fIflags\fR field consists of one or more bits ORed together. The +following flags are supported: +.TP +\fBTK_OPTION_NULL_OK\fR +If this bit is set for an option then an empty string will be accepted as +the value for the option and the resulting internal form will be a NULL +pointer, a zero value, or \fBNone\fR, depending on the type of the option. +If the flag is not set then empty strings will result in errors. \fBTK_OPTION_NULL_OK\fR is typically used to allow a feature to be turned off entirely, e.g. set a cursor value to \fBNone\fR so that a window simply inherits its parent's cursor. Not all option types support the \fBTK_OPTION_NULL_OK\fR flag; for those that do, there is an explicit indication of that fact in the descriptions below. +.TP +\fBTK_OPTION_DONT_SET_DEFAULT\fR +If this bit is set for an option then no default value will be set in +\fBTk_InitOptions\fR for this option. Neither the option database, nor any +system default value, nor \fIoptionTable\fR are used to give a default +value to this option. Instead it is assumed that the caller has already +supplied a default value in the widget code. .PP The \fItype\fR field of each Tk_OptionSpec structure determines how to parse the value of that configuration option. The diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 338652b..9f43f90 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -133,7 +133,7 @@ static const Tk_OptionSpec entryOptSpec[] = { 0, (ClientData) DEF_ENTRY_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_ENTRY_SELECT_FG_COLOR, -1, Tk_Offset(Entry, selFgColorPtr), - TK_CONFIG_NULL_OK, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0}, + TK_OPTION_NULL_OK, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0}, {TK_OPTION_STRING, "-show", "show", "Show", DEF_ENTRY_SHOW, -1, Tk_Offset(Entry, showChar), TK_OPTION_NULL_OK, 0, 0}, @@ -279,23 +279,23 @@ static const Tk_OptionSpec sbOptSpec[] = { 0, (ClientData) DEF_ENTRY_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_ENTRY_SELECT_FG_COLOR, -1, Tk_Offset(Entry, selFgColorPtr), - TK_CONFIG_NULL_OK, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0}, + TK_OPTION_NULL_OK, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_ENTRY_STATE, -1, Tk_Offset(Entry, state), 0, (ClientData) stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_ENTRY_TAKE_FOCUS, -1, Tk_Offset(Entry, takeFocus), - TK_CONFIG_NULL_OK, 0, 0}, + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", DEF_ENTRY_TEXT_VARIABLE, -1, Tk_Offset(Entry, textVarName), - TK_CONFIG_NULL_OK, 0, 0}, + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_DOUBLE, "-to", "to", "To", DEF_SPINBOX_TO, -1, Tk_Offset(Spinbox, toValue), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate", DEF_ENTRY_VALIDATE, -1, Tk_Offset(Entry, validate), 0, (ClientData) validateStrings, 0}, {TK_OPTION_STRING, "-validatecommand", "validateCommand","ValidateCommand", - NULL, -1, Tk_Offset(Entry, validateCmd), TK_CONFIG_NULL_OK, 0, 0}, + NULL, -1, Tk_Offset(Entry, validateCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-values", "values", "Values", DEF_SPINBOX_VALUES, -1, Tk_Offset(Spinbox, valueStr), TK_OPTION_NULL_OK, 0, 0}, @@ -307,7 +307,7 @@ static const Tk_OptionSpec sbOptSpec[] = { DEF_SPINBOX_WRAP, -1, Tk_Offset(Spinbox, wrap), 0, 0, 0}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", DEF_ENTRY_SCROLL_COMMAND, -1, Tk_Offset(Entry, scrollCmd), - TK_CONFIG_NULL_OK, 0, 0}, + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} }; @@ -390,7 +390,7 @@ static const char *selElementNames[] = { */ static int ConfigureEntry(Tcl_Interp *interp, Entry *entryPtr, - int objc, Tcl_Obj *const objv[], int flags); + int objc, Tcl_Obj *const objv[]); static int DeleteChars(Entry *entryPtr, int index, int count); static void DestroyEntry(char *memPtr); static void DisplayEntry(ClientData clientData); @@ -553,7 +553,7 @@ Tk_EntryObjCmd( if ((Tk_InitOptions(interp, (char *) entryPtr, optionTable, tkwin) != TCL_OK) || - (ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0) != TCL_OK)) { + (ConfigureEntry(interp, entryPtr, objc-2, objv+2) != TCL_OK)) { Tk_DestroyWindow(entryPtr->tkwin); return TCL_ERROR; } @@ -658,7 +658,7 @@ EntryWidgetObjCmd( Tcl_SetObjResult(interp, objPtr); } } else { - result = ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0); + result = ConfigureEntry(interp, entryPtr, objc-2, objv+2); } break; @@ -1086,8 +1086,7 @@ ConfigureEntry( Entry *entryPtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in argv. */ - Tcl_Obj *const objv[], /* Argument objects. */ - int flags) /* Flags to pass to Tk_ConfigureWidget. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_SavedOptions savedOptions; Tk_3DBorder border; @@ -3637,7 +3636,7 @@ Tk_SpinboxObjCmd( Tk_DestroyWindow(entryPtr->tkwin); return TCL_ERROR; } - if (ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0) != TCL_OK) { + if (ConfigureEntry(interp, entryPtr, objc-2, objv+2) != TCL_OK) { goto error; } @@ -3747,7 +3746,7 @@ SpinboxWidgetObjCmd( Tcl_SetObjResult(interp, objPtr); } } else { - result = ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0); + result = ConfigureEntry(interp, entryPtr, objc-2, objv+2); } break; diff --git a/generic/tkListbox.c b/generic/tkListbox.c index ff72596..86fb671 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -278,7 +278,7 @@ static const Tk_OptionSpec optionSpecs[] = { Tk_Offset(Listbox, selBorderWidth), 0, 0, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_LISTBOX_SELECT_FG_COLOR, -1, Tk_Offset(Listbox, selFgColorPtr), - TK_CONFIG_NULL_OK, (ClientData) DEF_LISTBOX_SELECT_FG_MONO, 0}, + TK_OPTION_NULL_OK, (ClientData) DEF_LISTBOX_SELECT_FG_MONO, 0}, {TK_OPTION_STRING, "-selectmode", "selectMode", "SelectMode", DEF_LISTBOX_SELECT_MODE, -1, Tk_Offset(Listbox, selectMode), TK_OPTION_NULL_OK, 0, 0}, @@ -379,7 +379,7 @@ enum indices { static void ChangeListboxOffset(Listbox *listPtr, int offset); static void ChangeListboxView(Listbox *listPtr, int index); static int ConfigureListbox(Tcl_Interp *interp, Listbox *listPtr, - int objc, Tcl_Obj *const objv[], int flags); + int objc, Tcl_Obj *const objv[]); static int ConfigureListboxItem(Tcl_Interp *interp, Listbox *listPtr, ItemAttr *attrs, int objc, Tcl_Obj *const objv[], int index); @@ -564,7 +564,7 @@ Tk_ListboxObjCmd( return TCL_ERROR; } - if (ConfigureListbox(interp, listPtr, objc-2, objv+2, 0) != TCL_OK) { + if (ConfigureListbox(interp, listPtr, objc-2, objv+2) != TCL_OK) { Tk_DestroyWindow(listPtr->tkwin); return TCL_ERROR; } @@ -700,7 +700,7 @@ ListboxWidgetObjCmd( result = TCL_OK; } } else { - result = ConfigureListbox(interp, listPtr, objc-2, objv+2, 0); + result = ConfigureListbox(interp, listPtr, objc-2, objv+2); } break; } @@ -1544,8 +1544,7 @@ ConfigureListbox( register Listbox *listPtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in argv. */ - Tcl_Obj *const objv[], /* Arguments. */ - int flags) /* Flags to pass to Tk_ConfigureWidget. */ + Tcl_Obj *const objv[]) /* Arguments. */ { Tk_SavedOptions savedOptions; Tcl_Obj *oldListObj = NULL; diff --git a/generic/tkText.c b/generic/tkText.c index 6e982b0..341ec0f 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -197,18 +197,18 @@ static const Tk_OptionSpec optionSpecs[] = { TK_OPTION_NULL_OK, (ClientData) DEF_TEXT_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_TEXT_SELECT_FG_COLOR, -1, Tk_Offset(TkText, selFgColorPtr), - TK_CONFIG_NULL_OK, (ClientData) DEF_TEXT_SELECT_FG_MONO, 0}, + TK_OPTION_NULL_OK, (ClientData) DEF_TEXT_SELECT_FG_MONO, 0}, {TK_OPTION_BOOLEAN, "-setgrid", "setGrid", "SetGrid", DEF_TEXT_SET_GRID, -1, Tk_Offset(TkText, setGrid), 0, 0, 0}, {TK_OPTION_PIXELS, "-spacing1", "spacing1", "Spacing", DEF_TEXT_SPACING1, -1, Tk_Offset(TkText, spacing1), - TK_OPTION_DONT_SET_DEFAULT, 0 , TK_TEXT_LINE_GEOMETRY }, + 0, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_PIXELS, "-spacing2", "spacing2", "Spacing", DEF_TEXT_SPACING2, -1, Tk_Offset(TkText, spacing2), - TK_OPTION_DONT_SET_DEFAULT, 0 , TK_TEXT_LINE_GEOMETRY }, + 0, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_PIXELS, "-spacing3", "spacing3", "Spacing", DEF_TEXT_SPACING3, -1, Tk_Offset(TkText, spacing3), - TK_OPTION_DONT_SET_DEFAULT, 0 , TK_TEXT_LINE_GEOMETRY }, + 0, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_CUSTOM, "-startline", NULL, NULL, NULL, -1, Tk_Offset(TkText, start), TK_OPTION_NULL_OK, (ClientData) &lineOption, TK_TEXT_LINE_RANGE}, diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index dad03bf..a310dd7 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -44,11 +44,11 @@ static const Tk_OptionSpec tagOptionSpecs[] = { {TK_OPTION_BITMAP, "-bgstipple", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, bgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", NULL, NULL, - "0", Tk_Offset(TkTextTag, borderWidthPtr), Tk_Offset(TkTextTag, borderWidth), - TK_OPTION_DONT_SET_DEFAULT|TK_OPTION_NULL_OK, 0, 0}, + NULL, Tk_Offset(TkTextTag, borderWidthPtr), Tk_Offset(TkTextTag, borderWidth), + TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_STRING, "-elide", NULL, NULL, - "0", -1, Tk_Offset(TkTextTag, elideString), - TK_OPTION_DONT_SET_DEFAULT|TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, Tk_Offset(TkTextTag, elideString), + TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_BITMAP, "-fgstipple", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, fgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_FONT, "-font", NULL, NULL, diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index 2954184..bc44f25 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -413,8 +413,8 @@ typedef struct static Tk_OptionSpec CheckbuttonOptionSpecs[] = { {TK_OPTION_STRING, "-variable", "variable", "Variable", - "", Tk_Offset(Checkbutton, checkbutton.variableObj), -1, - TK_OPTION_DONT_SET_DEFAULT,0,0}, + NULL, Tk_Offset(Checkbutton, checkbutton.variableObj), -1, + TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-onvalue", "onValue", "OnValue", "1", Tk_Offset(Checkbutton, checkbutton.onValueObj), -1, 0,0,0}, diff --git a/macosx/README b/macosx/README index 7b17fb8..8940ee6 100644 --- a/macosx/README +++ b/macosx/README @@ -399,7 +399,7 @@ The main program in a typical OSX application looks like this (see *) } The run method implements the event loop for the application. There -are three key steps in the run method. First it calls +are three key steps in the run method. First it calls [NSApp finishLaunching], which creates the bouncing application icon and does other mysterious things. Second it creates an NSAutoreleasePool. Third, it starts an event loop which drains the diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 6af6b33..67f17be 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -1027,7 +1027,7 @@ Tk_MessageBoxObjCmd( NSAlert *alert = [NSAlert new]; NSInteger modalReturnCode = 1; BOOL parentIsKey = NO; - + iconIndex = ICON_INFO; typeIndex = TYPE_OK; for (i = 1; i < objc; i += 2) { -- cgit v0.12 From 9b0a5374a4e77d86b7a0e94ff46dceb6a413d246 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 12 Jan 2016 15:08:41 +0000 Subject: Added more tests --- tests/listbox.test | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/tests/listbox.test b/tests/listbox.test index effaad8..57cd974 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -456,6 +456,80 @@ test listbox-3.18 {ListboxWidgetCmd procedure, "bbox" option, partial last line} mkPartial list [.partial.l bbox 3] [.partial.l bbox 4] } -result {{5 56 24 14} {5 73 23 14}} +test listbox-3.18a {ListboxWidgetCmd procedure, "bbox" option, justified} -constraints { + fonts +} -setup { + destroy .top.l .top + unset -nocomplain res +} -body { + toplevel .top + listbox .top.l -justify left + .top.l insert end Item1 LongerItem2 MuchLongerItem3 + pack .top.l + update + lappend res [.top.l bbox 0] [.top.l bbox 1] [.top.l bbox 2] + .top.l configure -justify center + lappend res [.top.l bbox 0] [.top.l bbox 1] [.top.l bbox 2] + .top.l configure -justify right + lappend res [.top.l bbox 0] [.top.l bbox 1] [.top.l bbox 2] +} -cleanup { + destroy .top.l .top + unset -nocomplain res +} -result { + # + # Results to be defined when I get my hands on a platform featuring tcltest::testConstraints fonts == 1 + {TBD} {TBD} {TBD} {TBD} {TBD} {TBD} +} +test listbox-3.18b {ListboxWidgetCmd procedure, "bbox" option, justified, non-default borderwidth} -setup { + destroy .top.l .top + unset -nocomplain lres res +} -body { + toplevel .top + listbox .top.l -justify left -borderwidth 17 -highlightthickness 19 -selectborderwidth 22 + .top.l insert end Item1 LongerItem2 MuchLongerItem3 + .top.l selection set 1 + pack .top.l + update + lappend lres [.top.l bbox 0] [.top.l bbox 1] [.top.l bbox 2] + .top.l configure -justify center + lappend lres [.top.l bbox 0] [.top.l bbox 1] [.top.l bbox 2] + .top.l configure -justify right + lappend lres [.top.l bbox 0] [.top.l bbox 1] [.top.l bbox 2] + set res 1 + for {set i 0} {$i < [llength $lres]} {incr i 4} { + set res [expr {$res * [expr {[lindex $lres $i] >= 0}] }] + } + set res +} -cleanup { + destroy .top.l .top + unset -nocomplain lres res +} -result {1} +test listbox-3.18c {ListboxWidgetCmd procedure, "bbox" option, justified, selecting does not change offset} -setup { + destroy .top.l .top + unset -nocomplain bb1 bb2 +} -body { + toplevel .top + listbox .top.l -justify center + .top.l insert end Item1 Item2 Item3 + pack .top.l + update + set bb1 [.top.l bbox 1] + .top.l selection set 1 + update + set bb2 [.top.l bbox 1] + expr { + [lindex $bb1 0] == [lindex $bb2 0] && + [lindex $bb1 1] == [lindex $bb2 1] && + [lindex $bb1 2] == [lindex $bb2 2] && + [lindex $bb1 3] == [lindex $bb2 3] + } + # Note: the result of this test is relevant only if test listbox-3.18a + # succeeds first, otherwise the fact the present test listbox-3.18c + # passes does not mean it is OK +} -cleanup { + destroy .top.l .top + unset -nocomplain bb1 bb2 +} -result {1} test listbox-3.19 {ListboxWidgetCmd procedure, "cget" option} -body { .l cget } -returnCodes error -result {wrong # args: should be ".l cget option"} -- cgit v0.12 From 9976bb4ea9febe4dbdb963f7b5d81e4c71a21ba0 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 13 Jan 2016 07:16:53 +0000 Subject: Typo fixed --- generic/tkListbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 2929882..7295677 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -90,7 +90,7 @@ typedef struct { * display. */ int topIndex; /* Index of top-most element visible in * window. */ - int fullLines; /* Number of lines that fit are completely + int fullLines; /* Number of lines that are completely * visible in window. There may be one * additional line at the bottom that is * partially visible. */ -- cgit v0.12 From cbe1741d686fd3de6be07ad51e091360d967b1ef Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 13 Jan 2016 07:49:55 +0000 Subject: More typos fixed --- generic/tkListbox.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 7295677..50f1717 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -97,7 +97,7 @@ typedef struct { int partialLine; /* 0 means that the window holds exactly * fullLines lines. 1 means that there is one * additional line that is partially - * visble. */ + * visible. */ int setGrid; /* Non-zero means pass gridding information to * window manager. */ @@ -131,7 +131,7 @@ typedef struct { int active; /* Index of "active" element (the one that has * been selected by keyboard traversal). -1 * means none. */ - int activeStyle; /* style in which to draw the active element. + int activeStyle; /* Style in which to draw the active element. * One of: underline, none, dotbox */ /* @@ -200,7 +200,7 @@ typedef struct { * be updated. * GOT_FOCUS: Non-zero means this widget currently has the * input focus. - * MAXWIDTH_IS_STALE: Stored maxWidth may be out-of-date + * MAXWIDTH_IS_STALE: Stored maxWidth may be out-of-date. * LISTBOX_DELETED: This listbox has been effectively destroyed. */ @@ -318,7 +318,7 @@ static const Tk_OptionSpec optionSpecs[] = { /* * The itemAttrOptionSpecs table defines the valid configuration options for - * listbox items + * listbox items. */ static const Tk_OptionSpec itemAttrOptionSpecs[] = { @@ -345,7 +345,7 @@ static const Tk_OptionSpec itemAttrOptionSpecs[] = { }; /* - * The following tables define the listbox widget commands (and sub- commands) + * The following tables define the listbox widget commands (and sub-commands) * and map the indexes into the string tables into enumerated types used to * dispatch the listbox widget command. */ @@ -628,7 +628,7 @@ ListboxWidgetObjCmd( /* * Parse the command by looking up the second argument in the list of - * valid subcommand names + * valid subcommand names. */ result = Tcl_GetIndexFromObj(interp, objv[1], commandNames, @@ -2033,7 +2033,7 @@ DisplayListbox( } else { /* * If there is an item attributes record for this item, draw - * the background box and set the foreground color accordingly + * the background box and set the foreground color accordingly. */ if (entry != NULL) { @@ -2489,7 +2489,7 @@ ListboxDeleteSubCmd( /* * Check width of the element. We only have to check if widthChanged * has not already been set to 1, because we only need one maxWidth - * element to disappear for us to have to recompute the width + * element to disappear for us to have to recompute the width. */ if (widthChanged == 0) { @@ -2824,7 +2824,11 @@ GetListboxIndex( stringRep = Tcl_GetString(indexObj); if (stringRep[0] == '@') { - /* @x,y index */ + + /* + * @x,y index + */ + int y; const char *start; char *end; @@ -3554,7 +3558,7 @@ ListboxListVarProc( /* * If the list length has decreased, then we should clean up selection and - * attributes information for elements past the end of the new list + * attributes information for elements past the end of the new list. */ oldLength = listPtr->nElements; -- cgit v0.12 From 48ae923fc9c18de0e45d927b819cc756b6833aba Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 16 Jan 2016 14:00:15 +0000 Subject: Addressed question 1 (see artifact [9d48a9c212] of ticket [3f456a5bb9]) --- generic/tkListbox.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 490f795..bea98ee 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -114,7 +114,8 @@ typedef struct { int xOffset; /* The left edge of each string in the listbox * is offset to the left by this many pixels * (0 means no offset, positive means there is - * an offset). */ + * an offset). This is x scrolling information + * is not linked to justification. */ /* * Information about what's selected or active, if any. -- cgit v0.12 From cc44a614a3a33b8007a980a64270832c67c629f2 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 16 Jan 2016 14:03:32 +0000 Subject: Addressed question 2 (see artifact [9d48a9c212] of ticket [3f456a5bb9]). This code arranges for the correct xview when creating the listbox with non-default justification. It is correctly placed in Tk_ListboxObjCmd. When changing justification later, i.e. in ConfigureListbox, there is no reason to change the xview, it would not be desired that the listbox xview jumps when configuring -justify. --- generic/tkListbox.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index bea98ee..56e2c2f 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -581,6 +581,10 @@ Tk_ListboxObjCmd( return TCL_ERROR; } + /* + * Adjust startup x view according to the justify option. + */ + if (listPtr->justify == TK_JUSTIFY_RIGHT) { listPtr->xOffset = GetMaxOffset(listPtr); } else if (listPtr->justify == TK_JUSTIFY_CENTER) { -- cgit v0.12 From d48a10cb3142cfbefd0314439d877da5eb03b926 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 16 Jan 2016 14:16:00 +0000 Subject: Addressed issue A and question 6 (see artifact [9d48a9c212] of ticket [3f456a5bb9]). Issue A is fixed. Test case: package req Tk listbox .l .l insert end M M M M M M M M M pack .l .l conf -just center ; # or right .l conf -highlightthickness 40 .l selection set 4 Regarding question 6, Tk_TextWidth is a bit lower level function in the API, which must be slightly beneficial regarding performance. Tk_TextWidth is therefore preferred. --- generic/tkListbox.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 56e2c2f..a57650b 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -1857,7 +1857,7 @@ DisplayListbox( * or right edge of the listbox is * off-screen. */ Pixmap pixmap; - int totalLength, height; + int textWidth; listPtr->flags &= ~REDRAW_PENDING; if (listPtr->flags & LISTBOX_DELETED) { @@ -2079,21 +2079,19 @@ DisplayListbox( Tcl_ListObjIndex(listPtr->interp, listPtr->listObj, i, &curElement); stringRep = Tcl_GetStringFromObj(curElement, &stringLen); - Tk_ComputeTextLayout(listPtr->tkfont, stringRep, stringLen, 0, - listPtr->justify, TK_IGNORE_NEWLINES, &totalLength, &height); + textWidth = Tk_TextWidth(listPtr->tkfont, stringRep, stringLen); Tk_GetFontMetrics(listPtr->tkfont, &fm); y += fm.ascent + listPtr->selBorderWidth; if (listPtr->justify == TK_JUSTIFY_LEFT) { - x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset; + x = (listPtr->inset + listPtr->selBorderWidth) - listPtr->xOffset; } else if (listPtr->justify == TK_JUSTIFY_RIGHT) { - x = width - totalLength - listPtr->inset - - listPtr->selBorderWidth - listPtr->xOffset + - GetMaxOffset(listPtr) - 1; + x = Tk_Width(tkwin) - (listPtr->inset + listPtr->selBorderWidth) + - textWidth - listPtr->xOffset + GetMaxOffset(listPtr); } else { - x = (width + GetMaxOffset(listPtr))/2 - totalLength/2 - - listPtr->xOffset; + x = (Tk_Width(tkwin) - textWidth)/2 + - listPtr->xOffset + GetMaxOffset(listPtr)/2; } Tk_DrawChars(listPtr->display, pixmap, gc, listPtr->tkfont, -- cgit v0.12 From dfecb499abf1df3c0605d0058f454d8230221dd8 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 16 Jan 2016 14:20:40 +0000 Subject: Addressed issue B (see artifact [9d48a9c212] of ticket [3f456a5bb9]) --- generic/tkListbox.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index a57650b..4f20d44 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -1096,6 +1096,7 @@ ListboxBboxSubCmd( Listbox *listPtr, /* Information about the listbox */ int index) /* Index of the element to get bbox info on */ { + register Tk_Window tkwin = listPtr->tkwin; int lastVisibleIndex; /* @@ -1131,7 +1132,15 @@ ListboxBboxSubCmd( Tk_GetFontMetrics(listPtr->tkfont, &fm); pixelWidth = Tk_TextWidth(listPtr->tkfont, stringRep, stringLen); - x = listPtr->inset + listPtr->selBorderWidth - listPtr->xOffset; + if (listPtr->justify == TK_JUSTIFY_LEFT) { + x = (listPtr->inset + listPtr->selBorderWidth) - listPtr->xOffset; + } else if (listPtr->justify == TK_JUSTIFY_RIGHT) { + x = Tk_Width(tkwin) - (listPtr->inset + listPtr->selBorderWidth) + - pixelWidth - listPtr->xOffset + GetMaxOffset(listPtr); + } else { + x = (Tk_Width(tkwin) - pixelWidth)/2 + - listPtr->xOffset + GetMaxOffset(listPtr)/2; + } y = ((index - listPtr->topIndex)*listPtr->lineHeight) + listPtr->inset + listPtr->selBorderWidth; results[0] = Tcl_NewIntObj(x); -- cgit v0.12 From c1d11ea280efc1d70e599d7237cf84235c715064 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 16 Jan 2016 15:21:29 +0000 Subject: Fixed bug [639558ac83] - Lots of listbox tests fail on Linux --- tests/listbox.test | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/listbox.test b/tests/listbox.test index f50267e..9ca0411 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -57,6 +57,7 @@ proc mkPartial {{w .partial}} { # like border width have predictable values. option add *Listbox.borderWidth 2 +option add *Listbox.selectBorderWidth 1 option add *Listbox.highlightThickness 2 option add *Listbox.font {Helvetica -12 bold} -- cgit v0.12 From e43c3c8be1a8b46419c5b4b8308a1dff03a803fc Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 16 Jan 2016 15:43:00 +0000 Subject: Decided about test results for listbox-3.18a --- tests/listbox.test | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/listbox.test b/tests/listbox.test index fdad4c0..b62946d 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -476,11 +476,11 @@ test listbox-3.18a {ListboxWidgetCmd procedure, "bbox" option, justified} -const } -cleanup { destroy .top.l .top unset -nocomplain res -} -result { - # - # Results to be defined when I get my hands on a platform featuring tcltest::testConstraints fonts == 1 - {TBD} {TBD} {TBD} {TBD} {TBD} {TBD} -} +} -result [list \ + {5 5 34 14} {5 22 74 14} {5 39 106 14} \ + {58 5 34 14} {38 22 74 14} {22 39 106 14} \ + {111 5 34 14} {71 22 74 14} {39 39 106 14} \ +] test listbox-3.18b {ListboxWidgetCmd procedure, "bbox" option, justified, non-default borderwidth} -setup { destroy .top.l .top unset -nocomplain lres res -- cgit v0.12 From 24a1905f5c41cebbad36b04ef8c1f9327fe5a109 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 16 Jan 2016 15:45:54 +0000 Subject: Removed test listbox-3.18c since it is irrelevant (the rendering of the selected items is made in a code that depends on existence of a selection but this is untestable by bboxing since bbox is independent from the presence of a selection in the listbox) --- tests/listbox.test | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/tests/listbox.test b/tests/listbox.test index b62946d..812d1c2 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -505,32 +505,6 @@ test listbox-3.18b {ListboxWidgetCmd procedure, "bbox" option, justified, non-de destroy .top.l .top unset -nocomplain lres res } -result {1} -test listbox-3.18c {ListboxWidgetCmd procedure, "bbox" option, justified, selecting does not change offset} -setup { - destroy .top.l .top - unset -nocomplain bb1 bb2 -} -body { - toplevel .top - listbox .top.l -justify center - .top.l insert end Item1 Item2 Item3 - pack .top.l - update - set bb1 [.top.l bbox 1] - .top.l selection set 1 - update - set bb2 [.top.l bbox 1] - expr { - [lindex $bb1 0] == [lindex $bb2 0] && - [lindex $bb1 1] == [lindex $bb2 1] && - [lindex $bb1 2] == [lindex $bb2 2] && - [lindex $bb1 3] == [lindex $bb2 3] - } - # Note: the result of this test is relevant only if test listbox-3.18a - # succeeds first, otherwise the fact the present test listbox-3.18c - # passes does not mean it is OK -} -cleanup { - destroy .top.l .top - unset -nocomplain bb1 bb2 -} -result {1} test listbox-3.19 {ListboxWidgetCmd procedure, "cget" option} -body { .l cget } -returnCodes error -result {wrong # args: should be ".l cget option"} -- cgit v0.12 From 61a97384456cdf43006536d3436fa51ee3e9acff Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 17 Jan 2016 20:40:01 +0000 Subject: Addressed questions 3 and 5 (see artifact [9d48a9c212] of ticket [3f456a5bb9]). It is not desirable to make the listbox xview jump on resizing. --- generic/tkListbox.c | 61 ----------------------------------------------------- 1 file changed, 61 deletions(-) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 4f20d44..9ff9d23 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -167,8 +167,6 @@ typedef struct { int flags; /* Various flag bits: see below for * definitions. */ Tk_Justify justify; /* Justification. */ - int oldMaxOffset; /* Used in scrolling for right/center - * justification. */ } Listbox; /* @@ -554,7 +552,6 @@ Tk_ListboxObjCmd( listPtr->state = STATE_NORMAL; listPtr->gray = None; listPtr->justify = TK_JUSTIFY_LEFT; - listPtr->oldMaxOffset = 0; /* * Keep a hold of the associated tkwin until we destroy the listbox, @@ -2623,7 +2620,6 @@ ListboxEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - int tmpOffset, tmpOffset2, maxOffset; Listbox *listPtr = clientData; if (eventPtr->type == Expose) { @@ -2655,63 +2651,6 @@ ListboxEventProc( } listPtr->flags |= UPDATE_V_SCROLLBAR|UPDATE_H_SCROLLBAR; ChangeListboxView(listPtr, listPtr->topIndex); - if (listPtr->justify == TK_JUSTIFY_RIGHT) { - maxOffset = GetMaxOffset(listPtr); - if (maxOffset != listPtr->oldMaxOffset && listPtr->oldMaxOffset > 0) { - - /* - * Window has shrunk. - */ - - if (maxOffset > listPtr->oldMaxOffset) { - tmpOffset = maxOffset - listPtr->oldMaxOffset; - } else { - tmpOffset = listPtr->oldMaxOffset - maxOffset; - } - tmpOffset -= tmpOffset % listPtr->xScrollUnit; - if ((tmpOffset + listPtr->xOffset) > maxOffset) { - tmpOffset = maxOffset - listPtr->xOffset; - } - if (tmpOffset < 0) { - tmpOffset = 0; - } - listPtr->xOffset += tmpOffset; - } else { - listPtr->xOffset = maxOffset; - } - listPtr->oldMaxOffset = maxOffset; - } else if (listPtr->justify == TK_JUSTIFY_CENTER) { - maxOffset = GetMaxOffset(listPtr); - if (maxOffset != listPtr->oldMaxOffset && listPtr->oldMaxOffset > 0) { - - /* - * Window has shrunk. - */ - - tmpOffset2 = maxOffset / 2; - if (maxOffset > listPtr->oldMaxOffset) { - tmpOffset = maxOffset/2 - listPtr->oldMaxOffset/2; - } else { - tmpOffset = listPtr->oldMaxOffset/2 - maxOffset/2; - } - tmpOffset -= tmpOffset % listPtr->xScrollUnit; - if ((tmpOffset + listPtr->xOffset) > maxOffset) { - tmpOffset = maxOffset - listPtr->xOffset; - } - if (tmpOffset < 0) { - tmpOffset = 0; - } - if (listPtr->xOffset < tmpOffset2) { - listPtr->xOffset += tmpOffset; - } else { - listPtr->xOffset -= tmpOffset; - } - } else { - listPtr->xOffset = maxOffset/2; - listPtr->xOffset -= listPtr->xOffset % listPtr->xScrollUnit; - } - listPtr->oldMaxOffset = maxOffset; - } ChangeListboxOffset(listPtr, listPtr->xOffset); /* -- cgit v0.12 From f753eecfed15ad634f2a6b98c56a6cd1f0194beb Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 17 Jan 2016 21:09:52 +0000 Subject: Addressed question 4 (see artifact [9d48a9c212] of ticket [3f456a5bb9]). --- generic/tkListbox.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 9ff9d23..e29c637 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -3630,7 +3630,8 @@ MigrateHashEntries( * * GetMaxOffset -- * - * Passing in a listbox pointer, returns the maximum offset for the box. + * Passing in a listbox pointer, returns the maximum offset for the box, + * i.e. the maximum possible horizontal scrolling value (in pixels). * * Results: * Listbox's maxOffset. @@ -3649,6 +3650,11 @@ static int GetMaxOffset( (Tk_Width(listPtr->tkwin) - 2*listPtr->inset - 2*listPtr->selBorderWidth) + listPtr->xScrollUnit - 1; if (maxOffset < 0) { + + /* + * Listbox is larger in width than its largest width item. + */ + maxOffset = 0; } maxOffset -= maxOffset % listPtr->xScrollUnit; -- cgit v0.12 From 53047ac807d37682c72abeb9a92fff3e41779108 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 18 Jan 2016 09:47:10 +0000 Subject: Fixed bug with the listbox justify patch: with large borders, when moving the horizontal scrollbar fully to the right the edge of the border could not be seen, one needed to push once on the right arrow of the scrollbar to see it. Test case: package require Tk destroy .top toplevel .top listbox .top.l -justify right -borderwidth 17 -highlightthickness 19 -selectborderwidth 22 scrollbar .top.hs -command ".top.l xview" -orient horizontal .top.l configure -xscrollcommand ".top.hs set" set huge [concat "START -" [string repeat "Huge Item... " 20] "- END"] .top.l insert end $huge pack .top.l -expand 1 -fill both pack .top.hs -expand 1 -fill x --- generic/tkListbox.c | 1 - 1 file changed, 1 deletion(-) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index e29c637..ee6941e 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -3657,7 +3657,6 @@ static int GetMaxOffset( maxOffset = 0; } - maxOffset -= maxOffset % listPtr->xScrollUnit; return maxOffset; } -- cgit v0.12 From 85c13e1d28d4bac711f3b92737b501207e261280 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 18 Jan 2016 10:08:58 +0000 Subject: Use GetMaxOffset when possible to reduce code duplication. The change in ListboxScanTo is not exactly equivalent but I believe the previous version was a bug. --- generic/tkListbox.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index ee6941e..795ec0f 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -2887,9 +2887,7 @@ ChangeListboxOffset( */ offset += listPtr->xScrollUnit / 2; - maxOffset = listPtr->maxWidth - (Tk_Width(listPtr->tkwin) - - 2*listPtr->inset - 2*listPtr->selBorderWidth) - + listPtr->xScrollUnit - 1; + maxOffset = GetMaxOffset(listPtr); if (offset > maxOffset) { offset = maxOffset; } @@ -2930,9 +2928,7 @@ ListboxScanTo( int newTopIndex, newOffset, maxIndex, maxOffset; maxIndex = listPtr->nElements - listPtr->fullLines; - maxOffset = listPtr->maxWidth + (listPtr->xScrollUnit - 1) - - (Tk_Width(listPtr->tkwin) - 2*listPtr->inset - - 2*listPtr->selBorderWidth - listPtr->xScrollUnit); + maxOffset = GetMaxOffset(listPtr); /* * Compute new top line for screen by amplifying the difference between -- cgit v0.12 From 94fd95f35c60eceaa87f6e666785e6a6d3fb5630 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 18 Jan 2016 10:19:24 +0000 Subject: Documented what listbox-3.18b intends to test. --- tests/listbox.test | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/listbox.test b/tests/listbox.test index 812d1c2..76a4349 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -485,6 +485,10 @@ test listbox-3.18b {ListboxWidgetCmd procedure, "bbox" option, justified, non-de destroy .top.l .top unset -nocomplain lres res } -body { + # This test checks whether all "x" values from bbox for different size + # items with different justification settings are all positive or zero + # This checks a bit the calculation of this x value with non-default + # borders widths of the listbox toplevel .top listbox .top.l -justify left -borderwidth 17 -highlightthickness 19 -selectborderwidth 22 .top.l insert end Item1 LongerItem2 MuchLongerItem3 -- cgit v0.12 From 60426c4ec3415ab57206d57f49f672f407b94a86 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 18 Jan 2016 18:17:30 +0000 Subject: Removed attempt of adjustment of the startup xview according to the -justify option. Anyway this does not work. --- generic/tkListbox.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 795ec0f..04dab6f 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -578,17 +578,6 @@ Tk_ListboxObjCmd( return TCL_ERROR; } - /* - * Adjust startup x view according to the justify option. - */ - - if (listPtr->justify == TK_JUSTIFY_RIGHT) { - listPtr->xOffset = GetMaxOffset(listPtr); - } else if (listPtr->justify == TK_JUSTIFY_CENTER) { - listPtr->xOffset = GetMaxOffset(listPtr) / 2; - listPtr->xOffset -= listPtr->xOffset % listPtr->xScrollUnit; - } - Tcl_SetObjResult(interp, TkNewWindowObj(listPtr->tkwin)); return TCL_OK; } -- cgit v0.12 From 65f1c08a6b543a6c25ad704beb200541fc7f6a94 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 18 Jan 2016 18:43:27 +0000 Subject: Reverted [5f396dacdc]. --- generic/tkListbox.c | 1 + tests/listbox.test | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 04dab6f..c7effdd 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -3642,6 +3642,7 @@ static int GetMaxOffset( maxOffset = 0; } + maxOffset -= maxOffset % listPtr->xScrollUnit; return maxOffset; } diff --git a/tests/listbox.test b/tests/listbox.test index 76a4349..40041de 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -509,6 +509,28 @@ test listbox-3.18b {ListboxWidgetCmd procedure, "bbox" option, justified, non-de destroy .top.l .top unset -nocomplain lres res } -result {1} +test listbox-3.18c {ListboxWidgetCmd procedure, "bbox" option, justified, with x scrolling} -setup { + destroy .top.l .top.hs .top + +} -body { +package req Tk +destroy .top.l .top.hs .top + toplevel .top + listbox .top.l -justify right -borderwidth 7 -highlightthickness 10 -selectborderwidth 20 + scrollbar .top.hs -command ".top.l xview" -orient horizontal + .top.l configure -xscrollcommand ".top.hs set" + set huge [concat "START -" [string repeat "Huge Item... " 20] "- END"] + .top.l insert end VeryVeryLongItem1 AnEvenMuchVeryVeryLongerItem2 $huge ShortItem3 + pack .top.l -expand 1 -fill both + pack .top.hs -expand 1 -fill x + update + + finish write this test case + +} -cleanup { + destroy .top.l .top.hs .top + +} -result {} test listbox-3.19 {ListboxWidgetCmd procedure, "cget" option} -body { .l cget } -returnCodes error -result {wrong # args: should be ".l cget option"} -- cgit v0.12 From eed41e54aa350fab52153895c9052ed38517e9fa Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 18 Jan 2016 18:45:27 +0000 Subject: Removed unfinished test case committed by error in the previous commit. --- tests/listbox.test | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/tests/listbox.test b/tests/listbox.test index 40041de..76a4349 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -509,28 +509,6 @@ test listbox-3.18b {ListboxWidgetCmd procedure, "bbox" option, justified, non-de destroy .top.l .top unset -nocomplain lres res } -result {1} -test listbox-3.18c {ListboxWidgetCmd procedure, "bbox" option, justified, with x scrolling} -setup { - destroy .top.l .top.hs .top - -} -body { -package req Tk -destroy .top.l .top.hs .top - toplevel .top - listbox .top.l -justify right -borderwidth 7 -highlightthickness 10 -selectborderwidth 20 - scrollbar .top.hs -command ".top.l xview" -orient horizontal - .top.l configure -xscrollcommand ".top.hs set" - set huge [concat "START -" [string repeat "Huge Item... " 20] "- END"] - .top.l insert end VeryVeryLongItem1 AnEvenMuchVeryVeryLongerItem2 $huge ShortItem3 - pack .top.l -expand 1 -fill both - pack .top.hs -expand 1 -fill x - update - - finish write this test case - -} -cleanup { - destroy .top.l .top.hs .top - -} -result {} test listbox-3.19 {ListboxWidgetCmd procedure, "cget" option} -body { .l cget } -returnCodes error -result {wrong # args: should be ".l cget option"} -- cgit v0.12 From 05fb4fb354a81a939be50ee1eea487e58cd6e5b6 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 20 Jan 2016 22:03:33 +0000 Subject: Fixed bug [9e606527af] - && instead of & used in generic/tkOption.c --- generic/tkOption.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkOption.c b/generic/tkOption.c index d758b6f..680c9db 100644 --- a/generic/tkOption.c +++ b/generic/tkOption.c @@ -560,7 +560,7 @@ Tk_GetOption( count -= levelPtr[-1].bases[currentStack]; } - if (currentStack && CLASS) { + if (currentStack & CLASS) { nodeId = winClassId; } else { nodeId = winNameId; -- cgit v0.12 From 10be4df79f97808bfedd7ac58d6e44e04a221e65 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 21 Jan 2016 20:04:18 +0000 Subject: Update changes file. --- changes | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/changes b/changes index 37cf0bd..6a5d4d7 100644 --- a/changes +++ b/changes @@ -7055,6 +7055,20 @@ Tk Cocoa 2.0: App Store enabled (walzer,culler,desmera,owen,nyberg,reincke) 2015-12-19 (bug)[793909] -textvariable handle undefined namespace (vogel) +2015-12-26 (bug)[2f78c7] crash with [text] and [tablelist] (vogel) + +2016-01-06 (bug)[1288433,3102228] <> misfires (vogel) + +2016-01-08 (bug)[1510538] initial scrollbar width (vogel,nijtmans) + +2016-01-08 (bug)[1305128] event not received by scrollbar (vogel,nijtmans) + +2016-01-09 (bug)[1927212] Mousewheel/scrollbar bindings (vogel) + +2016-01-11 (bug)[63c354] Cocoa message boxes (culler) + +2016-01-12 (bug)[2049429] get more $text options from database (vogel) + Tk Cocoa 2.0: More drawing internals refinements (culler,walzer) --- Released 8.5.19, January 31, 2016 --- http://core.tcl.tk/tk/ for details -- cgit v0.12 From 567e654b82f4cd34d86fa80a81c35250bc1392d9 Mon Sep 17 00:00:00 2001 From: dgp Date: Sat, 23 Jan 2016 18:55:15 +0000 Subject: Repair failure to compile on OSX/Cocoa. --- macosx/tkMacOSXDialog.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 67f17be..0f7ef3a 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -395,10 +395,12 @@ Tk_GetOpenFileObjCmd( NSMutableArray *fileTypes = nil; NSOpenPanel *panel = [NSOpenPanel openPanel]; NSInteger modalReturnCode = modalError; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + BOOL parentIsKey = NO; +#endif TkInitFileFilters(&fl); for (i = 1; i < objc; i += 2) { - BOOL parentIsKey = NO; if (Tcl_GetIndexFromObjStruct(interp, objv[i], openOptionStrings, sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) { goto end; @@ -598,10 +600,11 @@ Tk_GetSaveFileObjCmd( NSMutableArray *fileTypes = nil; NSSavePanel *panel = [NSSavePanel savePanel]; NSInteger modalReturnCode = modalError; + BOOL parentIsKey = NO; TkInitFileFilters(&fl); for (i = 1; i < objc; i += 2) { - BOOL parentIsKey = NO; + parentIsKey = NO; if (Tcl_GetIndexFromObjStruct(interp, objv[i], saveOptionStrings, sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) { goto end; -- cgit v0.12 From aafc31a89b188a589cc256a1f62bb80b2f053a2b Mon Sep 17 00:00:00 2001 From: dgp Date: Sat, 23 Jan 2016 19:00:19 +0000 Subject: Remove cross-test disruption. --- tests/font.test | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/font.test b/tests/font.test index 9ed24dc..2defb29 100644 --- a/tests/font.test +++ b/tests/font.test @@ -1162,6 +1162,7 @@ test font-33.1 {Tk_TextWidth procedure} { test font-34.1 {ConfigAttributesObj procedure: arguments} { # (Tcl_GetIndexFromObj() != TCL_OK) + set x {} setup list [catch {font create xyz -xyz} msg] $msg } {1 {bad option "-xyz": must be -family, -size, -weight, -slant, -underline, or -overstrike}} -- cgit v0.12 From 61276a830613eb1ed26aa90b4572e80b0caa64f3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 23 Jan 2016 19:41:53 +0000 Subject: Better repair of parentIsKey (backported from Tk 8.6). Problem was introduced in (apparently ill-merged) commit [3f634e02ece26dff] --- macosx/tkMacOSXDialog.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 0f7ef3a..84fef94 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -190,6 +190,7 @@ static NSURL *getFileURL(NSString *directory, NSString *filename) { Tcl_Obj **objv, **tmpv; int objc, result = Tcl_ListObjGetElements(callbackInfo->interp, callbackInfo->cmdObj, &objc, &objv); + if (result == TCL_OK && objc) { tmpv = (Tcl_Obj **) ckalloc(sizeof(Tcl_Obj *) * (objc + 2)); memcpy(tmpv, objv, sizeof(Tcl_Obj *) * objc); @@ -212,18 +213,22 @@ static NSURL *getFileURL(NSString *directory, NSString *filename) { ckfree((char *)callbackInfo); } } -- (void)tkAlertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode - contextInfo:(void *)contextInfo { + +- (void) tkAlertDidEnd: (NSAlert *) alert returnCode: (NSInteger) returnCode + contextInfo: (void *) contextInfo +{ AlertCallbackInfo *callbackInfo = contextInfo; if (returnCode >= NSAlertFirstButtonReturn) { Tcl_Obj *resultObj = Tcl_NewStringObj(alertButtonStrings[ alertNativeButtonIndexAndTypeToButtonIndex[callbackInfo-> typeIndex][returnCode - NSAlertFirstButtonReturn]], -1); + if (callbackInfo->cmdObj) { Tcl_Obj **objv, **tmpv; int objc, result = Tcl_ListObjGetElements(callbackInfo->interp, callbackInfo->cmdObj, &objc, &objv); + if (result == TCL_OK && objc) { tmpv = (Tcl_Obj **) ckalloc(sizeof(Tcl_Obj *) * (objc + 2)); memcpy(tmpv, objv, sizeof(Tcl_Obj *) * objc); @@ -395,9 +400,7 @@ Tk_GetOpenFileObjCmd( NSMutableArray *fileTypes = nil; NSOpenPanel *panel = [NSOpenPanel openPanel]; NSInteger modalReturnCode = modalError; -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 BOOL parentIsKey = NO; -#endif TkInitFileFilters(&fl); for (i = 1; i < objc; i += 2) { @@ -513,10 +516,10 @@ Tk_GetOpenFileObjCmd( callbackInfo->multiple = multiple; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { + parentIsKey = [parent isKeyWindow]; #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 [panel beginSheetForDirectory:directory file:filename - parentIsKey = [parent isKeyWindow]; types:fileTypes modalForWindow:parent modalDelegate:NSApp @@ -545,12 +548,12 @@ Tk_GetOpenFileObjCmd( contextInfo:callbackInfo]; } result = (modalReturnCode != modalError) ? TCL_OK : TCL_ERROR; - if (typeVariablePtr && result == TCL_OK) { - /* - * The -typevariable option is not really supported. if (parentIsKey) { [parent makeKeyWindow]; } + if (typeVariablePtr && result == TCL_OK) { + /* + * The -typevariable option is not really supported. */ Tcl_SetVar2(interp, Tcl_GetString(typeVariablePtr), NULL, @@ -604,7 +607,6 @@ Tk_GetSaveFileObjCmd( TkInitFileFilters(&fl); for (i = 1; i < objc; i += 2) { - parentIsKey = NO; if (Tcl_GetIndexFromObjStruct(interp, objv[i], saveOptionStrings, sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) { goto end; @@ -718,10 +720,10 @@ Tk_GetSaveFileObjCmd( callbackInfo->multiple = 0; parent = TkMacOSXDrawableWindow(((TkWindow *) tkwin)->window); if (haveParentOption && parent && ![parent attachedSheet]) { + parentIsKey = [parent isKeyWindow]; #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 [panel beginSheetForDirectory:directory file:filename - parentIsKey = [parent isKeyWindow]; modalForWindow:parent modalDelegate:NSApp didEndSelector: @@ -1177,7 +1179,7 @@ Tk_MessageBoxObjCmd( contextInfo:callbackInfo]; } result = (modalReturnCode >= NSAlertFirstButtonReturn) ? TCL_OK : TCL_ERROR; - end: + end: [alert release]; if (parentIsKey) { [parent makeKeyWindow]; -- cgit v0.12 From 3000865931e61dd77e966d0af27b4c86dcdbfaad Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 23 Jan 2016 19:46:08 +0000 Subject: (cherry-pick): Fixed bug [9e606527af] - && instead of & used in generic/tkOption.c --- generic/tkOption.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkOption.c b/generic/tkOption.c index bff799b..17989f8 100644 --- a/generic/tkOption.c +++ b/generic/tkOption.c @@ -559,7 +559,7 @@ Tk_GetOption( count -= levelPtr[-1].bases[currentStack]; } - if (currentStack && CLASS) { + if (currentStack & CLASS) { nodeId = winClassId; } else { nodeId = winNameId; -- cgit v0.12 From 7385219f157994efd45b0d32fd66f3ead06ea469 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sun, 24 Jan 2016 19:19:51 +0000 Subject: Crash in Mac test suite no longer triggered after patch from Marc Culler --- macosx/tkMacOSXNotify.c | 1 - macosx/tkMacOSXWm.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 0737d74..fa359f0 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -274,7 +274,6 @@ TkMacOSXEventsCheckProc( inMode:GetRunLoopMode(modalSession) dequeue:YES]; if (currentEvent) { - [NSApp _resetAutoreleasePool]; /* Generate Xevents. */ int oldServiceMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); NSEvent *processedEvent = [NSApp tkProcessEvent:currentEvent]; diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 5df72f0..114980f 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -24,8 +24,6 @@ #define DEBUG_ZOMBIES 0 -#define DEBUG_ZOMBIES 0 - /* #ifdef TK_MAC_DEBUG #define TK_MAC_DEBUG_WINDOWS -- cgit v0.12 From ac9442c6d07c589501a97b710d1608b1bb68a7dc Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 24 Jan 2016 20:12:55 +0000 Subject: Fix (minor) memory leak (backported from Tk 8.6). Some efficientcy improvements (backported from 8.6 too). No change of functionality --- macosx/tkMacOSXWm.c | 80 +++++++++++++++++++++-------------------------------- 1 file changed, 32 insertions(+), 48 deletions(-) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 114980f..be7bf47 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -911,9 +911,9 @@ TkWmDeadWindow( fprintf(stderr, "================= Pool dump ===================\n"); [NSAutoreleasePool showPools]; #endif + } ckfree((char *)wmPtr); winPtr->wmInfoPtr = NULL; - } } /* @@ -5112,7 +5112,7 @@ TkUnsupported1ObjCmd( }; Tk_Window tkwin = clientData; TkWindow *winPtr; - int index; + int index, i; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "option window ?arg ...?"); @@ -5121,56 +5121,40 @@ TkUnsupported1ObjCmd( /* Iterate through objc/objv to set correct background color and toggle opacity of window. */ - int i; for (i= 0; i < objc; i++) { - - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*black*") == 1) { - colorName = [NSColor blackColor]; // use #000000 in Tk scripts to match - } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*dark*") == 1) { + if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*black*")) { + colorName = [NSColor blackColor]; // use #000000 in Tk scripts to match + } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*dark*")) { colorName = [NSColor darkGrayColor]; //use #545454 in Tk scripts to match - } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*light*") == 1) { + } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*light*")) { colorName = [NSColor lightGrayColor]; //use #ababab in Tk scripts to match + } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*white*")) { + colorName = [NSColor whiteColor]; //use #ffffff in Tk scripts to match + } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "gray*")) { + colorName = [NSColor grayColor]; //use #7f7f7f in Tk scripts to match + } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*red*")) { + colorName = [NSColor redColor]; //use #ff0000 in Tk scripts to match + } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*green*")) { + colorName = [NSColor greenColor]; //use #00ff00 in Tk scripts to match + } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*blue*")) { + colorName = [NSColor blueColor]; //use #0000ff in Tk scripts to match + } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*cyan*")) { + colorName = [NSColor cyanColor]; //use #00ffff in Tk scripts to match + } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*yellow*")) { + colorName = [NSColor yellowColor]; //use #ffff00 in Tk scripts to match + } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*magenta*")) { + colorName = [NSColor magentaColor]; //use #ff00ff in Tk scripts to match + } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*orange*")) { + colorName = [NSColor orangeColor]; //use #ff8000 in Tk scripts to match + } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*purple*")) { + colorName = [NSColor purpleColor]; //use #800080 in Tk scripts to match + } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*brown*")){ + colorName = [NSColor brownColor]; //use #996633 in Tk scripts to match + } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*clear*")) { + colorName = [NSColor clearColor]; //use systemTransparent in Tk scripts to match } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*white*") == 1) { - colorName = [NSColor whiteColor]; //use #ffffff in Tk scripts to match - } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "gray*") == 1) { - colorName = [NSColor grayColor]; //use #7f7f7f in Tk scripts to match - } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*red*") == 1) { - colorName = [NSColor redColor]; //use #ff0000 in Tk scripts to match - } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*green*") == 1) { - colorName = [NSColor greenColor]; //use #00ff00 in Tk scripts to match - } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*blue*") == 1) { - colorName = [NSColor blueColor]; //use #0000ff in Tk scripts to match - } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*cyan*") == 1) { - colorName = [NSColor cyanColor]; //use #00ffff in Tk scripts to match - } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*yellow*") == 1) { - colorName = [NSColor yellowColor]; //use #ffff00 in Tk scripts to match - } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*magenta*") == 1) { - colorName = [NSColor magentaColor]; //use #ff00ff in Tk scripts to match - } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*orange*") == 1) { - colorName = [NSColor orangeColor]; //use #ff8000 in Tk scripts to match - } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*purple*") == 1) { - colorName = [NSColor purpleColor]; //use #800080 in Tk scripts to match - } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*brown*") == 1){ - colorName = [NSColor brownColor]; //use #996633 in Tk scripts to match - } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*clear*") == 1) { - colorName = [NSColor clearColor]; //use systemTransparent in Tk scripts to match - } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*opacity*") == 1) { - opaqueTag=YES; + if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*opacity*")) { + opaqueTag = YES; } } -- cgit v0.12 From 48ef3bc66f0806a4b54f4abb9888a5fc53e78d33 Mon Sep 17 00:00:00 2001 From: jenglish Date: Mon, 25 Jan 2016 20:39:31 +0000 Subject: NotebookAddCommand: fix off-by-one error counting objc/objv when readding an already-managed window with arguments. Bug reported on tcl-core by Sam Bromley (22 Jan 2016) --- generic/ttk/ttkNotebook.c | 2 +- tests/ttk/notebook.test | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 551f4a6..dd757cb 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -902,7 +902,7 @@ static int NotebookAddCommand( if (tab->state == TAB_STATE_HIDDEN) { tab->state = TAB_STATE_NORMAL; } - if (ConfigureTab(interp, nb, tab, slaveWindow, objc-4,objv+4) != TCL_OK) { + if (ConfigureTab(interp, nb, tab, slaveWindow, objc-3,objv+3) != TCL_OK) { return TCL_ERROR; } diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test index cdce020..3a2a6ff 100644 --- a/tests/ttk/notebook.test +++ b/tests/ttk/notebook.test @@ -468,6 +468,27 @@ test notebook-1817596-3 "insert/configure" -body { } -result [list [list .nb.l2 .nb.l0 .nb.l1] L2 L0 L1] -cleanup { destroy .nb } +test notebook-readd-1 "add same widget twice" -body { + pack [ttk::notebook .nb] + .nb add [ttk::button .nb.b1] -text "Button" + .nb add .nb.b1 + .nb tabs +} -result [list .nb.b1] -cleanup { destroy .nb } + +test notebook-readd-2 "add same widget twice, with options" -body { + pack [ttk::notebook .nb] + .nb add [ttk::button .nb.b1] -text "Tab label" + .nb add .nb.b1 -text "Changed tab label" + .nb tabs +} -result [list .nb.b1] -cleanup { destroy .nb } + +test notebook-readd-3 "insert same widget twice, with options" -body { + pack [ttk::notebook .nb] + .nb insert end [ttk::button .nb.b1] -text "Tab label" + .nb insert end .nb.b1 -text "Changed tab label" + .nb tabs +} -result [list .nb.b1] -cleanup { destroy .nb } + # See #1343984 test notebook-1343984-1 "don't autoselect on destroy - setup" -body { -- cgit v0.12 From b93bf38ccbdc6c1ad92004de062574738c6a3569 Mon Sep 17 00:00:00 2001 From: jenglish Date: Mon, 25 Jan 2016 20:48:08 +0000 Subject: NotebookAddCommand: fix off-by-one error counting objc/objv when readding an already-managed window with arguments. Bug reported on tcl-core by Sam Bromley (22 Jan 2016) --- generic/ttk/ttkNotebook.c | 2 +- tests/ttk/notebook.test | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 16a8bfe..81a8b64 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -901,7 +901,7 @@ static int NotebookAddCommand( if (tab->state == TAB_STATE_HIDDEN) { tab->state = TAB_STATE_NORMAL; } - if (ConfigureTab(interp, nb, tab, slaveWindow, objc-4,objv+4) != TCL_OK) { + if (ConfigureTab(interp, nb, tab, slaveWindow, objc-3,objv+3) != TCL_OK) { return TCL_ERROR; } diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test index cdce020..3a2a6ff 100644 --- a/tests/ttk/notebook.test +++ b/tests/ttk/notebook.test @@ -468,6 +468,27 @@ test notebook-1817596-3 "insert/configure" -body { } -result [list [list .nb.l2 .nb.l0 .nb.l1] L2 L0 L1] -cleanup { destroy .nb } +test notebook-readd-1 "add same widget twice" -body { + pack [ttk::notebook .nb] + .nb add [ttk::button .nb.b1] -text "Button" + .nb add .nb.b1 + .nb tabs +} -result [list .nb.b1] -cleanup { destroy .nb } + +test notebook-readd-2 "add same widget twice, with options" -body { + pack [ttk::notebook .nb] + .nb add [ttk::button .nb.b1] -text "Tab label" + .nb add .nb.b1 -text "Changed tab label" + .nb tabs +} -result [list .nb.b1] -cleanup { destroy .nb } + +test notebook-readd-3 "insert same widget twice, with options" -body { + pack [ttk::notebook .nb] + .nb insert end [ttk::button .nb.b1] -text "Tab label" + .nb insert end .nb.b1 -text "Changed tab label" + .nb tabs +} -result [list .nb.b1] -cleanup { destroy .nb } + # See #1343984 test notebook-1343984-1 "don't autoselect on destroy - setup" -body { -- cgit v0.12 From b2bb8f7366e971a698d64610c5d30fa31f414ca1 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 28 Jan 2016 17:40:10 +0000 Subject: Bump to 8.6.5 --- README | 2 +- generic/tk.h | 4 ++-- library/tk.tcl | 2 +- unix/configure | 14 +++++++------- unix/configure.in | 2 +- win/configure | 2 +- win/configure.in | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README b/README index 1470c04..aa5d0f6 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ README: Tk - This is the Tk 8.6.4 source distribution. + This is the Tk 8.6.5 source distribution. http://sourceforge.net/projects/tcl/files/Tcl/ You can get any source release of Tk from the URL above. diff --git a/generic/tk.h b/generic/tk.h index 4a655a4..75d82ba 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -75,10 +75,10 @@ extern "C" { #define TK_MAJOR_VERSION 8 #define TK_MINOR_VERSION 6 #define TK_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TK_RELEASE_SERIAL 4 +#define TK_RELEASE_SERIAL 5 #define TK_VERSION "8.6" -#define TK_PATCH_LEVEL "8.6.4" +#define TK_PATCH_LEVEL "8.6.5" /* * A special definition used to allow this header file to be included from diff --git a/library/tk.tcl b/library/tk.tcl index 946ab7e..38162d1 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -13,7 +13,7 @@ # Insist on running with compatible version of Tcl package require Tcl 8.6 # Verify that we have Tk binary and script components from the same release -package require -exact Tk 8.6.4 +package require -exact Tk 8.6.5 # Create a ::tk namespace namespace eval ::tk { diff --git a/unix/configure b/unix/configure index 8f9a4ac..3958a6b 100755 --- a/unix/configure +++ b/unix/configure @@ -1338,7 +1338,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL=".4" +TK_PATCH_LEVEL=".5" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" @@ -9598,7 +9598,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. */ @@ -9606,7 +9606,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 @@ -9633,7 +9633,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 @@ -9647,18 +9647,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; } diff --git a/unix/configure.in b/unix/configure.in index 5a18d46..cb412af 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -25,7 +25,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL=".4" +TK_PATCH_LEVEL=".5" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" diff --git a/win/configure b/win/configure index 18efa23..cbac248 100755 --- a/win/configure +++ b/win/configure @@ -1312,7 +1312,7 @@ SHELL=/bin/sh TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL=".4" +TK_PATCH_LEVEL=".5" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ diff --git a/win/configure.in b/win/configure.in index 709b97f..0ff9304 100644 --- a/win/configure.in +++ b/win/configure.in @@ -14,7 +14,7 @@ SHELL=/bin/sh TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL=".4" +TK_PATCH_LEVEL=".5" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ -- cgit v0.12 From c3777ebd3a31648fc5427b9536d2e304e9cbcf77 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 29 Jan 2016 07:11:54 +0000 Subject: Fixed test entry-6.12: merge from 8.5 didn't see that $fixed does not exist in trunk version of entry.test. Thanks to emiliano for the report. --- tests/entry.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/entry.test b/tests/entry.test index 9c30b00..4f09450 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -1074,7 +1074,7 @@ test entry-3.42 {EntryWidgetCmd procedure, "scan" widget command} -setup { } -body { .e scan a } -cleanup { - destroy .e + destroy .efixed } -returnCodes error -result {wrong # args: should be ".e scan mark|dragto x"} test entry-3.43 {EntryWidgetCmd procedure, "scan" widget command} -setup { entry .e @@ -1896,12 +1896,12 @@ test entry-6.12 {EntryComputeGeometry procedure} -constraints { fonts } -setup { catch {destroy .e} - entry .e -font $fixed -bd 2 -relief raised -width 20 + entry .e -font {Courier -12} -bd 2 -relief raised -width 20 pack .e } -body { .e insert end "012\t456\t" update - list [.e index @81] [.e index @82] [.e index @116] [.e index @117] + list [.e index @80] [.e index @81] [.e index @115] [.e index @116] } -cleanup { destroy .e } -result {6 7 7 8} -- cgit v0.12 From b5e22a7b7e4fd964d34f9d16aa7802fe7322636c Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sun, 31 Jan 2016 00:53:25 +0000 Subject: Fix build errors on i386 for Cocoa; thanks to Marc Culler for patch --- macosx/tkMacOSXButton.c | 4 ++-- macosx/tkMacOSXInit.c | 2 -- macosx/tkMacOSXPrivate.h | 4 ++++ macosx/ttkMacOSXTheme.c | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index 59d394e..ebbcf09 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -289,10 +289,10 @@ TkpComputeButtonGeometry( if ( butPtr->indicatorOn ) { switch (butPtr->type) { case TYPE_RADIO_BUTTON: - GetThemeMetric(kThemeMetricRadioButtonWidth, &butPtr->indicatorDiameter); + GetThemeMetric(kThemeMetricRadioButtonWidth, (SInt32 *)&butPtr->indicatorDiameter); break; case TYPE_CHECK_BUTTON: - GetThemeMetric(kThemeMetricCheckBoxWidth, &butPtr->indicatorDiameter); + GetThemeMetric(kThemeMetricCheckBoxWidth, (SInt32 *)&butPtr->indicatorDiameter); break; default: break; diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index b965a38..33a60f2 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -57,9 +57,7 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt @end @implementation TKApplication -#ifndef __clang__ @synthesize poolProtected = _poolProtected; -#endif @end @implementation TKApplication(TKInit) diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 2a411f6..65d60ce 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -276,6 +276,10 @@ VISIBILITY_HIDDEN NSArray *_defaultHelpMenuItems; NSWindow *_windowWithMouse; NSAutoreleasePool *_mainPool; +#ifdef __i386__ + /* The Objective C runtime used on i386 requires this. */ + BOOL _poolProtected; +#endif } @property BOOL poolProtected; @end diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index 4753a40..f9611c5 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -298,7 +298,7 @@ static void TabElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { - *heightPtr = GetThemeMetric(kThemeMetricLargeTabHeight, heightPtr); + GetThemeMetric(kThemeMetricLargeTabHeight, (SInt32 *)heightPtr); *paddingPtr = Ttk_MakePadding(0, 0, 0, 2); } -- cgit v0.12 From 312ef46823e21b861e68eeb0073936e15177c0f7 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sun, 31 Jan 2016 00:54:18 +0000 Subject: Fix build errors on i386 for Cocoa; thanks to Marc Culler for patch --- macosx/tkMacOSXButton.c | 4 ++-- macosx/tkMacOSXInit.c | 2 -- macosx/tkMacOSXPrivate.h | 3 +++ macosx/ttkMacOSXTheme.c | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index adb78c6..35f4ab5 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -289,10 +289,10 @@ TkpComputeButtonGeometry( if ( butPtr->indicatorOn ) { switch (butPtr->type) { case TYPE_RADIO_BUTTON: - GetThemeMetric(kThemeMetricRadioButtonWidth, &butPtr->indicatorDiameter); + GetThemeMetric(kThemeMetricRadioButtonWidth, (SInt32 *)&butPtr->indicatorDiameter); break; case TYPE_CHECK_BUTTON: - GetThemeMetric(kThemeMetricCheckBoxWidth, &butPtr->indicatorDiameter); + GetThemeMetric(kThemeMetricCheckBoxWidth, (SInt32 *)&butPtr->indicatorDiameter); break; default: break; diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 26eb3f5..8e353b4 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -59,9 +59,7 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt @end @implementation TKApplication -#ifndef __clang__ @synthesize poolProtected = _poolProtected; -#endif @end @implementation TKApplication(TKInit) diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index e635020..d892f4e 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -274,6 +274,9 @@ VISIBILITY_HIDDEN NSArray *_defaultHelpMenuItems; NSWindow *_windowWithMouse; NSAutoreleasePool *_mainPool; +#ifdef __i386__ + BOOL _poolProtected; +#endif } @property BOOL poolProtected; @end diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index 87ec4c2..1997370 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -299,7 +299,7 @@ static void TabElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { - *heightPtr = GetThemeMetric(kThemeMetricLargeTabHeight, heightPtr); + GetThemeMetric(kThemeMetricLargeTabHeight, (SInt32 *)heightPtr); *paddingPtr = Ttk_MakePadding(0, 0, 0, 2); } -- cgit v0.12 From a5b54a7f07e68d3223a0b945b7e7e0da345633ed Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 2 Feb 2016 22:16:08 +0000 Subject: Re-implement tkoption readfile using Tcl_ReadChars --- generic/tkOption.c | 40 ++++++++-------------------------------- tests/option.file3 | 2 +- 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/generic/tkOption.c b/generic/tkOption.c index 680c9db..24e7fb3 100644 --- a/generic/tkOption.c +++ b/generic/tkOption.c @@ -1080,10 +1080,10 @@ ReadOptionFile( * TK_MAX_PRIO. */ { const char *realName; - char *buffer; + Tcl_Obj *buffer; int result, bufferSize; Tcl_Channel chan; - Tcl_DString newName, optString; + Tcl_DString newName; /* * Prevent file system access in a safe interpreter. @@ -1108,24 +1108,10 @@ ReadOptionFile( return TCL_ERROR; } - /* - * Compute size of file by seeking to the end of the file. This will - * overallocate if we are performing CRLF translation. - */ - - bufferSize = (int) Tcl_Seek(chan, (Tcl_WideInt) 0, SEEK_END); - Tcl_Seek(chan, (Tcl_WideInt) 0, SEEK_SET); - - if (bufferSize < 0) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "error seeking to end of file \"%s\": %s", - fileName, Tcl_PosixError(interp))); - Tcl_Close(NULL, chan); - return TCL_ERROR; - } - - buffer = ckalloc(bufferSize + 1); - bufferSize = Tcl_Read(chan, buffer, bufferSize); + buffer = Tcl_NewObj(); + Tcl_IncrRefCount(buffer); + Tcl_SetChannelOption(NULL, chan, "-encoding", "utf-8"); + bufferSize = Tcl_ReadChars(chan, buffer, -1, 0); if (bufferSize < 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "error reading file \"%s\": %s", @@ -1134,18 +1120,8 @@ ReadOptionFile( return TCL_ERROR; } Tcl_Close(NULL, chan); - buffer[bufferSize] = 0; - if ((bufferSize>2) && !memcmp(buffer, "\357\273\277", 3)) { - /* File starts with UTF-8 BOM */ - result = AddFromString(interp, tkwin, buffer+3, priority); - } else { - Tcl_DStringInit(&optString); - Tcl_ExternalToUtfDString(NULL, buffer, bufferSize, &optString); - result = AddFromString(interp, tkwin, Tcl_DStringValue(&optString), - priority); - Tcl_DStringFree(&optString); - } - ckfree(buffer); + result = AddFromString(interp, tkwin, Tcl_GetString(buffer), priority); + Tcl_DecrRefCount(buffer); return result; } diff --git a/tests/option.file3 b/tests/option.file3 index 87f41ae..146cfd9 100755 --- a/tests/option.file3 +++ b/tests/option.file3 @@ -1,4 +1,4 @@ -! This file is a sample option (resource) database used to test +! This file is a sample option (resource) database used to test ! Tk's option-handling capabilities. ! Comment line \ -- cgit v0.12 From 098b03f8f4259f1767486350c21f5b7e11a6e06b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 3 Feb 2016 08:45:48 +0000 Subject: Backout [477949] for Tk 8.5, after discussion in TclCore mailing list: option readfile cannot use multibytes. Ticket [0a3d799a] To clarify a bit, what we discovered was that [[option readfile]] as found in all Tk releases up to and including 8.5.18 is already able to read in the whole BMP, so long as the file is stored in the encoding utf-8. The classic ASCII subset is fine. utf-8 is fine. Other encodings are at best non-portable. What [477949] did was to add support for files stored in [[encoding system]] but at the expense of breaking the support for the files stored in utf-8. Not the right outcome for a patch release. --- generic/tkOption.c | 13 ++----------- tests/option.file3 | 18 ------------------ tests/option.test | 11 ++++------- 3 files changed, 6 insertions(+), 36 deletions(-) delete mode 100755 tests/option.file3 diff --git a/generic/tkOption.c b/generic/tkOption.c index 17989f8..95b140d 100644 --- a/generic/tkOption.c +++ b/generic/tkOption.c @@ -1086,7 +1086,7 @@ ReadOptionFile( char *buffer; int result, bufferSize; Tcl_Channel chan; - Tcl_DString newName, optString; + Tcl_DString newName; /* * Prevent file system access in a safe interpreter. @@ -1136,16 +1136,7 @@ ReadOptionFile( } Tcl_Close(NULL, chan); buffer[bufferSize] = 0; - if ((bufferSize>2) && !memcmp(buffer, "\357\273\277", 3)) { - /* File starts with UTF-8 BOM */ - result = AddFromString(interp, tkwin, buffer+3, priority); - } else { - Tcl_DStringInit(&optString); - Tcl_ExternalToUtfDString(NULL, buffer, bufferSize, &optString); - result = AddFromString(interp, tkwin, Tcl_DStringValue(&optString), - priority); - Tcl_DStringFree(&optString); - } + result = AddFromString(interp, tkwin, buffer, priority); ckfree(buffer); return result; } diff --git a/tests/option.file3 b/tests/option.file3 deleted file mode 100755 index 87f41ae..0000000 --- a/tests/option.file3 +++ /dev/null @@ -1,18 +0,0 @@ -! This file is a sample option (resource) database used to test -! Tk's option-handling capabilities. - -! Comment line \ - with a backslash-newline sequence embedded in it. - -*x1: blue - tktest.x2 : green -*\ -x3 \ - : pur\ -ple -*x 4: brówn -# More comments, this time delimited by hash-marks. - # Comment-line with space. -*x6: -*x9: \ \ \\\101\n -# comment line as last line of file. diff --git a/tests/option.test b/tests/option.test index 4668771..1bfcb7c 100644 --- a/tests/option.test +++ b/tests/option.test @@ -187,7 +187,6 @@ test option-14.12 {error conditions} { set option1 [file join [testsDirectory] option.file1] set option2 [file join [testsDirectory] option.file2] -set option3 [file join [testsDirectory] option.file3] test option-15.1 {database files} { list [catch {option read non-existent} msg] $msg @@ -208,18 +207,16 @@ test option-15.9 {database files} {option get . x3 color} burgundy test option-15.10 {database files} { list [catch {option read $option2} msg] $msg } {1 {missing colon on line 2}} -option read $option3 -test option-15.11 {database files} {option get . {x 4} color} br\xf3wn test option-16.1 {ReadOptionFile} { - set option4 [makeFile {} option.file3] - set file [open $option4 w] + set option3 [makeFile {} option.file3] + set file [open $option3 w] fconfigure $file -translation crlf puts $file "*x7: true\n*x8: false" close $file - option read $option4 userDefault + option read $option3 userDefault set result [list [option get . x7 color] [option get . x8 color]] - removeFile $option4 + removeFile $option3 set result } {true false} -- cgit v0.12 From e1d015ea1d6d8301149fa627ec1abf6b487d99c3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 3 Feb 2016 09:14:37 +0000 Subject: Added documentation, please review! --- doc/option.n | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/option.n b/doc/option.n index 8699c0d..8f29d3a 100644 --- a/doc/option.n +++ b/doc/option.n @@ -59,6 +59,11 @@ options specified in that file to the option database. If \fIpriority\fR is specified, it indicates the priority level at which to enter the options; \fIpriority\fR defaults to \fBinteractive\fR. .PP +The file is read through a channel which is in "utf-8" encoding, +invalid byte sequences are automatically converted to valid +ones. This means that encodings like ISO 8859-1 or cp1282 with +high probablility will work as well, but this is not guaranteed. +.PP The \fIpriority\fR arguments to the \fBoption\fR command are normally specified symbolically using one of the following values: .TP -- cgit v0.12 From 3b67157554ddf66b9d0fafeda1944869ed881b13 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 3 Feb 2016 09:20:12 +0000 Subject: Document that [encoding system] has no effect on option readfile --- doc/option.n | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/option.n b/doc/option.n index 8f29d3a..2763d64 100644 --- a/doc/option.n +++ b/doc/option.n @@ -60,9 +60,10 @@ is specified, it indicates the priority level at which to enter the options; \fIpriority\fR defaults to \fBinteractive\fR. .PP The file is read through a channel which is in "utf-8" encoding, -invalid byte sequences are automatically converted to valid -ones. This means that encodings like ISO 8859-1 or cp1282 with -high probablility will work as well, but this is not guaranteed. +invalid byte sequences are automatically converted to valid ones. +This means that encodings like ISO 8859-1 or cp1252 with high +probability will work as well, but this cannot be guaranteed. +This cannot be changed, setting the [encoding system] has no effect. .PP The \fIpriority\fR arguments to the \fBoption\fR command are normally specified symbolically using one of the following values: -- cgit v0.12 From 6dddb4fc012c00ae1c5465fcf5225fa618a6994c Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 4 Feb 2016 17:49:39 +0000 Subject: [06c1433906] Possible fix for text widget crashes. --- generic/tkTextDisp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 133a7d7..10f6414 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -4699,6 +4699,11 @@ TextChanged( } } + while ((lastPtr != NULL) + && (lastPtr->index.linePtr == index2Ptr->linePtr)) { + lastPtr = lastPtr->nextPtr; + } + /* * Delete all the DLines from firstPtr up to but not including lastPtr. */ -- cgit v0.12 From 4b766d1f24378289437bc45e7405f68a48053915 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 5 Feb 2016 19:30:32 +0000 Subject: Fix crashing test case, textDisp-8.13 --- generic/tkTextDisp.c | 5 +++++ tests/textDisp.test | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 18b373f..f2e760b 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -4765,6 +4765,11 @@ TextChanged( } } + while ((lastPtr != NULL) + && (lastPtr->index.linePtr == index2Ptr->linePtr)) { + lastPtr = lastPtr->nextPtr; + } + /* * Delete all the DLines from firstPtr up to but not including lastPtr. */ diff --git a/tests/textDisp.test b/tests/textDisp.test index caba769..f5fbd3d 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -1192,6 +1192,15 @@ test textDisp-8.12 {TkTextChanged, moving the insert cursor redraws only past an # cursor is in since this display line was just unlinked in (a). } {{8.0 9.0} {8.0 12.0} {8.0 12.0} {3.0 8.0} {2.0 3.0}} +test textDisp-8.13 {TkTextChanged, [06c1433906]} { + .t delete 1.0 end + .t insert 1.0 \nLine1\nLine2\n + update + .t insert 3.0 "" + .t delete 1.0 2.0 + update idletasks +} {} + test textDisp-9.1 {TkTextRedrawTag} { .t configure -wrap char .t delete 1.0 end -- cgit v0.12 From e5ea273dc4f32113d02d0ede8742e214ad6ea37b Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 7 Feb 2016 13:29:51 +0000 Subject: Hopefully a better fix for [06c1433906] - Text widget crash --- generic/tkTextDisp.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 10f6414..fe69f28 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -4683,6 +4683,9 @@ TextChanged( */ lastPtr = FindDLine(textPtr, dInfoPtr->dLinePtr, &rounded); + if ((lastPtr != NULL) && (TkTextIndexCmp(&lastPtr->index, &rounded) < 0)) { + lastPtr = lastPtr->nextPtr; + } /* * At least one display line is supposed to change. This makes the @@ -4699,11 +4702,6 @@ TextChanged( } } - while ((lastPtr != NULL) - && (lastPtr->index.linePtr == index2Ptr->linePtr)) { - lastPtr = lastPtr->nextPtr; - } - /* * Delete all the DLines from firstPtr up to but not including lastPtr. */ -- cgit v0.12 From 0253e18f4273fb5354b29beca73e4835ec02058f Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 7 Feb 2016 13:34:02 +0000 Subject: Cherrypicked the new test textDisp-8.13 from core-8-5-branch. This test (and all the other tests) pass. --- tests/textDisp.test | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/textDisp.test b/tests/textDisp.test index ac3aee0..532caf4 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -1191,6 +1191,14 @@ test textDisp-8.12 {TkTextChanged, moving the insert cursor redraws only past an # because during (b) findDLine cannot return the display line the # cursor is in since this display line was just unlinked in (a). } {{8.0 9.0} {8.0 12.0} {8.0 12.0} {3.0 8.0} {2.0 3.0}} +test textDisp-8.13 {TkTextChanged, used to crash, see [06c1433906]} { + .t delete 1.0 end + .t insert 1.0 \nLine1\nLine2\n + update + .t insert 3.0 "" + .t delete 1.0 2.0 + update idletasks +} {} test textDisp-9.1 {TkTextRedrawTag} { .t configure -wrap char -- cgit v0.12 From ecb4e238565152c913a65d2eb5d8ad782793b474 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 7 Feb 2016 19:21:04 +0000 Subject: while is better than if because it deals with wrapped lines then. --- generic/tkTextDisp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index fe69f28..91642f9 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -4683,7 +4683,7 @@ TextChanged( */ lastPtr = FindDLine(textPtr, dInfoPtr->dLinePtr, &rounded); - if ((lastPtr != NULL) && (TkTextIndexCmp(&lastPtr->index, &rounded) < 0)) { + while ((lastPtr != NULL) && (TkTextIndexCmp(&lastPtr->index, &rounded) < 0)) { lastPtr = lastPtr->nextPtr; } -- cgit v0.12 From 173f7cf4cfa6289eab436d64654e37090f2616f3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 8 Feb 2016 15:52:53 +0000 Subject: =?UTF-8?q?(cherry-pick):=20Fix=20[06c14339060ba9ae]:=20Text=20wid?= =?UTF-8?q?get=20crash=20during=20delete.=20Thanks=20to=20Fran=C3=A7ois=20?= =?UTF-8?q?Vogel=20for=20the=20implementation=20and=20Brian=20Griffin=20fo?= =?UTF-8?q?r=20all=20his=20help=20getting=20this=20figured=20out.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- generic/tkTextDisp.c | 8 +++----- tests/textDisp.test | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 10f6414..91642f9 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -4683,6 +4683,9 @@ TextChanged( */ lastPtr = FindDLine(textPtr, dInfoPtr->dLinePtr, &rounded); + while ((lastPtr != NULL) && (TkTextIndexCmp(&lastPtr->index, &rounded) < 0)) { + lastPtr = lastPtr->nextPtr; + } /* * At least one display line is supposed to change. This makes the @@ -4699,11 +4702,6 @@ TextChanged( } } - while ((lastPtr != NULL) - && (lastPtr->index.linePtr == index2Ptr->linePtr)) { - lastPtr = lastPtr->nextPtr; - } - /* * Delete all the DLines from firstPtr up to but not including lastPtr. */ diff --git a/tests/textDisp.test b/tests/textDisp.test index 6f26457..532caf4 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -1191,8 +1191,7 @@ test textDisp-8.12 {TkTextChanged, moving the insert cursor redraws only past an # because during (b) findDLine cannot return the display line the # cursor is in since this display line was just unlinked in (a). } {{8.0 9.0} {8.0 12.0} {8.0 12.0} {3.0 8.0} {2.0 3.0}} - -test textDisp-8.13 {TkTextChanged, [06c1433906]} { +test textDisp-8.13 {TkTextChanged, used to crash, see [06c1433906]} { .t delete 1.0 end .t insert 1.0 \nLine1\nLine2\n update -- cgit v0.12 From 6fcac7ae49122cfb95054e673f24cd82835d4116 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 8 Feb 2016 19:42:54 +0000 Subject: Reverted [311ef109] and [1847c858] because they are no longer needed to fix bug [2f78c7c5ea]. The corresponding test textDisp-9.14 still passes. --- generic/tkTextDisp.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 91642f9..c5ad36b 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -4806,16 +4806,9 @@ TextRedrawTag( /* * Round up the starting position if it's before the first line visible on - * the screen (we only care about what's on the screen). Beware that the - * display info structure might need update, for instance if we arrived - * here from an 'after idle' script removing tags in a range whose - * display lines (and dInfo) were partially invalidated by a previous - * delete operation in the text widget. + * the screen (we only care about what's on the screen). */ - if (dInfoPtr->flags & DINFO_OUT_OF_DATE) { - UpdateDisplayInfo(textPtr); - } dlPtr = dInfoPtr->dLinePtr; if (dlPtr == NULL) { return; -- cgit v0.12 From 47fa51915781b8ceb0ad65f72b06b6d4814dbde7 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 8 Feb 2016 20:13:20 +0000 Subject: More comments in FindDLine, with slightly optimized code to achieve the same functionality. --- generic/tkTextDisp.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index c5ad36b..d45ac73 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -6618,17 +6618,25 @@ FindDLine( /* * We're past the last display line, either because the desired * index lies past the visible text, or because the desired index - * is on the last display line showing the last logical line. + * is on the last display line. */ indexPtr2 = dlPtrPrev->index; TkTextIndexForwBytes(textPtr, &indexPtr2, dlPtrPrev->byteCount, &indexPtr2); if (TkTextIndexCmp(&indexPtr2,indexPtr) > 0) { + /* + * The desired index is on the last display line. + * --> return this display line. + */ dlPtr = dlPtrPrev; - break; } else { - return NULL; + /* + * The desired index is past the visible text. There is no + * display line displaying something at the desired index + * --> return NULL. + */ } + break; } if (TkTextIndexCmp(&dlPtr->index,indexPtr) > 0) { dlPtr = dlPtrPrev; -- cgit v0.12 From afd2fa759f72c2936c5fcec0449acbaaaa93f989 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 8 Feb 2016 20:15:40 +0000 Subject: Renumbered lines to avoid wrong interpretation of the test. --- tests/textDisp.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/textDisp.test b/tests/textDisp.test index 532caf4..6aa3721 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -1193,7 +1193,7 @@ test textDisp-8.12 {TkTextChanged, moving the insert cursor redraws only past an } {{8.0 9.0} {8.0 12.0} {8.0 12.0} {3.0 8.0} {2.0 3.0}} test textDisp-8.13 {TkTextChanged, used to crash, see [06c1433906]} { .t delete 1.0 end - .t insert 1.0 \nLine1\nLine2\n + .t insert 1.0 \nLine2\nLine3\n update .t insert 3.0 "" .t delete 1.0 2.0 -- cgit v0.12 From 83b0263aba8b8dbf0fd2fa41cb65bd43322c9c3b Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 8 Feb 2016 20:44:22 +0000 Subject: update release date --- changes | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/changes b/changes index 45d9411..a752d10 100644 --- a/changes +++ b/changes @@ -7029,8 +7029,6 @@ Tk Cocoa 2.0: App Store enabled (walzer,culler,desmera,owen,nyberg,reincke) 2015-10-22 (bug)[1414025] $entry insertion cursor visibility (vogel) -2015-10-25 (bug)[477949] Unicode-enable [option readfile] (androwish,nijtmans) - 2015-10-26 (bug) PNG rendering on El Capitan (meier,walzer) 2015-11-08 (bug)[2160206] menubutton panic (vogel) @@ -7073,4 +7071,4 @@ Tk Cocoa 2.0: App Store enabled (walzer,culler,desmera,owen,nyberg,reincke) Tk Cocoa 2.0: More drawing internals refinements (culler,walzer) ---- Released 8.5.19, January 31, 2016 --- http://core.tcl.tk/tk/ for details +--- Released 8.5.19, February 12, 2016 --- http://core.tcl.tk/tk/ for details -- cgit v0.12 From d00d37bf4da1bd2c0ac1548af910aea41a4e1289 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 8 Feb 2016 21:13:57 +0000 Subject: Made FindDLine fully match its header description. --- generic/tkTextDisp.c | 33 ++++++++++++++++++++++++++++++--- tests/textDisp.test | 11 +---------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index d45ac73..4d41134 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -6590,6 +6590,7 @@ FindDLine( CONST TkTextIndex *indexPtr)/* Index of desired character. */ { DLine *dlPtrPrev; + TkTextIndex indexPtr2; if (dlPtr == NULL) { return NULL; @@ -6614,7 +6615,6 @@ FindDLine( dlPtrPrev = dlPtr; dlPtr = dlPtr->nextPtr; if (dlPtr == NULL) { - TkTextIndex indexPtr2; /* * We're past the last display line, either because the desired * index lies past the visible text, or because the desired index @@ -6632,14 +6632,41 @@ FindDLine( } else { /* * The desired index is past the visible text. There is no - * display line displaying something at the desired index + * display line displaying something at the desired index. * --> return NULL. */ } break; } if (TkTextIndexCmp(&dlPtr->index,indexPtr) > 0) { - dlPtr = dlPtrPrev; + /* + * If we're here then we would normally expect that: + * dlPtrPrev->index <= indexPtr < dlPtr->index + * i.e. we have found the searched display line being dlPtr. + * However it is possible that some DLines were unlinked + * previously, leading to a situation where going through + * the list of display lines skips display lines that did + * exist just a moment ago. + */ + indexPtr2 = dlPtrPrev->index; + TkTextIndexForwBytes(textPtr, &indexPtr2, dlPtrPrev->byteCount, + &indexPtr2); + if (TkTextIndexCmp(&indexPtr2,indexPtr) > 0) { + /* + * Confirmed: + * dlPtrPrev->index <= indexPtr < dlPtr->index + * --> return dlPtrPrev. + */ + dlPtr = dlPtrPrev; + } else { + /* + * The last (rightmost) index shown by dlPtrPrev is still + * before the desired index. This may be because there was + * previously a display line between dlPtrPrev and dlPtr + * and this display line has been unlinked. + * --> return dlPtr. + */ + } break; } } diff --git a/tests/textDisp.test b/tests/textDisp.test index 6aa3721..885c940 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -1181,16 +1181,7 @@ test textDisp-8.12 {TkTextChanged, moving the insert cursor redraws only past an .t mark set insert 3.8 ; # within the same line update lappend res $tk_textRedraw - # This last one is tricky: correct result really is {2.0 3.0} when - # calling .t mark set insert, two calls to TkTextChanged are done: - # (a) to redraw the line of the past position of the cursor - # (b) to redraw the line of the new position of the cursor - # During (a) the display line showing the cursor gets unlinked, - # which leads TkTextChanged in (b) to schedule a redraw starting - # one line _before_ the line containing the insert cursor. This is - # because during (b) findDLine cannot return the display line the - # cursor is in since this display line was just unlinked in (a). -} {{8.0 9.0} {8.0 12.0} {8.0 12.0} {3.0 8.0} {2.0 3.0}} +} {{8.0 9.0} {8.0 12.0} {8.0 12.0} {3.0 8.0} {3.0 4.0}} test textDisp-8.13 {TkTextChanged, used to crash, see [06c1433906]} { .t delete 1.0 end .t insert 1.0 \nLine2\nLine3\n -- cgit v0.12 From 961c4a400fecbd654b8b744a5de3f006ceb22d58 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 8 Feb 2016 21:39:52 +0000 Subject: With the real fix in FindDLine ([717e12ee]) there is no need anymore of the emergency patch [c3c09f82]. --- generic/tkTextDisp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 4d41134..44d451a 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -4683,9 +4683,6 @@ TextChanged( */ lastPtr = FindDLine(textPtr, dInfoPtr->dLinePtr, &rounded); - while ((lastPtr != NULL) && (TkTextIndexCmp(&lastPtr->index, &rounded) < 0)) { - lastPtr = lastPtr->nextPtr; - } /* * At least one display line is supposed to change. This makes the -- cgit v0.12 From 4cf679d27cf1beb50d5806e6173a8071821aff95 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 8 Feb 2016 21:45:03 +0000 Subject: Corrected indentation + added an explanatory comment. --- generic/tkTextDisp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 07623c4..960f11a 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -5243,7 +5243,10 @@ TkTextSetYView( dInfoPtr->newTopPixelOffset = 0; goto scheduleUpdate; - } + } + /* + * The line is already on screen, with no need to scroll. + */ return; } } -- cgit v0.12 From bc001728827804d86aac9bd890ef3776ceee373c Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 8 Feb 2016 21:47:37 +0000 Subject: Corrected indentation + added an explanatory comment (cherrypicked [1121252f]) --- generic/tkTextDisp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 91642f9..559fbf7 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -5176,7 +5176,10 @@ TkTextSetYView( dInfoPtr->newTopPixelOffset = 0; goto scheduleUpdate; - } + } + /* + * The line is already on screen, with no need to scroll. + */ return; } } -- cgit v0.12 From c278933f3e8bc3f001b31f47b2ed6be701ff3c51 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 8 Feb 2016 22:06:39 +0000 Subject: Fixed (with a real fix this time) bug [06c1433906] - Text widget crash during delete (cherrypicked [48cf3656d9]) --- generic/tkTextDisp.c | 57 +++++++++++++++++++++++++++++++++++++--------------- tests/textDisp.test | 13 ++---------- 2 files changed, 43 insertions(+), 27 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 559fbf7..68c09fc 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -4683,9 +4683,6 @@ TextChanged( */ lastPtr = FindDLine(textPtr, dInfoPtr->dLinePtr, &rounded); - while ((lastPtr != NULL) && (TkTextIndexCmp(&lastPtr->index, &rounded) < 0)) { - lastPtr = lastPtr->nextPtr; - } /* * At least one display line is supposed to change. This makes the @@ -4806,16 +4803,9 @@ TextRedrawTag( /* * Round up the starting position if it's before the first line visible on - * the screen (we only care about what's on the screen). Beware that the - * display info structure might need update, for instance if we arrived - * here from an 'after idle' script removing tags in a range whose - * display lines (and dInfo) were partially invalidated by a previous - * delete operation in the text widget. + * the screen (we only care about what's on the screen). */ - if (dInfoPtr->flags & DINFO_OUT_OF_DATE) { - UpdateDisplayInfo(textPtr); - } dlPtr = dInfoPtr->dLinePtr; if (dlPtr == NULL) { return; @@ -6600,6 +6590,7 @@ FindDLine( CONST TkTextIndex *indexPtr)/* Index of desired character. */ { DLine *dlPtrPrev; + TkTextIndex indexPtr2; if (dlPtr == NULL) { return NULL; @@ -6624,24 +6615,58 @@ FindDLine( dlPtrPrev = dlPtr; dlPtr = dlPtr->nextPtr; if (dlPtr == NULL) { - TkTextIndex indexPtr2; /* * We're past the last display line, either because the desired * index lies past the visible text, or because the desired index - * is on the last display line showing the last logical line. + * is on the last display line. */ indexPtr2 = dlPtrPrev->index; TkTextIndexForwBytes(textPtr, &indexPtr2, dlPtrPrev->byteCount, &indexPtr2); if (TkTextIndexCmp(&indexPtr2,indexPtr) > 0) { + /* + * The desired index is on the last display line. + * --> return this display line. + */ dlPtr = dlPtrPrev; - break; } else { - return NULL; + /* + * The desired index is past the visible text. There is no + * display line displaying something at the desired index. + * --> return NULL. + */ } + break; } if (TkTextIndexCmp(&dlPtr->index,indexPtr) > 0) { - dlPtr = dlPtrPrev; + /* + * If we're here then we would normally expect that: + * dlPtrPrev->index <= indexPtr < dlPtr->index + * i.e. we have found the searched display line being dlPtr. + * However it is possible that some DLines were unlinked + * previously, leading to a situation where going through + * the list of display lines skips display lines that did + * exist just a moment ago. + */ + indexPtr2 = dlPtrPrev->index; + TkTextIndexForwBytes(textPtr, &indexPtr2, dlPtrPrev->byteCount, + &indexPtr2); + if (TkTextIndexCmp(&indexPtr2,indexPtr) > 0) { + /* + * Confirmed: + * dlPtrPrev->index <= indexPtr < dlPtr->index + * --> return dlPtrPrev. + */ + dlPtr = dlPtrPrev; + } else { + /* + * The last (rightmost) index shown by dlPtrPrev is still + * before the desired index. This may be because there was + * previously a display line between dlPtrPrev and dlPtr + * and this display line has been unlinked. + * --> return dlPtr. + */ + } break; } } diff --git a/tests/textDisp.test b/tests/textDisp.test index 532caf4..885c940 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -1181,19 +1181,10 @@ test textDisp-8.12 {TkTextChanged, moving the insert cursor redraws only past an .t mark set insert 3.8 ; # within the same line update lappend res $tk_textRedraw - # This last one is tricky: correct result really is {2.0 3.0} when - # calling .t mark set insert, two calls to TkTextChanged are done: - # (a) to redraw the line of the past position of the cursor - # (b) to redraw the line of the new position of the cursor - # During (a) the display line showing the cursor gets unlinked, - # which leads TkTextChanged in (b) to schedule a redraw starting - # one line _before_ the line containing the insert cursor. This is - # because during (b) findDLine cannot return the display line the - # cursor is in since this display line was just unlinked in (a). -} {{8.0 9.0} {8.0 12.0} {8.0 12.0} {3.0 8.0} {2.0 3.0}} +} {{8.0 9.0} {8.0 12.0} {8.0 12.0} {3.0 8.0} {3.0 4.0}} test textDisp-8.13 {TkTextChanged, used to crash, see [06c1433906]} { .t delete 1.0 end - .t insert 1.0 \nLine1\nLine2\n + .t insert 1.0 \nLine2\nLine3\n update .t insert 3.0 "" .t delete 1.0 2.0 -- cgit v0.12 From 199e45b764bee51a9aacbced3e5ac9828b731d3f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 9 Feb 2016 09:23:17 +0000 Subject: Fix [62a5ba7474]: tk 'make install' fails on Mac OS 10.11 --- macosx/GNUmakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index 02240ed..24e1f77 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -116,7 +116,7 @@ TCL_FRAMEWORK_DIR := ${TCL_BUILD_DIR}/.. MAKE_VARS := else TCL_DIR := ${TCL_FRAMEWORK_DIR}/Tcl.framework -TCL_EXE := ${TCLSH_DIR}/tclsh${TCL_VERSION} +TCL_EXE := ${TCLSH_DIR}/bin/tclsh${TCL_VERSION} MAKE_VARS := TCL_EXE export DYLD_FRAMEWORK_PATH := ${TCL_FRAMEWORK_DIR} endif -- cgit v0.12 From cee89de4d610dbf0fa12d1626fb704c73a098fc1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 9 Feb 2016 09:24:31 +0000 Subject: (cherry-pick): Fix [62a5ba7474]: tk 'make install' fails on Mac OS 10.11 --- macosx/GNUmakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index f3299e2..a69e9d9 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -116,7 +116,7 @@ TCL_FRAMEWORK_DIR := ${TCL_BUILD_DIR}/.. MAKE_VARS := else TCL_DIR := ${TCL_FRAMEWORK_DIR}/Tcl.framework -TCL_EXE := ${TCLSH_DIR}/tclsh${TCL_VERSION} +TCL_EXE := ${TCLSH_DIR}/bin/tclsh${TCL_VERSION} MAKE_VARS := TCL_EXE export DYLD_FRAMEWORK_PATH := ${TCL_FRAMEWORK_DIR} endif -- cgit v0.12 From 8f151700b10bf8811876305e284738707d4ad237 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 9 Feb 2016 09:48:23 +0000 Subject: Slightly more logical fix for [62a5ba7474]: tk 'make install' fails on Mac OS 10.11, which doesn't change the meaning of TCLSH_DIR --- macosx/GNUmakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index 24e1f77..d0bab1a 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -35,7 +35,7 @@ MANDIR ?= ${PREFIX}/man TCL_BUILD_DIR ?= ${BUILD_DIR}/tcl/${BUILD_STYLE} # location of installed tcl, only used if tcl in TCL_BUILD_DIR can't be found TCL_FRAMEWORK_DIR ?= /Library/Frameworks -TCLSH_DIR ?= ${PREFIX} +TCLSH_DIR ?= ${PREFIX}/bin # set to non-empty value to install manpages in addition to html help: INSTALL_MANPAGES ?= @@ -116,7 +116,7 @@ TCL_FRAMEWORK_DIR := ${TCL_BUILD_DIR}/.. MAKE_VARS := else TCL_DIR := ${TCL_FRAMEWORK_DIR}/Tcl.framework -TCL_EXE := ${TCLSH_DIR}/bin/tclsh${TCL_VERSION} +TCL_EXE := ${TCLSH_DIR}/tclsh${TCL_VERSION} MAKE_VARS := TCL_EXE export DYLD_FRAMEWORK_PATH := ${TCL_FRAMEWORK_DIR} endif -- cgit v0.12 From 815d4d45ee5bc0d0f1bc242e303f39491f356cb6 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 9 Feb 2016 09:49:21 +0000 Subject: (cherry-pick): Slightly more logical fix for [62a5ba7474]: tk 'make install' fails on Mac OS 10.11, which doesn't change the meaning of TCLSH_DIR --- macosx/GNUmakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index a69e9d9..46f76d5 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -35,7 +35,7 @@ MANDIR ?= ${PREFIX}/man TCL_BUILD_DIR ?= ${BUILD_DIR}/tcl/${BUILD_STYLE} # location of installed tcl, only used if tcl in TCL_BUILD_DIR can't be found TCL_FRAMEWORK_DIR ?= /Library/Frameworks -TCLSH_DIR ?= ${PREFIX} +TCLSH_DIR ?= ${PREFIX}/bin # set to non-empty value to install manpages in addition to html help: INSTALL_MANPAGES ?= @@ -116,7 +116,7 @@ TCL_FRAMEWORK_DIR := ${TCL_BUILD_DIR}/.. MAKE_VARS := else TCL_DIR := ${TCL_FRAMEWORK_DIR}/Tcl.framework -TCL_EXE := ${TCLSH_DIR}/bin/tclsh${TCL_VERSION} +TCL_EXE := ${TCLSH_DIR}/tclsh${TCL_VERSION} MAKE_VARS := TCL_EXE export DYLD_FRAMEWORK_PATH := ${TCL_FRAMEWORK_DIR} endif -- cgit v0.12 From 9e0da9a8a02dceebf16ed424cdef34ebcb6f3b5c Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 9 Feb 2016 18:44:42 +0000 Subject: Repair broken test. --- tests/entry.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/entry.test b/tests/entry.test index 4f09450..d27ffb5 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -1074,7 +1074,7 @@ test entry-3.42 {EntryWidgetCmd procedure, "scan" widget command} -setup { } -body { .e scan a } -cleanup { - destroy .efixed + destroy .e } -returnCodes error -result {wrong # args: should be ".e scan mark|dragto x"} test entry-3.43 {EntryWidgetCmd procedure, "scan" widget command} -setup { entry .e -- cgit v0.12 From b258e6b408ef99ed31fdde484f21548851eca156 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:23:23 +0000 Subject: -selectbackground tag configuration option: implementation --- generic/tkText.c | 7 ++++++- generic/tkText.h | 2 ++ generic/tkTextDisp.c | 13 +++++++++++++ generic/tkTextTag.c | 10 +++++++++- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 3079417..1b420d6 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2253,7 +2253,11 @@ ConfigureText( * replaced in the widget record. */ - textPtr->selTagPtr->border = textPtr->selBorder; + if (textPtr->selTagPtr->selBorder == NULL) { + textPtr->selTagPtr->border = textPtr->selBorder; + } else { + textPtr->selTagPtr->selBorder = textPtr->selBorder; + } if (textPtr->selTagPtr->borderWidthPtr != textPtr->selBorderWidthPtr) { textPtr->selTagPtr->borderWidthPtr = textPtr->selBorderWidthPtr; textPtr->selTagPtr->borderWidth = textPtr->selBorderWidth; @@ -2277,6 +2281,7 @@ ConfigureText( textPtr->selTagPtr->affectsDisplayGeometry = 1; } if ((textPtr->selTagPtr->border != NULL) + || (textPtr->selTagPtr->selBorder != NULL) || (textPtr->selTagPtr->reliefString != NULL) || (textPtr->selTagPtr->bgStipple != None) || (textPtr->selTagPtr->fgColor != NULL) diff --git a/generic/tkText.h b/generic/tkText.h index fc92644..5cd009f 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -362,6 +362,8 @@ typedef struct TkTextTag { * means option not specified. */ int rMargin; /* Right margin for text, in pixels. Only * valid if rMarginString is non-NULL. */ + Tk_3DBorder selBorder; /* Used for drawing background for selected text. + * NULL means no value specified here. */ char *spacing1String; /* -spacing1 option string (malloc-ed). NULL * means option not specified. */ int spacing1; /* Extra spacing above first display line for diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 7969091..1bd5905 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -748,6 +748,7 @@ GetStyle( TextStyle *stylePtr; Tcl_HashEntry *hPtr; int numTags, isNew, i; + int isSelected; XGCValues gcValues; unsigned long mask; /* @@ -786,6 +787,14 @@ GetStyle( styleValues.tabStyle = textPtr->tabStyle; styleValues.wrapMode = textPtr->wrapMode; styleValues.elide = 0; + isSelected = 0; + + for (i = 0 ; i < numTags; i++) { + if (textPtr->selTagPtr == tagPtrs[i]) { + isSelected = 1; + break; + } + } for (i = 0 ; i < numTags; i++) { Tk_3DBorder border; @@ -811,6 +820,10 @@ GetStyle( border = textPtr->inactiveSelBorder; } + if ((tagPtr->selBorder != NULL) && (isSelected)) { + border = tagPtr->selBorder; + } + if ((border != NULL) && (tagPtr->priority > borderPrio)) { styleValues.border = border; borderPrio = tagPtr->priority; diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index 3363d25..a857cf9 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -70,6 +70,8 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, -1, Tk_Offset(TkTextTag, reliefString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-rmargin", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, rMarginString), TK_OPTION_NULL_OK, 0,0}, + {TK_OPTION_BORDER, "-selectbackground", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-spacing1", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, spacing1String), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-spacing2", NULL, NULL, @@ -484,7 +486,11 @@ TkTextTagCmd( */ if (tagPtr == textPtr->selTagPtr) { - textPtr->selBorder = tagPtr->border; + if (tagPtr->selBorder == NULL) { + textPtr->selBorder = tagPtr->border; + } else { + textPtr->selBorder = tagPtr->selBorder; + } textPtr->selBorderWidth = tagPtr->borderWidth; textPtr->selBorderWidthPtr = tagPtr->borderWidthPtr; textPtr->selFgColorPtr = tagPtr->fgColor; @@ -509,6 +515,7 @@ TkTextTagCmd( tagPtr->affectsDisplayGeometry = 1; } if ((tagPtr->border != NULL) + || (tagPtr->selBorder != NULL) || (tagPtr->reliefString != NULL) || (tagPtr->bgStipple != None) || (tagPtr->fgColor != NULL) @@ -1017,6 +1024,7 @@ TkTextCreateTag( tagPtr->overstrike = 0; tagPtr->rMarginString = NULL; tagPtr->rMargin = 0; + tagPtr->selBorder = NULL; tagPtr->spacing1String = NULL; tagPtr->spacing1 = 0; tagPtr->spacing2String = NULL; -- cgit v0.12 From b3b68ebfe18ad11c210bc80ec440c49d7b6dad8d Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:24:38 +0000 Subject: -selectbackground tag configuration option: documentation --- doc/text.n | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/text.n b/doc/text.n index ac7803c..41d6a6f 100644 --- a/doc/text.n +++ b/doc/text.n @@ -517,6 +517,13 @@ option is only used when wrapping is enabled. If a text line wraps, the right margin for each line on the display is determined by the first non-elided character of that display line. .TP +\fB\-selectbackground \fIcolor\fR +\fIcolor\fR specifies the background color to use when displaying selected +items. It may have any of the forms accepted by \fBTk_GetColor\fR. If +\fIcolor\fR has not been specified, or if it is specified as an empty +string, then the color specified by the fB\-background\fR tag option is +used. +.TP \fB\-spacing1 \fIpixels\fR . \fIPixels\fR specifies how much additional space should be left above each -- cgit v0.12 From f47ea89bb9b84548e135f0a72a033b20f0fe9f2a Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:27:11 +0000 Subject: -selectbackground tag configuration option: tests --- tests/textTag.test | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/tests/textTag.test b/tests/textTag.test index fed073a..a7935da 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -228,6 +228,17 @@ test textTag-1.25 {configuration options} -constraints { } -cleanup { .t tag configure x -rmargin [lindex [.t tag configure x -rmargin] 3] } -returnCodes error -result {bad screen distance "bad"} +test textTag-1.25a {tag configuration options} -body { + .t tag configure x -selectbackground #012345 + .t tag cget x -selectbackground +} -cleanup { + .t tag configure x -selectbackground [lindex [.t tag configure x -selectbackground] 3] +} -result {#012345} +test textTag-1.25b {configuration options} -body { + .t tag configure x -selectbackground non-existent +} -cleanup { + .t tag configure x -selectbackground [lindex [.t tag configure x -selectbackground] 3] +} -returnCodes error -result {unknown color name "non-existent"} test textTag-1.26 {tag configuration options} -constraints { haveCourier12 } -body { @@ -713,7 +724,29 @@ test textTag-5.22 {TkTextTagCmd - "configure" option} -constraints { .t tag configure sel -borderwidth {} .t cget -selectborderwidth } -result {} - +test textTag-5.23 {TkTextTagCmd - "configure" option} -body { + set x {} + # when [.t tag cget sel -selectbackground] == "", mirroring happens between + # the text widget option -selectbackground + # and the tag option -background + .t tag configure sel -selectbackground {} + .t configure -selectbackground black + .t tag configure sel -background yellow + lappend x [.t cget -selectbackground] + .t tag configure sel -background orange + .t configure -selectbackground blue + lappend x [.t tag cget sel -background] + # when [.t tag cget sel -selectbackground] != "", mirroring happens between + # the text widget option -selectbackground + # and the tag option -selectbackground + .t tag configure sel -selectbackground green + .t configure -selectbackground red + lappend x [.t tag cget sel -selectbackground] + .t configure -selectbackground black + .t tag configure sel -selectbackground white + lappend x [.t cget -selectbackground] + return $x +} -result {yellow blue red white} test textTag-6.1 {TkTextTagCmd - "delete" option} -constraints { haveCourier12 -- cgit v0.12 From 0e661eb452692fff53250ae95abde079888f3a27 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:29:22 +0000 Subject: -selectforeground tag configuration option: implementation --- generic/tkText.c | 7 ++++++- generic/tkText.h | 2 ++ generic/tkTextDisp.c | 10 ++++++++-- generic/tkTextTag.c | 10 +++++++++- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 1b420d6..464d4d9 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2262,7 +2262,11 @@ ConfigureText( textPtr->selTagPtr->borderWidthPtr = textPtr->selBorderWidthPtr; textPtr->selTagPtr->borderWidth = textPtr->selBorderWidth; } - textPtr->selTagPtr->fgColor = textPtr->selFgColorPtr; + if (textPtr->selTagPtr->selFgColor == NULL) { + textPtr->selTagPtr->fgColor = textPtr->selFgColorPtr; + } else { + textPtr->selTagPtr->selFgColor = textPtr->selFgColorPtr; + } textPtr->selTagPtr->affectsDisplay = 0; textPtr->selTagPtr->affectsDisplayGeometry = 0; if ((textPtr->selTagPtr->elideString != NULL) @@ -2285,6 +2289,7 @@ ConfigureText( || (textPtr->selTagPtr->reliefString != NULL) || (textPtr->selTagPtr->bgStipple != None) || (textPtr->selTagPtr->fgColor != NULL) + || (textPtr->selTagPtr->selFgColor != NULL) || (textPtr->selTagPtr->fgStipple != None) || (textPtr->selTagPtr->overstrikeString != NULL) || (textPtr->selTagPtr->underlineString != NULL)) { diff --git a/generic/tkText.h b/generic/tkText.h index 5cd009f..3056ab8 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -364,6 +364,8 @@ typedef struct TkTextTag { * valid if rMarginString is non-NULL. */ Tk_3DBorder selBorder; /* Used for drawing background for selected text. * NULL means no value specified here. */ + XColor *selFgColor; /* Foreground color for selected text. NULL means + * no value specified here. */ char *spacing1String; /* -spacing1 option string (malloc-ed). NULL * means option not specified. */ int spacing1; /* Extra spacing above first display line for diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 1bd5905..e8f8d79 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -798,9 +798,11 @@ GetStyle( for (i = 0 ; i < numTags; i++) { Tk_3DBorder border; + XColor *fgColor; tagPtr = tagPtrs[i]; border = tagPtr->border; + fgColor = tagPtr->fgColor; /* * If this is the selection tag, and inactiveSelBorder is NULL (the @@ -824,6 +826,10 @@ GetStyle( border = tagPtr->selBorder; } + if ((tagPtr->selFgColor != None) && (isSelected)) { + fgColor = tagPtr->selFgColor; + } + if ((border != NULL) && (tagPtr->priority > borderPrio)) { styleValues.border = border; borderPrio = tagPtr->priority; @@ -847,8 +853,8 @@ GetStyle( styleValues.bgStipple = tagPtr->bgStipple; bgStipplePrio = tagPtr->priority; } - if ((tagPtr->fgColor != None) && (tagPtr->priority > fgPrio)) { - styleValues.fgColor = tagPtr->fgColor; + if ((fgColor != None) && (tagPtr->priority > fgPrio)) { + styleValues.fgColor = fgColor; fgPrio = tagPtr->priority; } if ((tagPtr->tkfont != None) && (tagPtr->priority > fontPrio)) { diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index a857cf9..97356ed 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -72,6 +72,8 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, -1, Tk_Offset(TkTextTag, rMarginString), TK_OPTION_NULL_OK, 0,0}, {TK_OPTION_BORDER, "-selectbackground", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0}, + {TK_OPTION_COLOR, "-selectforeground", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, selFgColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-spacing1", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, spacing1String), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-spacing2", NULL, NULL, @@ -493,7 +495,11 @@ TkTextTagCmd( } textPtr->selBorderWidth = tagPtr->borderWidth; textPtr->selBorderWidthPtr = tagPtr->borderWidthPtr; - textPtr->selFgColorPtr = tagPtr->fgColor; + if (tagPtr->selFgColor == NULL) { + textPtr->selFgColorPtr = tagPtr->fgColor; + } else { + textPtr->selFgColorPtr = tagPtr->selFgColor; + } } tagPtr->affectsDisplay = 0; @@ -519,6 +525,7 @@ TkTextTagCmd( || (tagPtr->reliefString != NULL) || (tagPtr->bgStipple != None) || (tagPtr->fgColor != NULL) + || (tagPtr->selFgColor != NULL) || (tagPtr->fgStipple != None) || (tagPtr->overstrikeString != NULL) || (tagPtr->underlineString != NULL)) { @@ -1025,6 +1032,7 @@ TkTextCreateTag( tagPtr->rMarginString = NULL; tagPtr->rMargin = 0; tagPtr->selBorder = NULL; + tagPtr->selFgColor = NULL; tagPtr->spacing1String = NULL; tagPtr->spacing1 = 0; tagPtr->spacing2String = NULL; -- cgit v0.12 From 8ffa9516ef4ea4b1d2bded2bc05999322889a15a Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:29:50 +0000 Subject: -selectforeground tag configuration option: documentation --- doc/text.n | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/text.n b/doc/text.n index 41d6a6f..61808ce 100644 --- a/doc/text.n +++ b/doc/text.n @@ -524,6 +524,13 @@ items. It may have any of the forms accepted by \fBTk_GetColor\fR. If string, then the color specified by the fB\-background\fR tag option is used. .TP +\fB\-selectforeground \fIcolor\fR +\fIcolor\fR specifies the foreground color to use when displaying selected +items. It may have any of the forms accepted by \fBTk_GetColor\fR. If +\fIcolor\fR has not been specified, or if it is specified as an empty +string, then the color specified by the fB\-foreground\fR tag option is +used. +.TP \fB\-spacing1 \fIpixels\fR . \fIPixels\fR specifies how much additional space should be left above each -- cgit v0.12 From 91073e4b5a77eb86aadddb05d9666a89f9b81907 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:30:11 +0000 Subject: -selectforeground tag configuration option: tests --- tests/textTag.test | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/textTag.test b/tests/textTag.test index a7935da..8b5ac74 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -239,6 +239,17 @@ test textTag-1.25b {configuration options} -body { } -cleanup { .t tag configure x -selectbackground [lindex [.t tag configure x -selectbackground] 3] } -returnCodes error -result {unknown color name "non-existent"} +test textTag-1.25c {tag configuration options} -body { + .t tag configure x -selectforeground #012345 + .t tag cget x -selectforeground +} -cleanup { + .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3] +} -result {#012345} +test textTag-1.25d {configuration options} -body { + .t tag configure x -selectforeground non-existent +} -cleanup { + .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3] +} -returnCodes error -result {unknown color name "non-existent"} test textTag-1.26 {tag configuration options} -constraints { haveCourier12 } -body { @@ -747,6 +758,29 @@ test textTag-5.23 {TkTextTagCmd - "configure" option} -body { lappend x [.t cget -selectbackground] return $x } -result {yellow blue red white} +test textTag-5.24 {TkTextTagCmd - "configure" option} -body { + set x {} + # when [.t tag cget sel -selectforeground] == "", mirroring happens between + # the text widget option -selectforeground + # and the tag option -foreground + .t tag configure sel -selectforeground {} + .t configure -selectforeground black + .t tag configure sel -foreground yellow + lappend x [.t cget -selectforeground] + .t tag configure sel -foreground orange + .t configure -selectforeground blue + lappend x [.t tag cget sel -foreground] + # when [.t tag cget sel -selectforeground] != "", mirroring happens between + # the text widget option -selectforeground + # and the tag option -selectforeground + .t tag configure sel -selectforeground green + .t configure -selectforeground red + lappend x [.t tag cget sel -selectforeground] + .t configure -selectforeground black + .t tag configure sel -selectforeground white + lappend x [.t cget -selectforeground] + return $x +} -result {yellow blue red white} test textTag-6.1 {TkTextTagCmd - "delete" option} -constraints { haveCourier12 -- cgit v0.12 From 5d588d31457d24ca04b54f6f1c92647e6a3d2b50 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:32:10 +0000 Subject: -selectbgstipple tag configuration option: implementation --- generic/tkText.c | 1 + generic/tkText.h | 2 ++ generic/tkTextDisp.c | 10 ++++++++-- generic/tkTextTag.c | 4 ++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 464d4d9..7a2a6d5 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2288,6 +2288,7 @@ ConfigureText( || (textPtr->selTagPtr->selBorder != NULL) || (textPtr->selTagPtr->reliefString != NULL) || (textPtr->selTagPtr->bgStipple != None) + || (textPtr->selTagPtr->selBgStipple != None) || (textPtr->selTagPtr->fgColor != NULL) || (textPtr->selTagPtr->selFgColor != NULL) || (textPtr->selTagPtr->fgStipple != None) diff --git a/generic/tkText.h b/generic/tkText.h index 3056ab8..c8a71b3 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -364,6 +364,8 @@ typedef struct TkTextTag { * valid if rMarginString is non-NULL. */ Tk_3DBorder selBorder; /* Used for drawing background for selected text. * NULL means no value specified here. */ + Pixmap selBgStipple; /* Stipple bitmap for background of selected text. + * None means no value specified here. */ XColor *selFgColor; /* Foreground color for selected text. NULL means * no value specified here. */ char *spacing1String; /* -spacing1 option string (malloc-ed). NULL diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index e8f8d79..0ccd3c2 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -798,10 +798,12 @@ GetStyle( for (i = 0 ; i < numTags; i++) { Tk_3DBorder border; + Pixmap bgStipple; XColor *fgColor; tagPtr = tagPtrs[i]; border = tagPtr->border; + bgStipple = tagPtr->bgStipple; fgColor = tagPtr->fgColor; /* @@ -826,6 +828,10 @@ GetStyle( border = tagPtr->selBorder; } + if ((tagPtr->selBgStipple != None) && (isSelected)) { + bgStipple = tagPtr->selBgStipple; + } + if ((tagPtr->selFgColor != None) && (isSelected)) { fgColor = tagPtr->selFgColor; } @@ -848,9 +854,9 @@ GetStyle( styleValues.relief = tagPtr->relief; reliefPrio = tagPtr->priority; } - if ((tagPtr->bgStipple != None) + if ((bgStipple != None) && (tagPtr->priority > bgStipplePrio)) { - styleValues.bgStipple = tagPtr->bgStipple; + styleValues.bgStipple = bgStipple; bgStipplePrio = tagPtr->priority; } if ((fgColor != None) && (tagPtr->priority > fgPrio)) { diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index 97356ed..86a6e77 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -72,6 +72,8 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, -1, Tk_Offset(TkTextTag, rMarginString), TK_OPTION_NULL_OK, 0,0}, {TK_OPTION_BORDER, "-selectbackground", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0}, + {TK_OPTION_BITMAP, "-selectbgstipple", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, selBgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-selectforeground", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, selFgColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-spacing1", NULL, NULL, @@ -524,6 +526,7 @@ TkTextTagCmd( || (tagPtr->selBorder != NULL) || (tagPtr->reliefString != NULL) || (tagPtr->bgStipple != None) + || (tagPtr->selBgStipple != None) || (tagPtr->fgColor != NULL) || (tagPtr->selFgColor != NULL) || (tagPtr->fgStipple != None) @@ -1032,6 +1035,7 @@ TkTextCreateTag( tagPtr->rMarginString = NULL; tagPtr->rMargin = 0; tagPtr->selBorder = NULL; + tagPtr->selBgStipple = None; tagPtr->selFgColor = NULL; tagPtr->spacing1String = NULL; tagPtr->spacing1 = 0; -- cgit v0.12 From 28fda9f36ca5e2e5cb00e56da38cd13e8391f44d Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:32:41 +0000 Subject: -selectbgstipple tag configuration option: documentation --- doc/text.n | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/text.n b/doc/text.n index 61808ce..a8f25c9 100644 --- a/doc/text.n +++ b/doc/text.n @@ -524,6 +524,14 @@ items. It may have any of the forms accepted by \fBTk_GetColor\fR. If string, then the color specified by the fB\-background\fR tag option is used. .TP +\fB\-selectbgstipple \fIbitmap\fR +. +\fIBitmap\fR specifies a bitmap that is used as a stipple pattern for the +selected background. It may have any of the forms accepted by +\fBTk_GetBitmap\fR. If \fIbitmap\fR has not been specified, or if it is +specified as an empty string, then the \fIbitmap\fR specified by +'''-bgstipple''' will be used for the background. +.TP \fB\-selectforeground \fIcolor\fR \fIcolor\fR specifies the foreground color to use when displaying selected items. It may have any of the forms accepted by \fBTk_GetColor\fR. If -- cgit v0.12 From fe236b4cfe544d14e84df23e27d07f7efba752d5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:33:07 +0000 Subject: -selectbgstipple tag configuration option: tests --- tests/textTag.test | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/textTag.test b/tests/textTag.test index 8b5ac74..63081f3 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -240,12 +240,23 @@ test textTag-1.25b {configuration options} -body { .t tag configure x -selectbackground [lindex [.t tag configure x -selectbackground] 3] } -returnCodes error -result {unknown color name "non-existent"} test textTag-1.25c {tag configuration options} -body { + .t tag configure x -selectbgstipple gray50 + .t tag cget x -selectbgstipple +} -cleanup { + .t tag configure x -selectbgstipple [lindex [.t tag configure x -selectbgstipple] 3] +} -result {gray50} +test textTag-1.25d {configuration options} -body { + .t tag configure x -selectbgstipple badStipple +} -cleanup { + .t tag configure x -selectbgstipple [lindex [.t tag configure x -selectbgstipple] 3] +} -returnCodes error -result {bitmap "badStipple" not defined} +test textTag-1.25e {tag configuration options} -body { .t tag configure x -selectforeground #012345 .t tag cget x -selectforeground } -cleanup { .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3] } -result {#012345} -test textTag-1.25d {configuration options} -body { +test textTag-1.25f {configuration options} -body { .t tag configure x -selectforeground non-existent } -cleanup { .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3] -- cgit v0.12 From da061a037670e4bc29f960a349403aac50cd915c Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:36:19 +0000 Subject: -selectfgstipple tag configuration option: implementation --- generic/tkText.c | 1 + generic/tkText.h | 3 +++ generic/tkTextDisp.c | 10 ++++++++-- generic/tkTextTag.c | 4 ++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 7a2a6d5..ccc9691 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2292,6 +2292,7 @@ ConfigureText( || (textPtr->selTagPtr->fgColor != NULL) || (textPtr->selTagPtr->selFgColor != NULL) || (textPtr->selTagPtr->fgStipple != None) + || (textPtr->selTagPtr->selFgStipple != None) || (textPtr->selTagPtr->overstrikeString != NULL) || (textPtr->selTagPtr->underlineString != NULL)) { textPtr->selTagPtr->affectsDisplay = 1; diff --git a/generic/tkText.h b/generic/tkText.h index c8a71b3..1a7d986 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -368,6 +368,9 @@ typedef struct TkTextTag { * None means no value specified here. */ XColor *selFgColor; /* Foreground color for selected text. NULL means * no value specified here. */ + Pixmap selFgStipple; /* Stipple bitmap for text and other + * foreground stuff when selected. None means + * no value specified here.*/ char *spacing1String; /* -spacing1 option string (malloc-ed). NULL * means option not specified. */ int spacing1; /* Extra spacing above first display line for diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 0ccd3c2..d0c1483 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -800,11 +800,13 @@ GetStyle( Tk_3DBorder border; Pixmap bgStipple; XColor *fgColor; + Pixmap fgStipple; tagPtr = tagPtrs[i]; border = tagPtr->border; bgStipple = tagPtr->bgStipple; fgColor = tagPtr->fgColor; + fgStipple = tagPtr->fgStipple; /* * If this is the selection tag, and inactiveSelBorder is NULL (the @@ -836,6 +838,10 @@ GetStyle( fgColor = tagPtr->selFgColor; } + if ((tagPtr->selFgStipple != None) && (isSelected)) { + bgStipple = tagPtr->selFgStipple; + } + if ((border != NULL) && (tagPtr->priority > borderPrio)) { styleValues.border = border; borderPrio = tagPtr->priority; @@ -867,9 +873,9 @@ GetStyle( styleValues.tkfont = tagPtr->tkfont; fontPrio = tagPtr->priority; } - if ((tagPtr->fgStipple != None) + if ((fgStipple != None) && (tagPtr->priority > fgStipplePrio)) { - styleValues.fgStipple = tagPtr->fgStipple; + styleValues.fgStipple = fgStipple; fgStipplePrio = tagPtr->priority; } if ((tagPtr->justifyString != NULL) diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index 86a6e77..bb512e4 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -74,6 +74,8 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, -1, Tk_Offset(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BITMAP, "-selectbgstipple", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, selBgStipple), TK_OPTION_NULL_OK, 0, 0}, + {TK_OPTION_BITMAP, "-selectfgstipple", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, selFgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-selectforeground", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, selFgColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-spacing1", NULL, NULL, @@ -530,6 +532,7 @@ TkTextTagCmd( || (tagPtr->fgColor != NULL) || (tagPtr->selFgColor != NULL) || (tagPtr->fgStipple != None) + || (tagPtr->selFgStipple != None) || (tagPtr->overstrikeString != NULL) || (tagPtr->underlineString != NULL)) { tagPtr->affectsDisplay = 1; @@ -1037,6 +1040,7 @@ TkTextCreateTag( tagPtr->selBorder = NULL; tagPtr->selBgStipple = None; tagPtr->selFgColor = NULL; + tagPtr->selFgStipple = None; tagPtr->spacing1String = NULL; tagPtr->spacing1 = 0; tagPtr->spacing2String = NULL; -- cgit v0.12 From 196fc0f4ea980dfeed790a1c2f5e4cae7077c0b4 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:36:41 +0000 Subject: -selectfgstipple tag configuration option: documentation (+ polished doc of the previously developed new tag options) --- doc/text.n | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/doc/text.n b/doc/text.n index a8f25c9..0216e5c 100644 --- a/doc/text.n +++ b/doc/text.n @@ -518,10 +518,10 @@ margin for each line on the display is determined by the first non-elided character of that display line. .TP \fB\-selectbackground \fIcolor\fR -\fIcolor\fR specifies the background color to use when displaying selected +\fIColor\fR specifies the background color to use when displaying selected items. It may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty -string, then the color specified by the fB\-background\fR tag option is +string, then the color specified by the \fB\-background\fR tag option is used. .TP \fB\-selectbgstipple \fIbitmap\fR @@ -529,14 +529,22 @@ used. \fIBitmap\fR specifies a bitmap that is used as a stipple pattern for the selected background. It may have any of the forms accepted by \fBTk_GetBitmap\fR. If \fIbitmap\fR has not been specified, or if it is -specified as an empty string, then the \fIbitmap\fR specified by -'''-bgstipple''' will be used for the background. +specified as an empty string, then the bitmap specified by +\fB\-bgstipple\fR will be used for the background. +.TP +\fB\-selectfgstipple \fIbitmap\fR +. +\fIBitmap\fR specifies a bitmap that is used as a stipple pattern when drawing +selected text and other foreground information such as underlines. It may have any of +the forms accepted by \fBTk_GetBitmap\fR. If \fIbitmap\fR has not been +specified, or if it is specified as an empty string, then the bitmap specified by +\fB\-fgstipple\fR will be used. .TP \fB\-selectforeground \fIcolor\fR -\fIcolor\fR specifies the foreground color to use when displaying selected +\fIColor\fR specifies the foreground color to use when displaying selected items. It may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty -string, then the color specified by the fB\-foreground\fR tag option is +string, then the color specified by the \fB\-foreground\fR tag option is used. .TP \fB\-spacing1 \fIpixels\fR -- cgit v0.12 From e108f0116e3154bacd641f8f85529512a2b9046f Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:37:33 +0000 Subject: -selectfgstipple tag configuration option: tests --- tests/textTag.test | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/textTag.test b/tests/textTag.test index 63081f3..ede86fd 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -251,12 +251,23 @@ test textTag-1.25d {configuration options} -body { .t tag configure x -selectbgstipple [lindex [.t tag configure x -selectbgstipple] 3] } -returnCodes error -result {bitmap "badStipple" not defined} test textTag-1.25e {tag configuration options} -body { + .t tag configure x -selectfgstipple gray50 + .t tag cget x -selectfgstipple +} -cleanup { + .t tag configure x -selectfgstipple [lindex [.t tag configure x -selectfgstipple] 3] +} -result {gray50} +test textTag-1.25f {configuration options} -body { + .t tag configure x -selectfgstipple badStipple +} -cleanup { + .t tag configure x -selectfgstipple [lindex [.t tag configure x -selectfgstipple] 3] +} -returnCodes error -result {bitmap "badStipple" not defined} +test textTag-1.25g {tag configuration options} -body { .t tag configure x -selectforeground #012345 .t tag cget x -selectforeground } -cleanup { .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3] } -result {#012345} -test textTag-1.25f {configuration options} -body { +test textTag-1.25h {configuration options} -body { .t tag configure x -selectforeground non-existent } -cleanup { .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3] -- cgit v0.12 From 62609c21da13af24e1df10132bdb5effc1d3ea7a Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:40:51 +0000 Subject: -underlinefg tag configuration option: implementation --- generic/tkText.c | 3 ++- generic/tkText.h | 4 +++- generic/tkTextDisp.c | 19 +++++++++++++++++-- generic/tkTextTag.c | 6 +++++- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index ccc9691..7010601 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2294,7 +2294,8 @@ ConfigureText( || (textPtr->selTagPtr->fgStipple != None) || (textPtr->selTagPtr->selFgStipple != None) || (textPtr->selTagPtr->overstrikeString != NULL) - || (textPtr->selTagPtr->underlineString != NULL)) { + || (textPtr->selTagPtr->underlineString != NULL) + || (textPtr->selTagPtr->underlineColor != NULL)) { textPtr->selTagPtr->affectsDisplay = 1; } TkTextRedrawTag(NULL, textPtr, NULL, NULL, textPtr->selTagPtr, 1); diff --git a/generic/tkText.h b/generic/tkText.h index 1a7d986..815841c 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -398,7 +398,9 @@ typedef struct TkTextTag { int underline; /* Non-zero means draw underline underneath * text. Only valid if underlineString is * non-NULL. */ - TkWrapMode wrapMode; /* How to handle wrap-around for this tag. + XColor *underlineColor; /* Color for the underline. NULL means same + * color as foreground. */ + TkWrapMode wrapMode; /* How to hsandle wrap-around for this tag. * Must be TEXT_WRAPMODE_CHAR, * TEXT_WRAPMODE_NONE, TEXT_WRAPMODE_WORD, or * TEXT_WRAPMODE_NULL to use wrapmode for diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index d0c1483..f246818 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -149,6 +149,8 @@ typedef struct StyleValues { int tabStyle; /* One of TABULAR or WORDPROCESSOR. */ int underline; /* Non-zero means draw underline underneath * text. */ + XColor *underlineColor; /* Foreground color for underline underneath + * text. */ int elide; /* Zero means draw text, otherwise not. */ TkWrapMode wrapMode; /* How to handle wrap-around for this tag. * One of TEXT_WRAPMODE_CHAR, @@ -166,6 +168,7 @@ typedef struct TextStyle { * referenced in Chunks. */ GC bgGC; /* Graphics context for background. None means * use widget background. */ + GC ulGC; /* Graphics context for underline. */ GC fgGC; /* Graphics context for foreground. */ StyleValues *sValuePtr; /* Raw information from which GCs were * derived. */ @@ -778,6 +781,7 @@ GetStyle( memset(&styleValues, 0, sizeof(StyleValues)); styleValues.relief = TK_RELIEF_FLAT; styleValues.fgColor = textPtr->fgColor; + styleValues.underlineColor = textPtr->fgColor; styleValues.tkfont = textPtr->tkfont; styleValues.justify = TK_JUSTIFY_LEFT; styleValues.spacing1 = textPtr->spacing1; @@ -937,6 +941,11 @@ GetStyle( && (tagPtr->priority > underlinePrio)) { styleValues.underline = tagPtr->underline; underlinePrio = tagPtr->priority; + if (tagPtr->underlineColor != None) { + styleValues.underlineColor = tagPtr->underlineColor; + } else if (fgColor != None) { + styleValues.underlineColor = fgColor; + } } if ((tagPtr->elideString != NULL) && (tagPtr->priority > elidePrio)) { @@ -993,6 +1002,9 @@ GetStyle( mask |= GCStipple|GCFillStyle; } stylePtr->fgGC = Tk_GetGC(textPtr->tkwin, mask, &gcValues); + mask = GCForeground; + gcValues.foreground = styleValues.underlineColor->pixel; + stylePtr->ulGC = Tk_GetGC(textPtr->tkwin, mask, &gcValues); stylePtr->sValuePtr = (StyleValues *) Tcl_GetHashKey(&textPtr->dInfoPtr->styleTable, hPtr); stylePtr->hPtr = hPtr; @@ -1033,6 +1045,9 @@ FreeStyle( if (stylePtr->fgGC != None) { Tk_FreeGC(textPtr->display, stylePtr->fgGC); } + if (stylePtr->ulGC != None) { + Tk_FreeGC(textPtr->display, stylePtr->ulGC); + } Tcl_DeleteHashEntry(stylePtr->hPtr); ckfree(stylePtr); } @@ -7876,7 +7891,7 @@ CharDisplayProc( y + baseline - sValuePtr->offset); if (sValuePtr->underline) { - TkUnderlineCharsInContext(display, dst, stylePtr->fgGC, + TkUnderlineCharsInContext(display, dst, stylePtr->ulGC, sValuePtr->tkfont, string, numBytes, ciPtr->baseChunkPtr->x + xDisplacement, y + baseline - sValuePtr->offset, @@ -7903,7 +7918,7 @@ CharDisplayProc( Tk_DrawChars(display, dst, stylePtr->fgGC, sValuePtr->tkfont, string, numBytes, offsetX, y + baseline - sValuePtr->offset); if (sValuePtr->underline) { - Tk_UnderlineChars(display, dst, stylePtr->fgGC, sValuePtr->tkfont, + Tk_UnderlineChars(display, dst, stylePtr->ulGC, sValuePtr->tkfont, string, offsetX, y + baseline - sValuePtr->offset, 0, numBytes); diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index bb512e4..ed0ef98 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -92,6 +92,8 @@ static const Tk_OptionSpec tagOptionSpecs[] = { {TK_OPTION_STRING, "-underline", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, underlineString), TK_OPTION_NULL_OK, 0, 0}, + {TK_OPTION_COLOR, "-underlinefg", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, underlineColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-wrap", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, wrapMode), TK_OPTION_NULL_OK, wrapStrings, 0}, @@ -534,7 +536,8 @@ TkTextTagCmd( || (tagPtr->fgStipple != None) || (tagPtr->selFgStipple != None) || (tagPtr->overstrikeString != NULL) - || (tagPtr->underlineString != NULL)) { + || (tagPtr->underlineString != NULL) + || (tagPtr->underlineColor != NULL)) { tagPtr->affectsDisplay = 1; } if (!newTag) { @@ -1052,6 +1055,7 @@ TkTextCreateTag( tagPtr->tabStyle = TK_TEXT_TABSTYLE_NONE; tagPtr->underlineString = NULL; tagPtr->underline = 0; + tagPtr->underlineColor = NULL; tagPtr->elideString = NULL; tagPtr->elide = 0; tagPtr->wrapMode = TEXT_WRAPMODE_NULL; -- cgit v0.12 From ecdc7dbb08227389f593c55a3b769a4e1ec9c8aa Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:41:37 +0000 Subject: -underlinefg tag configuration option: documentation --- doc/text.n | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/text.n b/doc/text.n index 0216e5c..e88728c 100644 --- a/doc/text.n +++ b/doc/text.n @@ -589,6 +589,14 @@ unspecified for the tag (the default). \fIBoolean\fR specifies whether or not to draw an underline underneath characters. It may have any of the forms accepted by \fBTcl_GetBoolean\fR. .TP +.TP +\fB\-underlinefg \fIcolor\fR +. +\fIColor\fR specifies the color to use when displaying the underline. It may +have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not +been specified, or if it is specified as an empty string, then the color +specified by the \fB\-foreground\fR tag option is used. +.TP \fB\-wrap \fImode\fR . \fIMode\fR specifies how to handle lines that are wider than the text's -- cgit v0.12 From 797f245ca2d4aafd6a0f7ad853cccd32a7942171 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:42:17 +0000 Subject: -underlinefg tag configuration option: tests --- tests/textTag.test | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/textTag.test b/tests/textTag.test index ede86fd..ae71a48 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -347,6 +347,17 @@ test textTag-1.35 {configuration options} -constraints { } -cleanup { .t tag configure x -underline [lindex [.t tag configure x -underline] 3] } -returnCodes error -result {expected boolean value but got "stupid"} +test textTag-1.36 {tag configuration options} -body { + .t tag configure x -underlinefg red + .t tag cget x -underlinefg +} -cleanup { + .t tag configure x -underlinefg [lindex [.t tag configure x -underlinefg] 3] +} -result {red} +test textTag-1.37 {configuration options} -body { + .t tag configure x -underlinefg stupid +} -cleanup { + .t tag configure x -underlinefg [lindex [.t tag configure x -underlinefg] 3] +} -returnCodes error -result {unknown color name "stupid"} test textTag-2.1 {TkTextTagCmd - "add" option} -constraints { @@ -603,6 +614,13 @@ test textTag-5.4 {TkTextTagCmd - "configure" option} -constraints { } -cleanup { .t tag delete x } -result {-underline {} {} {} yes} +test textTag-5.4a {TkTextTagCmd - "configure" option} -body { + .t tag delete x + .t tag configure x -underlinefg lightgreen + .t tag configure x -underlinefg +} -cleanup { + .t tag delete x +} -result {-underlinefg {} {} {} lightgreen} test textTag-5.5 {TkTextTagCmd - "configure" option} -constraints { haveCourier12 } -body { -- cgit v0.12 From 7c5f4b62829c4efa7ee754d566c45a0be0ace440 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:44:23 +0000 Subject: -overstrikefg tag configuration option: implementation --- generic/tkText.c | 1 + generic/tkText.h | 2 ++ generic/tkTextDisp.c | 20 +++++++++++++++++--- generic/tkTextTag.c | 8 +++++++- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 7010601..19dce65 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2294,6 +2294,7 @@ ConfigureText( || (textPtr->selTagPtr->fgStipple != None) || (textPtr->selTagPtr->selFgStipple != None) || (textPtr->selTagPtr->overstrikeString != NULL) + || (textPtr->selTagPtr->overstrikeColor != NULL) || (textPtr->selTagPtr->underlineString != NULL) || (textPtr->selTagPtr->underlineColor != NULL)) { textPtr->selTagPtr->affectsDisplay = 1; diff --git a/generic/tkText.h b/generic/tkText.h index 815841c..242785a 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -358,6 +358,8 @@ typedef struct TkTextTag { int overstrike; /* Non-zero means draw horizontal line through * middle of text. Only valid if * overstrikeString is non-NULL. */ + XColor *overstrikeColor; /* Color for the overstrike. NULL means same + * color as foreground. */ char *rMarginString; /* -rmargin option string (malloc-ed). NULL * means option not specified. */ int rMargin; /* Right margin for text, in pixels. Only diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index f246818..b74c6db 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -140,6 +140,8 @@ typedef struct StyleValues { * baseline of line. */ int overstrike; /* Non-zero means draw overstrike through * text. */ + XColor *overstrikeColor; /* Foreground color for overstrike through + * text. */ int rMargin; /* Right margin, in pixels. */ int spacing1; /* Spacing above first dline in text line. */ int spacing2; /* Spacing between lines of dline. */ @@ -168,8 +170,9 @@ typedef struct TextStyle { * referenced in Chunks. */ GC bgGC; /* Graphics context for background. None means * use widget background. */ - GC ulGC; /* Graphics context for underline. */ GC fgGC; /* Graphics context for foreground. */ + GC ulGC; /* Graphics context for underline. */ + GC ovGC; /* Graphics context for overstrike. */ StyleValues *sValuePtr; /* Raw information from which GCs were * derived. */ Tcl_HashEntry *hPtr; /* Pointer to entry in styleTable. Used to @@ -782,6 +785,7 @@ GetStyle( styleValues.relief = TK_RELIEF_FLAT; styleValues.fgColor = textPtr->fgColor; styleValues.underlineColor = textPtr->fgColor; + styleValues.overstrikeColor = textPtr->fgColor; styleValues.tkfont = textPtr->tkfont; styleValues.justify = TK_JUSTIFY_LEFT; styleValues.spacing1 = textPtr->spacing1; @@ -906,6 +910,11 @@ GetStyle( && (tagPtr->priority > overstrikePrio)) { styleValues.overstrike = tagPtr->overstrike; overstrikePrio = tagPtr->priority; + if (tagPtr->overstrikeColor != None) { + styleValues.overstrikeColor = tagPtr->overstrikeColor; + } else if (fgColor != None) { + styleValues.overstrikeColor = fgColor; + } } if ((tagPtr->rMarginString != NULL) && (tagPtr->priority > rMarginPrio)) { @@ -1005,6 +1014,8 @@ GetStyle( mask = GCForeground; gcValues.foreground = styleValues.underlineColor->pixel; stylePtr->ulGC = Tk_GetGC(textPtr->tkwin, mask, &gcValues); + gcValues.foreground = styleValues.overstrikeColor->pixel; + stylePtr->ovGC = Tk_GetGC(textPtr->tkwin, mask, &gcValues); stylePtr->sValuePtr = (StyleValues *) Tcl_GetHashKey(&textPtr->dInfoPtr->styleTable, hPtr); stylePtr->hPtr = hPtr; @@ -1048,6 +1059,9 @@ FreeStyle( if (stylePtr->ulGC != None) { Tk_FreeGC(textPtr->display, stylePtr->ulGC); } + if (stylePtr->ovGC != None) { + Tk_FreeGC(textPtr->display, stylePtr->ovGC); + } Tcl_DeleteHashEntry(stylePtr->hPtr); ckfree(stylePtr); } @@ -7901,7 +7915,7 @@ CharDisplayProc( Tk_FontMetrics fm; Tk_GetFontMetrics(sValuePtr->tkfont, &fm); - TkUnderlineCharsInContext(display, dst, stylePtr->fgGC, + TkUnderlineCharsInContext(display, dst, stylePtr->ovGC, sValuePtr->tkfont, string, numBytes, ciPtr->baseChunkPtr->x + xDisplacement, y + baseline - sValuePtr->offset @@ -7928,7 +7942,7 @@ CharDisplayProc( Tk_FontMetrics fm; Tk_GetFontMetrics(sValuePtr->tkfont, &fm); - Tk_UnderlineChars(display, dst, stylePtr->fgGC, sValuePtr->tkfont, + Tk_UnderlineChars(display, dst, stylePtr->ovGC, sValuePtr->tkfont, string, offsetX, y + baseline - sValuePtr->offset - fm.descent - (fm.ascent * 3) / 10, diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index ed0ef98..e268352 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -66,6 +66,9 @@ static const Tk_OptionSpec tagOptionSpecs[] = { {TK_OPTION_STRING, "-overstrike", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, overstrikeString), TK_OPTION_NULL_OK, 0, 0}, + {TK_OPTION_COLOR, "-overstrikefg", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, overstrikeColor), + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-relief", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, reliefString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-rmargin", NULL, NULL, @@ -93,7 +96,8 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, -1, Tk_Offset(TkTextTag, underlineString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-underlinefg", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, underlineColor), TK_OPTION_NULL_OK, 0, 0}, + NULL, -1, Tk_Offset(TkTextTag, underlineColor), + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-wrap", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, wrapMode), TK_OPTION_NULL_OK, wrapStrings, 0}, @@ -536,6 +540,7 @@ TkTextTagCmd( || (tagPtr->fgStipple != None) || (tagPtr->selFgStipple != None) || (tagPtr->overstrikeString != NULL) + || (tagPtr->overstrikeColor != NULL) || (tagPtr->underlineString != NULL) || (tagPtr->underlineColor != NULL)) { tagPtr->affectsDisplay = 1; @@ -1038,6 +1043,7 @@ TkTextCreateTag( tagPtr->offset = 0; tagPtr->overstrikeString = NULL; tagPtr->overstrike = 0; + tagPtr->overstrikeColor = NULL; tagPtr->rMarginString = NULL; tagPtr->rMargin = 0; tagPtr->selBorder = NULL; -- cgit v0.12 From 935d5f2814f55a18088b4ce4a3cfc6cb76fa86df Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:44:48 +0000 Subject: -overstrikefg tag configuration option: documentation --- doc/text.n | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/text.n b/doc/text.n index e88728c..fd18a59 100644 --- a/doc/text.n +++ b/doc/text.n @@ -500,6 +500,13 @@ Specifies whether or not to draw a horizontal rule through the middle of characters. \fIBoolean\fR may have any of the forms accepted by \fBTcl_GetBoolean\fR. .TP +\fB\-overstrikefg \fIcolor\fR +. +\fIColor\fR specifies the color to use when displaying the overstrike. It may +have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not +been specified, or if it is specified as an empty string, then the color +specified by the \fB\-foreground\fR tag option is used. +.TP \fB\-relief \fIrelief\fR . \fIRelief\fR specifies the relief style to use for drawing the border, in any @@ -589,7 +596,6 @@ unspecified for the tag (the default). \fIBoolean\fR specifies whether or not to draw an underline underneath characters. It may have any of the forms accepted by \fBTcl_GetBoolean\fR. .TP -.TP \fB\-underlinefg \fIcolor\fR . \fIColor\fR specifies the color to use when displaying the underline. It may -- cgit v0.12 From 74d865bb3e520e131dc6655986fe79141120c2e9 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 9 Feb 2016 21:45:19 +0000 Subject: -overstrikefg tag configuration option: tests --- tests/textTag.test | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/textTag.test b/tests/textTag.test index ae71a48..c2feaa7 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -198,6 +198,17 @@ test textTag-1.21 {configuration options} -constraints { } -cleanup { .t tag configure x -overstrike [lindex [.t tag configure x -overstrike] 3] } -returnCodes error -result {expected boolean value but got "stupid"} +test textTag-1.21a {tag configuration options} -body { + .t tag configure x -overstrikefg red + .t tag cget x -overstrikefg +} -cleanup { + .t tag configure x -overstrikefg [lindex [.t tag configure x -overstrikefg] 3] +} -result {red} +test textTag-1.21b {configuration options} -body { + .t tag configure x -overstrikefg stupid +} -cleanup { + .t tag configure x -overstrikefg [lindex [.t tag configure x -overstrikefg] 3] +} -returnCodes error -result {unknown color name "stupid"} test textTag-1.22 {tag configuration options} -constraints { haveCourier12 } -body { @@ -630,6 +641,13 @@ test textTag-5.5 {TkTextTagCmd - "configure" option} -constraints { } -cleanup { .t tag delete x } -result {on} +test textTag-5.5a {TkTextTagCmd - "configure" option} -body { + .t tag delete x + .t tag configure x -overstrikefg lightgreen + .t tag configure x -overstrikefg +} -cleanup { + .t tag delete x +} -result {-overstrikefg {} {} {} lightgreen} test textTag-5.6 {TkTextTagCmd - "configure" option} -constraints { haveCourier12 } -body { -- cgit v0.12 From 30a85a7ace1cf7ea9de7828dfb84fde2af23148b Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 10 Feb 2016 22:51:45 +0000 Subject: -lmargincolor tag configuration option: implementation --- generic/tkText.c | 3 ++- generic/tkText.h | 3 +++ generic/tkTextDisp.c | 26 ++++++++++++++++++++++++++ generic/tkTextTag.c | 6 +++++- 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 19dce65..415e0bc 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2296,7 +2296,8 @@ ConfigureText( || (textPtr->selTagPtr->overstrikeString != NULL) || (textPtr->selTagPtr->overstrikeColor != NULL) || (textPtr->selTagPtr->underlineString != NULL) - || (textPtr->selTagPtr->underlineColor != NULL)) { + || (textPtr->selTagPtr->underlineColor != NULL) + || (textPtr->selTagPtr->lMarginColor != NULL)) { textPtr->selTagPtr->affectsDisplay = 1; } TkTextRedrawTag(NULL, textPtr, NULL, NULL, textPtr->selTagPtr, 1); diff --git a/generic/tkText.h b/generic/tkText.h index 242785a..22df370 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -347,6 +347,9 @@ typedef struct TkTextTag { int lMargin2; /* Left margin for second and later display * lines of each text line, in pixels. Only * valid if lMargin2String is non-NULL. */ + Tk_3DBorder lMarginColor; /* Used for drawing background in left margins. + * This is used for both lmargin1 and lmargin2. + * NULL means no value specified here. */ char *offsetString; /* -offset option string (malloc-ed). NULL * means option not specified. */ int offset; /* Vertical offset of text's baseline from diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index b74c6db..c0d6384 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -136,6 +136,7 @@ typedef struct StyleValues { * line of each text line. */ int lMargin2; /* Left margin, in pixels, for second and * later display lines of each text line. */ + Tk_3DBorder lMarginColor; /* Color of left margins (1 and 2). */ int offset; /* Offset in pixels of baseline, relative to * baseline of line. */ int overstrike; /* Non-zero means draw overstrike through @@ -240,6 +241,10 @@ typedef struct DLine { int spaceBelow; /* How much extra space was added to the * bottom of the line because of spacing * options. This is included in height. */ + Tk_3DBorder lMarginColor; /* Background color of the area corresponding + * to the left margin of the display line. */ + int lMarginWidth; /* Pixel width of the area corresponding to + * the left margin. */ int length; /* Total length of line, in pixels. */ TkTextDispChunk *chunkPtr; /* Pointer to first chunk in list of all of * those that are displayed on this line of @@ -765,6 +770,7 @@ GetStyle( int fgPrio, fontPrio, fgStipplePrio; int underlinePrio, elidePrio, justifyPrio, offsetPrio; int lMargin1Prio, lMargin2Prio, rMarginPrio; + int lMarginColorPrio; int spacing1Prio, spacing2Prio, spacing3Prio; int overstrikePrio, tabPrio, tabStylePrio, wrapPrio; @@ -779,6 +785,7 @@ GetStyle( fgPrio = fontPrio = fgStipplePrio = -1; underlinePrio = elidePrio = justifyPrio = offsetPrio = -1; lMargin1Prio = lMargin2Prio = rMarginPrio = -1; + lMarginColorPrio = -1; spacing1Prio = spacing2Prio = spacing3Prio = -1; overstrikePrio = tabPrio = tabStylePrio = wrapPrio = -1; memset(&styleValues, 0, sizeof(StyleValues)); @@ -901,6 +908,11 @@ GetStyle( styleValues.lMargin2 = tagPtr->lMargin2; lMargin2Prio = tagPtr->priority; } + if ((tagPtr->lMarginColor != NULL) + && (tagPtr->priority > lMarginColorPrio)) { + styleValues.lMarginColor = tagPtr->lMarginColor; + lMarginColorPrio = tagPtr->priority; + } if ((tagPtr->offsetString != NULL) && (tagPtr->priority > offsetPrio)) { styleValues.offset = tagPtr->offset; @@ -1173,6 +1185,8 @@ LayoutDLine( dlPtr->nextPtr = NULL; dlPtr->flags = NEW_LAYOUT | OLD_Y_INVALID; dlPtr->logicalLinesMerged = 0; + dlPtr->lMarginColor = NULL; + dlPtr->lMarginWidth = 0; /* * This is not necessarily totally correct, where we have merged logical @@ -1447,6 +1461,7 @@ LayoutDLine( x = chunkPtr->stylePtr->sValuePtr->lMargin2; } + dlPtr->lMarginWidth = x; if (wrapMode == TEXT_WRAPMODE_NONE) { maxX = -1; } else { @@ -1758,6 +1773,7 @@ LayoutDLine( } dlPtr->height += dlPtr->spaceAbove + dlPtr->spaceBelow; dlPtr->baseline += dlPtr->spaceAbove; + dlPtr->lMarginColor = sValuePtr->lMarginColor; /* * Recompute line length: may have changed because of justification. @@ -2444,6 +2460,16 @@ DisplayDLine( Tk_Width(textPtr->tkwin), dlPtr->height, 0, TK_RELIEF_FLAT); /* + * Second, draw the background color of the left margin. + */ + if (dlPtr->lMarginColor != NULL) { + int x = dlPtr->lMarginWidth + dInfoPtr->x - dInfoPtr->curXPixelOffset; + + Tk_Fill3DRectangle(textPtr->tkwin, pixmap, dlPtr->lMarginColor, 0, y, + (x>0?x:0), dlPtr->height, 0, TK_RELIEF_FLAT); + } + + /* * Next, draw background information for the whole line. */ diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index e268352..a3e55fc 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -61,6 +61,8 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, -1, Tk_Offset(TkTextTag, lMargin1String), TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-lmargin2", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, lMargin2String), TK_OPTION_NULL_OK,0,0}, + {TK_OPTION_BORDER, "-lmargincolor", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, lMarginColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-offset", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, offsetString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-overstrike", NULL, NULL, @@ -542,7 +544,8 @@ TkTextTagCmd( || (tagPtr->overstrikeString != NULL) || (tagPtr->overstrikeColor != NULL) || (tagPtr->underlineString != NULL) - || (tagPtr->underlineColor != NULL)) { + || (tagPtr->underlineColor != NULL) + || (tagPtr->lMarginColor != NULL)) { tagPtr->affectsDisplay = 1; } if (!newTag) { @@ -1039,6 +1042,7 @@ TkTextCreateTag( tagPtr->lMargin1 = 0; tagPtr->lMargin2String = NULL; tagPtr->lMargin2 = 0; + tagPtr->lMarginColor = NULL; tagPtr->offsetString = NULL; tagPtr->offset = 0; tagPtr->overstrikeString = NULL; -- cgit v0.12 From 3c2928472dcfca0f3053ad349df8b64e98a6923c Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 10 Feb 2016 22:52:15 +0000 Subject: -lmargincolor tag configuration option: documentation --- doc/text.n | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/text.n b/doc/text.n index fd18a59..1e6dbc2 100644 --- a/doc/text.n +++ b/doc/text.n @@ -486,6 +486,15 @@ much the line should be indented from the left edge of the window. option is only used when wrapping is enabled, and it only applies to the second and later display lines for a text line. .TP +\fB\-lmargincolor \fIcolor\fR +. +\fIColor\fR specifies the background color to use in regions that do not +contain characters because they are indented by \fB\-lmargin1\fR or +\fB\-lmargin2\fR. It may have any of the forms accepted by +\fBTk_GetColor\fR.If \fIcolor\fR has not been specified, or if it is +specified as an empty string, then the color specified by the +\fB-background\fR widget option is used. +.TP \fB\-offset \fIpixels\fR . \fIPixels\fR specifies an amount by which the text's baseline should be offset -- cgit v0.12 From 47cbb49b5a939e1af93b945c53daa3177d9aeef0 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 10 Feb 2016 22:52:33 +0000 Subject: -lmargincolor tag configuration option: tests --- tests/textTag.test | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/textTag.test b/tests/textTag.test index c2feaa7..9e0cf38 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -168,6 +168,17 @@ test textTag-1.17 {configuration options} -constraints { } -cleanup { .t tag configure x -lmargin2 [lindex [.t tag configure x -lmargin2] 3] } -returnCodes error -result {bad screen distance "bad"} +test textTag-1.17a {tag configuration options} -body { + .t tag configure x -lmargincolor lightgreen + .t tag cget x -lmargincolor +} -cleanup { + .t tag configure x -lmargincolor [lindex [.t tag configure x -lmargincolor] 3] +} -result {lightgreen} +test textTag-1.17b {configuration options} -body { + .t tag configure x -lmargincolor non-existent +} -cleanup { + .t tag configure x -lmargincolor [lindex [.t tag configure x -lmargincolor] 3] +} -returnCodes error -result {unknown color name "non-existent"} test textTag-1.18 {tag configuration options} -constraints { haveCourier12 } -body { @@ -705,16 +716,15 @@ test textTag-5.12 {TkTextTagCmd - "configure" option} -constraints { } -cleanup { .t tag delete x } -returnCodes error -result {bad screen distance "1.0q"} -test textTag-5.13 {TkTextTagCmd - "configure" option} -constraints { - haveCourier12 -} -body { +test textTag-5.13 {TkTextTagCmd - "configure" option} -body { .t tag delete x - .t tag configure x -lmargin1 2 -lmargin2 4 -rmargin 5 + .t tag configure x -lmargin1 2 -lmargin2 4 -rmargin 5 \ + -lmargincolor darkblue list [.t tag configure x -lmargin1] [.t tag configure x -lmargin2] \ - [.t tag configure x -rmargin] + [.t tag configure x -rmargin] [.t tag configure x -lmargincolor] } -cleanup { .t tag delete x -} -result {{-lmargin1 {} {} {} 2} {-lmargin2 {} {} {} 4} {-rmargin {} {} {} 5}} +} -result {{-lmargin1 {} {} {} 2} {-lmargin2 {} {} {} 4} {-rmargin {} {} {} 5} {-lmargincolor {} {} {} darkblue}} test textTag-5.14 {TkTextTagCmd - "configure" option} -constraints { haveCourier12 } -body { @@ -731,6 +741,12 @@ test textTag-5.15 {TkTextTagCmd - "configure" option} -constraints { } -cleanup { .t tag delete x } -returnCodes error -result {bad screen distance "gorp"} +test textTag-5.15a {TkTextTagCmd - "configure" option} -body { + .t tag delete x + .t tag configure x -lmargincolor rainbow +} -cleanup { + .t tag delete x +} -returnCodes error -result {unknown color name "rainbow"} test textTag-5.16 {TkTextTagCmd - "configure" option} -constraints { haveCourier12 } -body { -- cgit v0.12 From 3cea177e222e8c8b59cfcd693faa3581340d2c3d Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 10 Feb 2016 22:53:30 +0000 Subject: -rmargincolor tag configuration option: implementation --- generic/tkText.c | 3 ++- generic/tkText.h | 2 ++ generic/tkTextDisp.c | 29 +++++++++++++++++++++++++---- generic/tkTextTag.c | 6 +++++- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/generic/tkText.c b/generic/tkText.c index 415e0bc..0de648a 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2297,7 +2297,8 @@ ConfigureText( || (textPtr->selTagPtr->overstrikeColor != NULL) || (textPtr->selTagPtr->underlineString != NULL) || (textPtr->selTagPtr->underlineColor != NULL) - || (textPtr->selTagPtr->lMarginColor != NULL)) { + || (textPtr->selTagPtr->lMarginColor != NULL) + || (textPtr->selTagPtr->rMarginColor != NULL)) { textPtr->selTagPtr->affectsDisplay = 1; } TkTextRedrawTag(NULL, textPtr, NULL, NULL, textPtr->selTagPtr, 1); diff --git a/generic/tkText.h b/generic/tkText.h index 22df370..8fab200 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -367,6 +367,8 @@ typedef struct TkTextTag { * means option not specified. */ int rMargin; /* Right margin for text, in pixels. Only * valid if rMarginString is non-NULL. */ + Tk_3DBorder rMarginColor; /* Used for drawing background in right margin. + * NULL means no value specified here. */ Tk_3DBorder selBorder; /* Used for drawing background for selected text. * NULL means no value specified here. */ Pixmap selBgStipple; /* Stipple bitmap for background of selected text. diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index c0d6384..c0dc017 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -144,6 +144,7 @@ typedef struct StyleValues { XColor *overstrikeColor; /* Foreground color for overstrike through * text. */ int rMargin; /* Right margin, in pixels. */ + Tk_3DBorder rMarginColor; /* Color of right margin. */ int spacing1; /* Spacing above first dline in text line. */ int spacing2; /* Spacing between lines of dline. */ int spacing3; /* Spacing below last dline in text line. */ @@ -245,6 +246,10 @@ typedef struct DLine { * to the left margin of the display line. */ int lMarginWidth; /* Pixel width of the area corresponding to * the left margin. */ + Tk_3DBorder rMarginColor; /* Background color of the area corresponding + * to the right margin of the display line. */ + int rMarginWidth; /* Pixel width of the area corresponding to + * the right margin. */ int length; /* Total length of line, in pixels. */ TkTextDispChunk *chunkPtr; /* Pointer to first chunk in list of all of * those that are displayed on this line of @@ -770,7 +775,7 @@ GetStyle( int fgPrio, fontPrio, fgStipplePrio; int underlinePrio, elidePrio, justifyPrio, offsetPrio; int lMargin1Prio, lMargin2Prio, rMarginPrio; - int lMarginColorPrio; + int lMarginColorPrio, rMarginColorPrio; int spacing1Prio, spacing2Prio, spacing3Prio; int overstrikePrio, tabPrio, tabStylePrio, wrapPrio; @@ -785,7 +790,7 @@ GetStyle( fgPrio = fontPrio = fgStipplePrio = -1; underlinePrio = elidePrio = justifyPrio = offsetPrio = -1; lMargin1Prio = lMargin2Prio = rMarginPrio = -1; - lMarginColorPrio = -1; + lMarginColorPrio = rMarginColorPrio = -1; spacing1Prio = spacing2Prio = spacing3Prio = -1; overstrikePrio = tabPrio = tabStylePrio = wrapPrio = -1; memset(&styleValues, 0, sizeof(StyleValues)); @@ -933,6 +938,11 @@ GetStyle( styleValues.rMargin = tagPtr->rMargin; rMarginPrio = tagPtr->priority; } + if ((tagPtr->rMarginColor != NULL) + && (tagPtr->priority > rMarginColorPrio)) { + styleValues.rMarginColor = tagPtr->rMarginColor; + rMarginColorPrio = tagPtr->priority; + } if ((tagPtr->spacing1String != NULL) && (tagPtr->priority > spacing1Prio)) { styleValues.spacing1 = tagPtr->spacing1; @@ -1187,6 +1197,8 @@ LayoutDLine( dlPtr->logicalLinesMerged = 0; dlPtr->lMarginColor = NULL; dlPtr->lMarginWidth = 0; + dlPtr->rMarginColor = NULL; + dlPtr->rMarginWidth = 0; /* * This is not necessarily totally correct, where we have merged logical @@ -1774,6 +1786,10 @@ LayoutDLine( dlPtr->height += dlPtr->spaceAbove + dlPtr->spaceBelow; dlPtr->baseline += dlPtr->spaceAbove; dlPtr->lMarginColor = sValuePtr->lMarginColor; + dlPtr->rMarginColor = sValuePtr->rMarginColor; + if (wrapMode != TEXT_WRAPMODE_NONE) { + dlPtr->rMarginWidth = rMargin; + } /* * Recompute line length: may have changed because of justification. @@ -2460,13 +2476,18 @@ DisplayDLine( Tk_Width(textPtr->tkwin), dlPtr->height, 0, TK_RELIEF_FLAT); /* - * Second, draw the background color of the left margin. + * Second, draw the background color of the left and right margins. */ if (dlPtr->lMarginColor != NULL) { int x = dlPtr->lMarginWidth + dInfoPtr->x - dInfoPtr->curXPixelOffset; Tk_Fill3DRectangle(textPtr->tkwin, pixmap, dlPtr->lMarginColor, 0, y, - (x>0?x:0), dlPtr->height, 0, TK_RELIEF_FLAT); + (x>0?x:0), dlPtr->height, 0, TK_RELIEF_FLAT); + } + if (dlPtr->rMarginColor != NULL) { + Tk_Fill3DRectangle(textPtr->tkwin, pixmap, dlPtr->rMarginColor, + dInfoPtr->maxX - dlPtr->rMarginWidth + dInfoPtr->curXPixelOffset, + y, dlPtr->rMarginWidth, dlPtr->height, 0, TK_RELIEF_FLAT); } /* diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index a3e55fc..49d6a50 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -75,6 +75,8 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, -1, Tk_Offset(TkTextTag, reliefString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-rmargin", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, rMarginString), TK_OPTION_NULL_OK, 0,0}, + {TK_OPTION_BORDER, "-rmargincolor", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, rMarginColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BITMAP, "-selectbgstipple", NULL, NULL, @@ -545,7 +547,8 @@ TkTextTagCmd( || (tagPtr->overstrikeColor != NULL) || (tagPtr->underlineString != NULL) || (tagPtr->underlineColor != NULL) - || (tagPtr->lMarginColor != NULL)) { + || (tagPtr->lMarginColor != NULL) + || (tagPtr->rMarginColor != NULL)) { tagPtr->affectsDisplay = 1; } if (!newTag) { @@ -1050,6 +1053,7 @@ TkTextCreateTag( tagPtr->overstrikeColor = NULL; tagPtr->rMarginString = NULL; tagPtr->rMargin = 0; + tagPtr->rMarginColor = NULL; tagPtr->selBorder = NULL; tagPtr->selBgStipple = None; tagPtr->selFgColor = NULL; -- cgit v0.12 From c841d963af542a097122211248620383ff6098c0 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 10 Feb 2016 22:53:51 +0000 Subject: -rmargincolor tag configuration option: documentation --- doc/text.n | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/text.n b/doc/text.n index 1e6dbc2..84ad710 100644 --- a/doc/text.n +++ b/doc/text.n @@ -533,6 +533,14 @@ option is only used when wrapping is enabled. If a text line wraps, the right margin for each line on the display is determined by the first non-elided character of that display line. .TP +\fB\-rmargincolor \fIcolor\fR +. +\fIColor\fR specifies the background color to use in regions that do not +contain characters because they are indented by \fB\-rmargin1\fR. It may +have any of the forms accepted by \fBTk_GetColor\fR.If \fIcolor\fR has not +been specified, or if it is specified as an empty string, then the color +specified by the \fB-background\fR widget option is used. +.TP \fB\-selectbackground \fIcolor\fR \fIColor\fR specifies the background color to use when displaying selected items. It may have any of the forms accepted by \fBTk_GetColor\fR. If -- cgit v0.12 From 6acf033f061f09ca43c0203318847b950110eb87 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 10 Feb 2016 22:54:09 +0000 Subject: -rmargincolor tag configuration option: tests --- tests/textTag.test | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/tests/textTag.test b/tests/textTag.test index 9e0cf38..f8d7033 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -251,45 +251,56 @@ test textTag-1.25 {configuration options} -constraints { .t tag configure x -rmargin [lindex [.t tag configure x -rmargin] 3] } -returnCodes error -result {bad screen distance "bad"} test textTag-1.25a {tag configuration options} -body { + .t tag configure x -rmargincolor darkblue + .t tag cget x -rmargincolor +} -cleanup { + .t tag configure x -rmargincolor [lindex [.t tag configure x -rmargincolor] 3] +} -result {darkblue} +test textTag-1.25b {configuration options} -body { + .t tag configure x -rmargincolor non-existent +} -cleanup { + .t tag configure x -rmargincolor [lindex [.t tag configure x -rmargincolor] 3] +} -returnCodes error -result {unknown color name "non-existent"} +test textTag-1.25c {tag configuration options} -body { .t tag configure x -selectbackground #012345 .t tag cget x -selectbackground } -cleanup { .t tag configure x -selectbackground [lindex [.t tag configure x -selectbackground] 3] } -result {#012345} -test textTag-1.25b {configuration options} -body { +test textTag-1.25d {configuration options} -body { .t tag configure x -selectbackground non-existent } -cleanup { .t tag configure x -selectbackground [lindex [.t tag configure x -selectbackground] 3] } -returnCodes error -result {unknown color name "non-existent"} -test textTag-1.25c {tag configuration options} -body { +test textTag-1.25e {tag configuration options} -body { .t tag configure x -selectbgstipple gray50 .t tag cget x -selectbgstipple } -cleanup { .t tag configure x -selectbgstipple [lindex [.t tag configure x -selectbgstipple] 3] } -result {gray50} -test textTag-1.25d {configuration options} -body { +test textTag-1.25f {configuration options} -body { .t tag configure x -selectbgstipple badStipple } -cleanup { .t tag configure x -selectbgstipple [lindex [.t tag configure x -selectbgstipple] 3] } -returnCodes error -result {bitmap "badStipple" not defined} -test textTag-1.25e {tag configuration options} -body { +test textTag-1.25g {tag configuration options} -body { .t tag configure x -selectfgstipple gray50 .t tag cget x -selectfgstipple } -cleanup { .t tag configure x -selectfgstipple [lindex [.t tag configure x -selectfgstipple] 3] } -result {gray50} -test textTag-1.25f {configuration options} -body { +test textTag-1.25h {configuration options} -body { .t tag configure x -selectfgstipple badStipple } -cleanup { .t tag configure x -selectfgstipple [lindex [.t tag configure x -selectfgstipple] 3] } -returnCodes error -result {bitmap "badStipple" not defined} -test textTag-1.25g {tag configuration options} -body { +test textTag-1.25i {tag configuration options} -body { .t tag configure x -selectforeground #012345 .t tag cget x -selectforeground } -cleanup { .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3] } -result {#012345} -test textTag-1.25h {configuration options} -body { +test textTag-1.25j {configuration options} -body { .t tag configure x -selectforeground non-existent } -cleanup { .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3] @@ -719,12 +730,16 @@ test textTag-5.12 {TkTextTagCmd - "configure" option} -constraints { test textTag-5.13 {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -lmargin1 2 -lmargin2 4 -rmargin 5 \ - -lmargincolor darkblue + -lmargincolor darkblue -rmargincolor lightgreen list [.t tag configure x -lmargin1] [.t tag configure x -lmargin2] \ - [.t tag configure x -rmargin] [.t tag configure x -lmargincolor] + [.t tag configure x -rmargin] [.t tag configure x -lmargincolor] \ + [.t tag configure x -rmargincolor] } -cleanup { .t tag delete x -} -result {{-lmargin1 {} {} {} 2} {-lmargin2 {} {} {} 4} {-rmargin {} {} {} 5} {-lmargincolor {} {} {} darkblue}} +} -result [list {-lmargin1 {} {} {} 2} {-lmargin2 {} {} {} 4} \ + {-rmargin {} {} {} 5} \ + {-lmargincolor {} {} {} darkblue} {-rmargincolor {} {} {} lightgreen} \ + ] test textTag-5.14 {TkTextTagCmd - "configure" option} -constraints { haveCourier12 } -body { @@ -755,6 +770,12 @@ test textTag-5.16 {TkTextTagCmd - "configure" option} -constraints { } -cleanup { .t tag delete x } -returnCodes error -result {bad screen distance "140.1.1"} +test textTag-5.16a {TkTextTagCmd - "configure" option} -body { + .t tag delete x + .t tag configure x -rmargincolor rainbow +} -cleanup { + .t tag delete x +} -returnCodes error -result {unknown color name "rainbow"} .t tag delete x test textTag-5.17 {TkTextTagCmd - "configure" option} -constraints { haveCourier12 -- cgit v0.12 From 0fe18b82571d24300bc235e6c37013742ee3b778 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 11 Feb 2016 10:41:03 +0000 Subject: Fixed typo in comment (introduced by error in [6a21622c7e]) --- generic/tkText.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkText.h b/generic/tkText.h index 8fab200..f37e01a 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -407,7 +407,7 @@ typedef struct TkTextTag { * non-NULL. */ XColor *underlineColor; /* Color for the underline. NULL means same * color as foreground. */ - TkWrapMode wrapMode; /* How to hsandle wrap-around for this tag. + TkWrapMode wrapMode; /* How to handle wrap-around for this tag. * Must be TEXT_WRAPMODE_CHAR, * TEXT_WRAPMODE_NONE, TEXT_WRAPMODE_WORD, or * TEXT_WRAPMODE_NULL to use wrapmode for -- cgit v0.12 From 4dd26486a8997a2706c8c9369c4a17706c33e114 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 11 Feb 2016 13:09:34 +0000 Subject: Fix crash in TkFinalize() if Tk_Init() is never called. Suggested by Brian Griffin. --- generic/tkEvent.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/generic/tkEvent.c b/generic/tkEvent.c index bcc6d98..95aeda1 100644 --- a/generic/tkEvent.c +++ b/generic/tkEvent.c @@ -2039,6 +2039,12 @@ TkFinalize( { ExitHandler *exitPtr; +#if defined(_WIN32) && !defined(STATIC_BUILD) + if (!tclStubsPtr) { + return; + } +#endif + Tcl_DeleteExitHandler(TkFinalize, NULL); Tcl_MutexLock(&exitMutex); -- cgit v0.12 From 03e15875540e77c1ee40fbeb63955bb50eade596 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 11 Feb 2016 13:11:28 +0000 Subject: (cherry-pick): Fix crash in TkFinalize() if Tk_Init() is never called. Suggested by Brian Griffin. --- generic/tkEvent.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/generic/tkEvent.c b/generic/tkEvent.c index 03e7283..747555e 100644 --- a/generic/tkEvent.c +++ b/generic/tkEvent.c @@ -2047,6 +2047,12 @@ TkFinalize( { ExitHandler *exitPtr; +#if defined(_WIN32) && !defined(STATIC_BUILD) + if (!tclStubsPtr) { + return; + } +#endif + Tcl_DeleteExitHandler(TkFinalize, NULL); Tcl_MutexLock(&exitMutex); -- cgit v0.12 From 2d1dee7c0fdf51a57ac71ed493aa92e278a7720e Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 11 Feb 2016 13:17:51 +0000 Subject: -lmargincolor tag configuration option: implementation slightly optimized since Tk_Fill3DRectangle is robust with respect to negative widths --- generic/tkTextDisp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index c0dc017..f871fc1 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -2479,10 +2479,9 @@ DisplayDLine( * Second, draw the background color of the left and right margins. */ if (dlPtr->lMarginColor != NULL) { - int x = dlPtr->lMarginWidth + dInfoPtr->x - dInfoPtr->curXPixelOffset; - Tk_Fill3DRectangle(textPtr->tkwin, pixmap, dlPtr->lMarginColor, 0, y, - (x>0?x:0), dlPtr->height, 0, TK_RELIEF_FLAT); + dlPtr->lMarginWidth + dInfoPtr->x - dInfoPtr->curXPixelOffset, + dlPtr->height, 0, TK_RELIEF_FLAT); } if (dlPtr->rMarginColor != NULL) { Tk_Fill3DRectangle(textPtr->tkwin, pixmap, dlPtr->rMarginColor, -- cgit v0.12 From 2c864a03e860d3d1b46385e52f6fb648b9f7edb2 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 11 Feb 2016 13:58:42 +0000 Subject: Repair visual test for bevels, inadvertently broken in [6a93101279] --- tests/bevel.tcl | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/bevel.tcl b/tests/bevel.tcl index 531def0..4af60f3 100644 --- a/tests/bevel.tcl +++ b/tests/bevel.tcl @@ -147,14 +147,12 @@ set ind [.t.t index end] xxxx} {} SSSSS sol100 {xxxx x} {} SSSSSSSSSSSSSSSSSS sol100 {x xxx} {} SSSSSSSSS sol100 xxxx {} -} .t.t insert end "\n\nA thinner border is continuous" .t.t insert end { xxxx} {} SSSSS sol12 {xxxx x} {} SSSSSSSSSSSSSSSSSS sol12 {x xxx} {} SSSSSSSSS sol12 xxxx {} -} .t.t tag add big $ind end -- cgit v0.12 From c62581912456c387fe35dfbb2a72dfca95dab139 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 11 Feb 2016 13:59:46 +0000 Subject: Repair visual test for bevels, inadvertently broken in [9046f1cb83] (cherrypicked [7ac2438944]) --- tests/bevel.tcl | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/bevel.tcl b/tests/bevel.tcl index 531def0..4af60f3 100644 --- a/tests/bevel.tcl +++ b/tests/bevel.tcl @@ -147,14 +147,12 @@ set ind [.t.t index end] xxxx} {} SSSSS sol100 {xxxx x} {} SSSSSSSSSSSSSSSSSS sol100 {x xxx} {} SSSSSSSSS sol100 xxxx {} -} .t.t insert end "\n\nA thinner border is continuous" .t.t insert end { xxxx} {} SSSSS sol12 {xxxx x} {} SSSSSSSSSSSSSSSSSS sol12 {x xxx} {} SSSSSSSSS sol12 xxxx {} -} .t.t tag add big $ind end -- cgit v0.12 From 365dd709b8625b7b08f347f0c0122612c454b618 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 11 Feb 2016 20:06:29 +0000 Subject: Fixed error in comment --- generic/tkTextDisp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 7969091..1eea37d 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -1640,7 +1640,7 @@ LayoutDLine( * Make one more pass over the line to recompute various things like its * height, length, and total number of bytes. Also modify the x-locations * of chunks to reflect justification. If we're not wrapping, I'm not sure - * what is the best way to handle left and center justification: should + * what is the best way to handle right and center justification: should * the total length, for purposes of justification, be (a) the window * width, (b) the length of the longest line in the window, or (c) the * length of the longest line in the text? (c) isn't available, (b) seems -- cgit v0.12 From b41c4d29075b0456ea437df35adc6cd251aa892b Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 11 Feb 2016 20:11:59 +0000 Subject: Fixed error in comment (cherrypicked [a3d4e5de17] --- generic/tkTextDisp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 68c09fc..1f39112 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -1638,7 +1638,7 @@ LayoutDLine( * Make one more pass over the line to recompute various things like its * height, length, and total number of bytes. Also modify the x-locations * of chunks to reflect justification. If we're not wrapping, I'm not sure - * what is the best way to handle left and center justification: should + * what is the best way to handle right and center justification: should * the total length, for purposes of justification, be (a) the window * width, (b) the length of the longest line in the window, or (c) the * length of the longest line in the text? (c) isn't available, (b) seems -- cgit v0.12 From 2944e4c7eb5d6ddae6aaf1eac0262f396d2a4a95 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 19 Feb 2016 17:39:34 +0000 Subject: update changes --- changes | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/changes b/changes index 81be9f1..bf3e62e 100644 --- a/changes +++ b/changes @@ -7167,3 +7167,102 @@ Tk Cocoa 2.0: App Store enabled (walzer,culler,desmera,owen,nyberg,reincke) *** POTENTIAL INCOMPATIBILITY *** --- Released 8.6.4, March 12, 2015 --- http://core.tcl.tk/tk/ for details + +2015-03-10 (bug) Cocoa: premature image free crash (walzer) + +2015-03-15 (bug) Cocoa: wish launches in front. [focus -force] works (culler) + +2015-04-09 (bug)[e4ed00] [$text index "1.0 display wordstart"] crash (vogel) + +2015-04-09 (bug)[562118] Unicode support of "wordstart" modifier (vogel) + +2015-05-05 (bug)[06c3fc] PNG alpha error corrupted output file (gauthier,porter) + +2015-05-20 (bug)[dece63] various mem corruptions in images (mic42,porter) + +2015-05-24 (bug)[53f8fc] panedwindow geometry management (vogel) + +2015-05-26 (bug)[1641721] tk_getOpenFile symlink display doubled (nijtmans) + +2015-06-01 (bug)[d7bad5][2368195][3592454][1714535][1292219][3592454] + panedwindow fixes (vogel) + +2015-06-25 (bug)[805cff] Tk_ConfigureWidget() segfault (aspect,nijtmans) + +2015-07-13 (bug)[3f179a] Text widget crash with elided text (vogel) + +2015-07-16 (bug)[2886436] Stop [$text delete] acting before start index (vogel) + +2015-07-28 (bug)[1236306] TraverseToMenu error bound to toplevel destroy (vogel) + +2015-08-20 (bug)[00189c] MSVC 14: semi-static UCRT support (dower,nijtmans) + +2015-09-13 (bug)[cc0ba3] PNG read buffer overflow (maxjarek,porter) + +2015-09-29 (bug)[1501749] Crash embedded window delete bound to (vogel) + +2015-10-04 (license) Replace icons that lacked clear free license (cowals) + +2015-10-06 (bug)[46c83f] Win: tk_getOpenFile -initialdir (koend,nadkarni) + +2015-10-08 (new feature)[TIP 437] New panedwindow options (vogel) + +2015-10-09 (bug)[1669632] [text] autoseparator placement (nash,vogel) + +2015-10-09 (bug)[2262711] [text] RE search Unicode+elided (kaitzschu,vogel) + +2015-10-09 (bug)[1815161] [$text count -ypixels] needs management (vogel) + +2015-10-22 (bug)[1520118] Document spinbox validate expectations (vogel) + +2015-10-22 (bug)[1414025] $entry insertion cursor visibility (vogel) + +2015-10-26 (bug) PNG rendering on El Capitan (meier,walzer) + +2015-11-08 (bug)[2160206] menubutton panic (vogel) + +2015-11-08 (bug)[220854] Display trailing TAB in entry (vogel) + +2015-11-08 (bug)[542199] double click on lone char in entry (vogel) + +2015-11-08 (bug)[297442d] strict motif binding on (vogel) + +2015-11-08 (bug)[3601604] $listbox -takefocus (vogel) + +2015-11-09 (bug)[5ee8af] X, Win: 64-bit enable embedded windows (vogel) + +2015-11-29 (bug)[1997299] [text] tag borderwidth leak (vogel) + +2015-12-12 (bug)[1739605] [text see] misbehavior (danckaert) + +2015-12-13 (bug)[ff8a1e] Never-mapped [text] performance (danckaert) + +2015-12-19 (bug)[1700065] Report errors from -textvariable write trace (vogel) + +2015-12-19 (bug)[793909] -textvariable handle undefined namespace (vogel) + +2015-12-26 (bug)[2f78c7] crash with [text] and [tablelist] (vogel) + +2016-01-06 (bug)[1288433,3102228] <> misfires (vogel) + +2016-01-08 (bug)[1510538] initial scrollbar width (vogel,nijtmans) + +2016-01-08 (bug)[1305128] event not received by scrollbar (vogel,nijtmans) + +2016-01-09 (bug)[1927212] Mousewheel/scrollbar bindings (vogel) + +2016-01-11 (bug)[63c354] Cocoa message boxes (culler) + +2016-01-12 (bug)[2049429] get more $text options from database (vogel) + +2016-01-22 (TIP 441) New option [listbox ... -justify] (vogel) + +2016-01-25 (bug) OBOE in ttk::notebook options parsing (bromley,english) + +2016-02-08 (enhance) [option readile] expects utf-8 file (oehlmann,nijtmans) + +2016-02-08 (bug) crash in [$text delete] (griffin,vogel) + +Tk Cocoa 2.0: More drawing internals refinements (culler,walzer) + +--- Released 8.6.5, February 29, 2016 --- http://core.tcl.tk/tk/ for details -- cgit v0.12 From 4e1b2a38af5d33026af79d7bcb6320680bab198b Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 21 Feb 2016 20:53:44 +0000 Subject: Fixed typo in canvas man page --- doc/canvas.n | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/canvas.n b/doc/canvas.n index bc29cc3..38697cd 100644 --- a/doc/canvas.n +++ b/doc/canvas.n @@ -263,7 +263,7 @@ automatically decremented by one. A number less than 0 is treated as if it were zero, and a number greater than the length of the text item is treated as if it were equal to the length of the text item. For -polygons, numbers less than 0 or greater then the length +polygons, numbers less than 0 or greater than the length of the coordinate list will be adjusted by adding or subtracting the length until the result is between zero and the length, inclusive. @@ -405,7 +405,7 @@ behaves as if the \fIstart\fR argument had not been specified. . Selects all the items completely enclosed within the rectangular region given by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR. -\fIX1\fR must be no greater then \fIx2\fR and \fIy1\fR must be +\fIX1\fR must be no greater than \fIx2\fR and \fIy1\fR must be no greater than \fIy2\fR. .TP \fBoverlapping\fR \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR @@ -413,7 +413,7 @@ no greater than \fIy2\fR. Selects all the items that overlap or are enclosed within the rectangular region given by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR. -\fIX1\fR must be no greater then \fIx2\fR and \fIy1\fR must be +\fIX1\fR must be no greater than \fIx2\fR and \fIy1\fR must be no greater than \fIy2\fR. .TP \fBwithtag \fItagOrId\fR -- cgit v0.12 From 3dfd0dd611bcd8d85edae8c326be10eb2ee5518a Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 22 Feb 2016 17:45:21 +0000 Subject: Added missing comments describing input parameters of some procs --- library/spinbox.tcl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/spinbox.tcl b/library/spinbox.tcl index 6a5f829..02584f4 100644 --- a/library/spinbox.tcl +++ b/library/spinbox.tcl @@ -336,6 +336,7 @@ proc ::tk::spinbox::ClosestGap {w x} { # Arguments: # w - The spinbox window in which the button was pressed. # x - The x-coordinate of the button press. +# y - The y-coordinate of the button press. proc ::tk::spinbox::ButtonDown {w x y} { variable ::tk::Priv @@ -388,6 +389,7 @@ proc ::tk::spinbox::ButtonDown {w x y} { # Arguments: # w - The spinbox window in which the button was pressed. # x - The x-coordinate of the button press. +# y - The y-coordinate of the button press. proc ::tk::spinbox::ButtonUp {w x y} { variable ::tk::Priv @@ -491,6 +493,8 @@ proc ::tk::spinbox::Paste {w x} { # # Arguments: # w - The spinbox window. +# x - The x-coordinate of the mouse. +# y - The y-coordinate of the mouse. proc ::tk::spinbox::Motion {w x y} { variable ::tk::Priv -- cgit v0.12 From 3a076fb453d7473cf3e8ab0beecb1aabc337c317 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 22 Feb 2016 17:47:02 +0000 Subject: Fixed bug [2981253] - spinbox button frozen in case of repeated depressions --- library/spinbox.tcl | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/library/spinbox.tcl b/library/spinbox.tcl index 02584f4..8c287bf 100644 --- a/library/spinbox.tcl +++ b/library/spinbox.tcl @@ -86,10 +86,12 @@ bind Spinbox { ::tk::spinbox::Motion %W %x %y } bind Spinbox { + ::tk::spinbox::ArrowPress %W %x %y set tk::Priv(selectMode) word ::tk::spinbox::MouseSelect %W %x sel.first } bind Spinbox { + ::tk::spinbox::ArrowPress %W %x %y set tk::Priv(selectMode) line ::tk::spinbox::MouseSelect %W %x 0 } @@ -328,6 +330,35 @@ proc ::tk::spinbox::ClosestGap {w x} { incr pos } +# ::tk::spinbox::ArrowPress -- +# This procedure is invoked to handle button-1 presses in buttonup +# or buttondown elements of spinbox widgets. +# +# Arguments: +# w - The spinbox window in which the button was pressed. +# x - The x-coordinate of the button press. +# y - The y-coordinate of the button press. + +proc ::tk::spinbox::ArrowPress {w x y} { + variable ::tk::Priv + + if {[$w cget -state] ne "disabled" && \ + [string match "button*" $Priv(element)]} { + $w selection element $Priv(element) + set Priv(repeated) 0 + set Priv(relief) [$w cget -$Priv(element)relief] + catch {after cancel $Priv(afterId)} + set delay [$w cget -repeatdelay] + if {$delay > 0} { + set Priv(afterId) [after $delay \ + [list ::tk::spinbox::Invoke $w $Priv(element)]] + } + if {[info exists Priv(outsideElement)]} { + unset Priv(outsideElement) + } + } +} + # ::tk::spinbox::ButtonDown -- # This procedure is invoked to handle button-1 presses in spinbox # widgets. It moves the insertion cursor, sets the selection anchor, @@ -351,20 +382,7 @@ proc ::tk::spinbox::ButtonDown {w x y} { switch -exact $Priv(element) { "buttonup" - "buttondown" { - if {"disabled" ne [$w cget -state]} { - $w selection element $Priv(element) - set Priv(repeated) 0 - set Priv(relief) [$w cget -$Priv(element)relief] - catch {after cancel $Priv(afterId)} - set delay [$w cget -repeatdelay] - if {$delay > 0} { - set Priv(afterId) [after $delay \ - [list ::tk::spinbox::Invoke $w $Priv(element)]] - } - if {[info exists Priv(outsideElement)]} { - unset Priv(outsideElement) - } - } + ::tk::spinbox::ArrowPress $w $x $y } "entry" { set Priv(selectMode) char -- cgit v0.12 From e34d5227c7b3b6adb662059adbb55ac026d5baf2 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 22 Feb 2016 21:46:32 +0000 Subject: Fixed bug [3137232] - spinbox error after destroying toplevel from widget --- library/spinbox.tcl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/spinbox.tcl b/library/spinbox.tcl index 02584f4..fecf7d6 100644 --- a/library/spinbox.tcl +++ b/library/spinbox.tcl @@ -299,6 +299,10 @@ bind Spinbox { proc ::tk::spinbox::Invoke {w elem} { variable ::tk::Priv + if {![winfo exists $w]} { + return + } + if {![info exists Priv(outsideElement)]} { $w invoke $elem incr Priv(repeated) -- cgit v0.12 From db0f75aaee952d79eac60d9f4e4179441c040d55 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 24 Feb 2016 17:19:36 +0000 Subject: Added tests cases for bug [2262543] - Scale widget unexpectedly fires command callback --- tests/scale.test | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/tests/scale.test b/tests/scale.test index a8d08a8..8c14ed4 100644 --- a/tests/scale.test +++ b/tests/scale.test @@ -1396,6 +1396,114 @@ test scale-19 {Bug [3529885fff] - Click in through goes in wrong direction} \ } \ -result {1.0 1.0 1.0 1.0} +test scale-20.1 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 1} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 +} -body { + scale .s -from 1 -to 50 -command {set commandedVar} + pack .s + update ; # -command callback shall NOT fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {1 -1} +test scale-20.2 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 2} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 + set scaleVar 7 +} -body { + scale .s -from 1 -to 50 -variable scaleVar -command {set commandedVar} + pack .s + update ; # -command callback shall NOT fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {7 -1} +test scale-20.3 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 3} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 +} -body { + scale .s -from 1 -to 50 + .s set 10 + .s configure -command {set commandedVar} + pack .s + update ; # -command callback shall NOT fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {10 -1} +test scale-20.4 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 4} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 +} -body { + scale .s -from 1 -to 50 -command {set commandedVar} + .s set 10 + pack .s + update ; # -command callback shall fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {10 10} +test scale-20.5 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 5} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 +} -body { + scale .s -from 1 -to 50 + pack .s + .s set 10 + .s configure -command {set commandedVar} + update ; # -command callback shall NOT fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {10 -1} +test scale-20.6 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 6} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 +} -body { + scale .s -from 1 -to 50 + pack .s + .s configure -command {set commandedVar} + .s set 10 + update ; # -command callback shall fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {10 10} +test scale-20.7 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 7} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 +} -body { + scale .s -from 1 -to 50 -command {set commandedVar} + pack .s + .s set 10 + update ; # -command callback shall fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {10 10} +test scale-20.8 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 8} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 + set scaleVar 7 +} -body { + scale .s -from 1 -to 50 -variable scaleVar -command {set commandedVar} + pack .s + .s set 10 + update ; # -command callback shall fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {10 10} + option clear # cleanup -- cgit v0.12 From 1b0adcf04a83a228748415aa2c01506890ea8941 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 24 Feb 2016 17:32:24 +0000 Subject: Fixed bug [2262543] - Scale widget unexpectedly fires command callback --- generic/tkScale.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/generic/tkScale.c b/generic/tkScale.c index cc7c294..cbc5202 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -303,6 +303,12 @@ Tk_ScaleObjCmd( return TCL_ERROR; } + /* + * The widget was just created, no command callback must be invoked. + */ + + scalePtr->flags &= ~INVOKE_COMMAND; + Tcl_SetObjResult(interp, TkNewWindowObj(scalePtr->tkwin)); return TCL_OK; } @@ -1268,7 +1274,14 @@ TkScaleSetValue( return; } scalePtr->value = value; - if (invokeCommand) { + + /* + * Schedule command callback invocation only if there is such a command + * already registered, otherwise the callback would trigger later when + * configuring the widget -command option even if the value did not change. + */ + + if ((invokeCommand) && (scalePtr->command != NULL)) { scalePtr->flags |= INVOKE_COMMAND; } TkEventuallyRedrawScale(scalePtr, REDRAW_SLIDER); -- cgit v0.12 From a3ee774779349213a90779a5b69d5ac5d8357099 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 24 Feb 2016 20:10:25 +0000 Subject: Fixed bug [e9112ef96e] - [wm forget] doesn't completely --- macosx/tkMacOSXWm.c | 5 +++++ unix/tkUnixWm.c | 5 +++++ win/tkWinWm.c | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 3ea2f51..39990e6 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -1788,6 +1788,11 @@ WmForgetCmd( TkWmDeadWindow(winPtr); RemapWindows(winPtr, (MacDrawable *) winPtr->parentPtr->window); + /* + * Make sure wm no longer manages this window + */ + Tk_ManageGeometry(frameWin, NULL, NULL); + winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED); /* diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index 612270c..19ac86c 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -1826,6 +1826,11 @@ WmForgetCmd( ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED); RemapWindows(winPtr, winPtr->parentPtr); + /* + * Make sure wm no longer manages this window + */ + Tk_ManageGeometry(frameWin, NULL, NULL); + /* * Flags (above) must be cleared before calling TkMapTopFrame (below). */ diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 768ee69..4e7618d 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -3673,6 +3673,12 @@ WmForgetCmd( winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED); Tk_MakeWindowExist((Tk_Window)winPtr->parentPtr); RemapWindows(winPtr, Tk_GetHWND(winPtr->parentPtr->window)); + + /* + * Make sure wm no longer manages this window + */ + Tk_ManageGeometry(frameWin, NULL, NULL); + TkWmDeadWindow(winPtr); /* flags (above) must be cleared before calling */ /* TkMapTopFrame (below) */ -- cgit v0.12 From 2dd0105b9da82fc1d2f88de7ab2b51c2ee928bcd Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 24 Feb 2016 20:29:31 +0000 Subject: Added test case wm-forget-2 related to test the fix for bug [e9112ef96e] --- tests/wm.test | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/wm.test b/tests/wm.test index 1aa0779..afcc2cd 100644 --- a/tests/wm.test +++ b/tests/wm.test @@ -2276,6 +2276,32 @@ test wm-forget-1.4 "pack into unmapped toplevel causes crash" -body { deleteWindows } -result {} +test wm-forget-2 {bug [e9112ef96e] - [wm forget] doesn't completely} -setup { + catch {destroy .l .f.b .f} + set res {} +} -body { + label .l -text "Top Dot" + frame .f + button .f.b -text Hello -command "puts Hello!" + pack .l -side top + pack .f.b + pack .f -side bottom + update + set res [winfo manager .f] + pack forget .f + update + lappend res [winfo manager .f] + wm manage .f + update + lappend res [winfo manager .f] + wm forget .f + update + lappend res [winfo manager .f] +} -cleanup { + destroy .l .f.b .f + unset res +} -result {pack {} wm {}} + # FIXME: # Test delivery of virtual events to the WM. We could check to see if the -- cgit v0.12 From 612675a4f57c40b222eccf363977705fbdd848aa Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 25 Feb 2016 08:09:32 +0000 Subject: Fixed typo in spinbox documentation page --- doc/spinbox.n | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/spinbox.n b/doc/spinbox.n index 7227cf1..330bb17 100644 --- a/doc/spinbox.n +++ b/doc/spinbox.n @@ -55,7 +55,7 @@ A floating-point value corresponding to the lowest value for a spinbox, to be used in conjunction with \fB\-to\fR and \fB\-increment\fR. When all are specified correctly, the spinbox will use these values to control its contents. This value must be less than the \fB\-to\fR option. -If \fB\-values\fR is specified, it supercedes this option. +If \fB\-values\fR is specified, it supersedes this option. .OP "\-invalidcommand or \-invcmd" invalidCommand InvalidCommand Specifies a script to eval when \fB\-validatecommand\fR returns 0. Setting it to an empty string disables this feature (the default). The best use of @@ -84,7 +84,7 @@ A floating-point value corresponding to the highest value for the spinbox, to be used in conjunction with \fB\-from\fR and \fB\-increment\fR. When all are specified correctly, the spinbox will use these values to control its contents. This value must be greater than the \fB\-from\fR option. -If \fB\-values\fR is specified, it supercedes this option. +If \fB\-values\fR is specified, it supersedes this option. .OP \-validate validate Validate Specifies the mode in which validation should operate: \fBnone\fR, \fBfocus\fR, \fBfocusin\fR, \fBfocusout\fR, \fBkey\fR, or \fBall\fR. -- cgit v0.12 From e353dfd7b77de377b5475b760d286a0990958dd6 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 25 Feb 2016 14:40:12 +0000 Subject: Fixed bug [841280] - spinbox -from and -to defaults and behaviour --- doc/spinbox.n | 6 ++++-- generic/tkEntry.c | 16 +++++++++------- tests/spinbox.test | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/doc/spinbox.n b/doc/spinbox.n index 330bb17..e030aa3 100644 --- a/doc/spinbox.n +++ b/doc/spinbox.n @@ -54,7 +54,8 @@ as it will format a floating-point number. A floating-point value corresponding to the lowest value for a spinbox, to be used in conjunction with \fB\-to\fR and \fB\-increment\fR. When all are specified correctly, the spinbox will use these values to control its -contents. This value must be less than the \fB\-to\fR option. +contents. If this value is greater than the \fB\-to\fR option, then +\fB\-from\fR and \fB\-to\fR values are automatically swapped. If \fB\-values\fR is specified, it supersedes this option. .OP "\-invalidcommand or \-invcmd" invalidCommand InvalidCommand Specifies a script to eval when \fB\-validatecommand\fR returns 0. Setting @@ -83,7 +84,8 @@ be displayed in a different color, depending on the values of the A floating-point value corresponding to the highest value for the spinbox, to be used in conjunction with \fB\-from\fR and \fB\-increment\fR. When all are specified correctly, the spinbox will use these values to control -its contents. This value must be greater than the \fB\-from\fR option. +its contents. If this value is less than the \fB\-from\fR option, then +\fB\-from\fR and \fB\-to\fR values are automatically swapped. If \fB\-values\fR is specified, it supersedes this option. .OP \-validate validate Validate Specifies the mode in which validation should operate: \fBnone\fR, diff --git a/generic/tkEntry.c b/generic/tkEntry.c index ea8d7f1..5681e47 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -1176,13 +1176,15 @@ ConfigureEntry( if (entryPtr->type == TK_SPINBOX) { if (sbPtr->fromValue > sbPtr->toValue) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "-to value must be greater than -from value", - -1)); - Tcl_SetErrorCode(interp, "TK", "SPINBOX", "RANGE_SANITY", - NULL); - continue; - } + /* + * Swap -from and -to values. + */ + + double tmpFromTo = sbPtr->fromValue; + + sbPtr->fromValue = sbPtr->toValue; + sbPtr->toValue = tmpFromTo; + } if (sbPtr->reqFormat && (oldFormat != sbPtr->reqFormat)) { /* diff --git a/tests/spinbox.test b/tests/spinbox.test index 594cc90..0264b77 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -2072,6 +2072,21 @@ test spinbox-5.11 {ConfigureSpinbox procedure} -setup { } -cleanup { destroy .e } -result {} +test spinbox-5.12 {ConfigureSpinbox procedure, -from and -to swapping} -setup { + spinbox .e +} -body { + # this statement used to trigger error "-to value must be greater than -from value" + # because default value for -to is zero (bug [841280ffff]) + set res [catch {.e configure -from 10}] + .e configure -from 1971 -to 2016 ; # standard case + lappend res [.e cget -from] [.e cget -to] + .e configure -from 2016 -to 1971 ; # auto-swapping happens + lappend res [.e cget -from] [.e cget -to] + .e configure -to 1971 -from 2016 ; # auto-swapping, order of options does not matter + lappend res [.e cget -from] [.e cget -to] +} -cleanup { + destroy .e +} -result {0 1971.0 2016.0 1971.0 2016.0 1971.0 2016.0} # No tests for DisplaySpinbox. -- cgit v0.12 From 682d30ed7f59d3c732d08cf6ccc715e738784453 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 2 Mar 2016 02:41:54 +0000 Subject: [450bb0ecad] Proposed fix for [tk busy] corruption in Aqua Tk. --- generic/tkBusy.c | 4 ++++ generic/tkWindow.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/generic/tkBusy.c b/generic/tkBusy.c index 65248a2..b36d453 100644 --- a/generic/tkBusy.c +++ b/generic/tkBusy.c @@ -433,6 +433,10 @@ MakeTransparentWindowExist( TkpMakeTransparentWindowExist(tkwin, parent); + if (winPtr->window == None) { + return; /* Platform didn't make Window. */ + } + dispPtr = winPtr->dispPtr; hPtr = Tcl_CreateHashEntry(&dispPtr->winTable, (char *) winPtr->window, ¬Used); diff --git a/generic/tkWindow.c b/generic/tkWindow.c index b5cbbab..1e88844 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -2391,6 +2391,9 @@ Tk_IdToWindow( break; } } + if (window == None) { + return NULL; + } hPtr = Tcl_FindHashEntry(&dispPtr->winTable, (char *) window); if (hPtr == NULL) { -- cgit v0.12 From da0931455c52ed9f10b7fe25ab15ab0f4f08ca64 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 2 Mar 2016 14:22:21 +0000 Subject: Eliminate exess spacings in many doc pages --- doc/ConfigWidg.3 | 4 ++-- doc/CrtSelHdlr.3 | 4 ++-- doc/CrtWindow.3 | 4 ++-- doc/FontId.3 | 12 +++++----- doc/GetColor.3 | 4 ++-- doc/GetCursor.3 | 4 ++-- doc/GetFont.3 | 14 +++++------ doc/MapWindow.3 | 8 +++---- doc/MeasureChar.3 | 18 +++++++------- doc/TextLayout.3 | 24 +++++++++---------- doc/Tk_Main.3 | 4 ++-- doc/WindowId.3 | 4 ++-- doc/button.n | 6 ++--- doc/checkbutton.n | 4 ++-- doc/chooseDirectory.n | 4 ++-- doc/clipboard.n | 6 ++--- doc/event.n | 16 ++++++------- doc/font.n | 6 ++--- doc/getOpenFile.n | 8 +++---- doc/listbox.n | 6 ++--- doc/loadTk.n | 4 ++-- doc/menu.n | 8 +++---- doc/options.n | 6 ++--- doc/panedwindow.n | 8 +++---- doc/radiobutton.n | 6 ++--- doc/scale.n | 4 ++-- doc/selection.n | 6 ++--- doc/tkerror.n | 8 +++---- doc/ttk_Geometry.3 | 30 +++++++++++------------ doc/ttk_button.n | 12 +++++----- doc/ttk_checkbutton.n | 20 ++++++++-------- doc/ttk_combobox.n | 12 +++++----- doc/ttk_entry.n | 46 +++++++++++++++++------------------ doc/ttk_frame.n | 6 ++--- doc/ttk_image.n | 10 ++++---- doc/ttk_intro.n | 22 ++++++++--------- doc/ttk_label.n | 14 +++++------ doc/ttk_labelframe.n | 12 +++++----- doc/ttk_menubutton.n | 12 +++++----- doc/ttk_notebook.n | 30 +++++++++++------------ doc/ttk_progressbar.n | 14 +++++------ doc/ttk_radiobutton.n | 18 +++++++------- doc/ttk_scrollbar.n | 10 ++++---- doc/ttk_separator.n | 6 ++--- doc/ttk_spinbox.n | 6 ++--- doc/ttk_style.n | 28 +++++++++++----------- doc/ttk_treeview.n | 66 +++++++++++++++++++++++++-------------------------- doc/ttk_vsapi.n | 4 ++-- doc/wm.n | 4 ++-- 49 files changed, 296 insertions(+), 296 deletions(-) diff --git a/doc/ConfigWidg.3 b/doc/ConfigWidg.3 index ddc1030..92be073 100644 --- a/doc/ConfigWidg.3 +++ b/doc/ConfigWidg.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_ConfigureWidget 3 4.1 Tk "Tk Library Procedures" .so man.macros .BS @@ -174,7 +174,7 @@ legal values for \fItype\fR, and the corresponding actions, are: \fBTK_CONFIG_ACTIVE_CURSOR\fR The value must be an ASCII string identifying a cursor in a form -suitable for passing to \fBTk_GetCursor\fR. +suitable for passing to \fBTk_GetCursor\fR. The value is converted to a \fBTk_Cursor\fR by calling \fBTk_GetCursor\fR and the result is stored in the target. In addition, the resulting cursor is made the active cursor diff --git a/doc/CrtSelHdlr.3 b/doc/CrtSelHdlr.3 index 2aeffa9..2292ccc 100644 --- a/doc/CrtSelHdlr.3 +++ b/doc/CrtSelHdlr.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_CreateSelHandler 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS @@ -44,7 +44,7 @@ requestor. \fBTk_CreateSelHandler\fR arranges for a particular procedure (\fIproc\fR) to be called whenever \fIselection\fR is owned by \fItkwin\fR and the selection contents are requested in the -form given by \fItarget\fR. +form given by \fItarget\fR. \fITarget\fR should be one of the entries defined in the left column of Table 2 of the X Inter-Client Communication Conventions Manual (ICCCM) or diff --git a/doc/CrtWindow.3 b/doc/CrtWindow.3 index 8f44545..b254460 100644 --- a/doc/CrtWindow.3 +++ b/doc/CrtWindow.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_CreateWindow 3 4.2 Tk "Tk Library Procedures" .so man.macros .BS @@ -52,7 +52,7 @@ Name of new window, specified as path name within application .BE .SH DESCRIPTION .PP -The procedures \fBTk_CreateWindow\fR, +The procedures \fBTk_CreateWindow\fR, \fBTk_CreateAnonymousWindow\fR, and \fBTk_CreateWindowFromPath\fR are used to create new windows for use in Tk-based applications. Each of the procedures returns a token diff --git a/doc/FontId.3 b/doc/FontId.3 index c79b89f..9d35ae6 100644 --- a/doc/FontId.3 +++ b/doc/FontId.3 @@ -3,12 +3,12 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_FontId 3 8.0 Tk "Tk Library Procedures" .so man.macros .BS .SH NAME -Tk_FontId, Tk_GetFontMetrics, Tk_PostscriptFontName \- accessor functions for +Tk_FontId, Tk_GetFontMetrics, Tk_PostscriptFontName \- accessor functions for fonts .SH SYNOPSIS .nf @@ -37,7 +37,7 @@ Postscript font that corresponds to \fItkfont\fR will be appended. .PP Given a \fItkfont\fR, \fBTk_FontId\fR returns the token that should be selected into an XGCValues structure in order to construct a graphics -context that can be used to draw text in the specified font. +context that can be used to draw text in the specified font. .PP \fBTk_GetFontMetrics\fR computes the ascent, descent, and linespace of the \fItkfont\fR in pixels and stores those values in the structure pointer to by @@ -45,7 +45,7 @@ context that can be used to draw text in the specified font. multiple lines of text, to align the baselines of text in different fonts, and to vertically align text in a given region. See the documentation for the \fBfont\fR command for definitions of the terms -ascent, descent, and linespace, used in font metrics. +ascent, descent, and linespace, used in font metrics. .PP \fBTk_PostscriptFontName\fR maps a \fItkfont\fR to the corresponding Postscript font name that should be used when printing. The return value @@ -56,10 +56,10 @@ appended to \fIdsPtr\fR. \fIDsPtr\fR must refer to an initialized Postscript printer, the following screen font families should print correctly: .IP -\fBAvant Garde\fR, \fBArial\fR, \fBBookman\fR, \fBCourier\fR, +\fBAvant Garde\fR, \fBArial\fR, \fBBookman\fR, \fBCourier\fR, \fBCourier New\fR, \fBGeneva\fR, \fBHelvetica\fR, \fBMonaco\fR, \fBNew Century Schoolbook\fR, \fBNew York\fR, \fBPalatino\fR, \fBSymbol\fR, -\fBTimes\fR, \fBTimes New Roman\fR, \fBZapf Chancery\fR, and +\fBTimes\fR, \fBTimes New Roman\fR, \fBZapf Chancery\fR, and \fBZapf Dingbats\fR. .PP Any other font families may not print correctly because the computed diff --git a/doc/GetColor.3 b/doc/GetColor.3 index 9d07d95..15254aa 100644 --- a/doc/GetColor.3 +++ b/doc/GetColor.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_AllocColorFromObj 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS @@ -127,7 +127,7 @@ This package maintains a database of all the colors currently in use. If the same color is requested multiple times from \fBTk_GetColor\fR or \fBTk_AllocColorFromObj\fR (e.g. by different -windows), or if the +windows), or if the same intensities are requested multiple times from \fBTk_GetColorByValue\fR, then existing pixel values will be re-used. Re-using an existing pixel avoids any interaction diff --git a/doc/GetCursor.3 b/doc/GetCursor.3 index 8526a47..403c05e 100644 --- a/doc/GetCursor.3 +++ b/doc/GetCursor.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_AllocCursorFromObj 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS @@ -118,7 +118,7 @@ in preference to black and white cursors. In this form, \fIsourceName\fR and \fImaskName\fR are the names of files describing cursors for the cursor's source bits and mask. Each file must be in standard X11 cursor format. -\fIFgColor\fR and \fIbgColor\fR +\fIFgColor\fR and \fIbgColor\fR indicate the colors to use for the cursor, in any of the forms acceptable to \fBTk_GetColor\fR. This form of the command will not work on Macintosh or Windows computers. diff --git a/doc/GetFont.3 b/doc/GetFont.3 index cf02f00..0504916 100644 --- a/doc/GetFont.3 +++ b/doc/GetFont.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_AllocFontFromObj 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS @@ -14,19 +14,19 @@ Tk_AllocFontFromObj, Tk_GetFont, Tk_GetFontFromObj, Tk_NameOfFont, Tk_FreeFontFr .nf \fB#include \fR .sp -Tk_Font +Tk_Font \fBTk_AllocFontFromObj(\fIinterp, tkwin, objPtr\fB)\fR .sp -Tk_Font -\fBTk_GetFont(\fIinterp, tkwin, string\fB)\fR +Tk_Font +\fBTk_GetFont(\fIinterp, tkwin, string\fB)\fR .sp -Tk_Font +Tk_Font \fBTk_GetFontFromObj(\fItkwin, objPtr\fB)\fR .sp const char * \fBTk_NameOfFont(\fItkfont\fB)\fR .sp -Tk_Font +Tk_Font \fBTk_FreeFontFromObj(\fItkwin, objPtr\fB)\fR .sp void @@ -55,7 +55,7 @@ returns a token that represents the font. The return value can be used in subsequent calls to procedures such as \fBTk_GetFontMetrics\fR, \fBTk_MeasureChars\fR, and \fBTk_FreeFont\fR. The Tk_Font token will remain valid until -\fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR is called to release it. +\fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR is called to release it. \fIObjPtr\fR can contain either a symbolic name or a font description; see the documentation for the \fBfont\fR command for a description of the valid formats. If \fBTk_AllocFontFromObj\fR is unsuccessful (because, diff --git a/doc/MapWindow.3 b/doc/MapWindow.3 index 8abce64..a3c6296 100644 --- a/doc/MapWindow.3 +++ b/doc/MapWindow.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_MapWindow 3 "" Tk "Tk Library Procedures" .so man.macros .BS @@ -35,9 +35,9 @@ deferred window creation. from the screen. .PP If \fItkwin\fR is a child window (i.e. \fBTk_CreateWindow\fR was -used to create a child window), then event handlers interested in map -and unmap events are invoked immediately. If \fItkwin\fR is not an -internal window, then the event handlers will be invoked later, after +used to create a child window), then event handlers interested in map +and unmap events are invoked immediately. If \fItkwin\fR is not an +internal window, then the event handlers will be invoked later, after X has seen the request and returned an event for it. .PP These procedures should be used in place of the X procedures diff --git a/doc/MeasureChar.3 b/doc/MeasureChar.3 index 7433451..3959978 100644 --- a/doc/MeasureChar.3 +++ b/doc/MeasureChar.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_MeasureChars 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS @@ -32,7 +32,7 @@ returned by a previous call to \fBTk_GetFont\fR. Text to be measured or displayed. Need not be null terminated. Any non-printing meta-characters in the string (such as tabs, newlines, and other control characters) will be measured or displayed in a -platform-dependent manner. +platform-dependent manner. .AP int numBytes in The maximum number of bytes to consider when measuring or drawing \fIstring\fR. Must be greater than or equal to 0. @@ -60,11 +60,11 @@ Display on which to draw. .AP Drawable drawable in Window or pixmap in which to draw. .AP GC gc in -Graphics context for drawing characters. The font selected into this GC +Graphics context for drawing characters. The font selected into this GC must be the same as the \fItkfont\fR. .AP int "x, y" in Coordinates at which to place the left edge of the baseline when displaying -\fIstring\fR. +\fIstring\fR. .AP int firstByte in The index of the first byte of the first character to underline in the \fIstring\fR. Underlining begins at the left edge of this character. @@ -80,7 +80,7 @@ single-line strings. To measure and display single-font, multi-line, justified text, refer to the documentation for \fBTk_ComputeTextLayout\fR. There is no programming interface in the core of Tk that supports multi-font, multi-line text; support for that behavior must be built on -top of simpler layers. +top of simpler layers. Note that the interfaces described here are byte-oriented not character-oriented, so index values coming from Tcl scripts need to be converted to byte offsets using the @@ -95,7 +95,7 @@ escape sequences, while under Windows and Macintosh hollow or solid boxes may be substituted. Refer to the documentation for \fBTk_ComputeTextLayout\fR for a programming interface that supports the platform-independent expansion of tab characters into columns and -newlines/returns into multi-line text. +newlines/returns into multi-line text. .PP \fBTk_MeasureChars\fR is used both to compute the length of a given string and to compute how many characters from a string fit in a given @@ -106,12 +106,12 @@ value will be \fInumBytes\fR. \fI*lengthPtr\fR is filled with the computed width, in pixels, of the portion of the string that was measured. For example, if the return value is 5, then \fI*lengthPtr\fR is filled with the distance between the left edge of \fIstring\fR[0] and the right edge of -\fIstring\fR[4]. +\fIstring\fR[4]. .PP \fBTk_TextWidth\fR is a wrapper function that provides a simpler interface to the \fBTk_MeasureChars\fR function. The return value is how much space in pixels the given \fIstring\fR needs. -.PP +.PP \fBTk_DrawChars\fR draws the \fIstring\fR at the given location in the given \fIdrawable\fR. .PP @@ -120,7 +120,7 @@ given \fIstring\fR. It does not draw the characters (which are assumed to have been displayed previously by \fBTk_DrawChars\fR); it just draws the underline. This procedure is used to underline a few characters without having to construct an underlined font. To produce natively underlined -text, the appropriate underlined font should be constructed and used. +text, the appropriate underlined font should be constructed and used. .SH "SEE ALSO" font(n), FontId(3) .SH KEYWORDS diff --git a/doc/TextLayout.3 b/doc/TextLayout.3 index 3863ee7..5729a44 100644 --- a/doc/TextLayout.3 +++ b/doc/TextLayout.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_ComputeTextLayout 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS @@ -48,7 +48,7 @@ have been returned by a previous call to \fBTk_GetFont\fR. .AP "const char" *string in Potentially multi-line string whose dimensions are to be computed and stored in the text layout. The \fIstring\fR must remain valid for the -lifetime of the text layout. +lifetime of the text layout. .AP int numChars in The number of characters to consider from \fIstring\fR. If \fInumChars\fR is less than 0, then assumes \fIstring\fR is null @@ -77,7 +77,7 @@ measured and displayed in a platform-dependent manner as described in \fBTk_MeasureChars\fR, and will not have any special behaviors. .AP int *widthPtr out If non-NULL, filled with either the width, in pixels, of the widest -line in the text layout, or the width, in pixels, of the bounding box for the +line in the text layout, or the width, in pixels, of the bounding box for the character specified by \fIindex\fR. .AP int *heightPtr out If non-NULL, filled with either the total height, in pixels, of all @@ -101,7 +101,7 @@ text layout when it is being drawn, or the coordinates of a point (with respect to the upper-left hand corner of the text layout) to check against the text layout. .AP int firstChar in -The index of the first character to draw from the given text layout. +The index of the first character to draw from the given text layout. The number 0 means to draw from the beginning. .AP int lastChar in The index of the last character up to which to draw. The character @@ -119,7 +119,7 @@ for the character specified by \fIindex\fR. Either or both \fIxPtr\fR and \fIyPtr\fR may be NULL, in which case the corresponding value is not calculated. .AP int "width, height" in -Specifies the width and height, in pixels, of the rectangular area to +Specifies the width and height, in pixels, of the rectangular area to compare for intersection against the text layout. .AP Tcl_Interp *interp out Postscript code that will print the text layout is appended to @@ -132,7 +132,7 @@ justified text. To measure and display simple single-font, single-line strings, refer to the documentation for \fBTk_MeasureChars\fR. There is no programming interface in the core of Tk that supports multi-font, multi-line text; support for that behavior must be built on top of -simpler layers. +simpler layers. Note that unlike the lower level text display routines, the functions described here all operate on character-oriented lengths and indices rather than byte-oriented values. See the description of @@ -150,11 +150,11 @@ returns a Tk_TextLayout token that holds this information. This token is used in subsequent calls to procedures such as \fBTk_DrawTextLayout\fR, \fBTk_DistanceToTextLayout\fR, and \fBTk_FreeTextLayout\fR. The \fIstring\fR and \fItkfont\fR used when computing the layout must remain -valid for the lifetime of this token. +valid for the lifetime of this token. .PP \fBTk_FreeTextLayout\fR is called to release the storage associated with \fIlayout\fR when it is no longer needed. A \fIlayout\fR should not be used -in any other text layout procedures once it has been released. +in any other text layout procedures once it has been released. .PP \fBTk_DrawTextLayout\fR uses the information in \fIlayout\fR to display a single-font, multi-line, justified string of text at the specified location. @@ -191,7 +191,7 @@ placeholder character. \fBTk_CharBbox\fR uses the information in \fIlayout\fR to return the bounding box for the character specified by \fIindex\fR. The width of the bounding box is the advance width of the character, and does not include any -left or right bearing. Any character that extends partially outside of +left or right bearing. Any character that extends partially outside of \fIlayout\fR is considered to be truncated at the edge. Any character that would be located completely outside of \fIlayout\fR is considered to be zero-width and pegged against the edge. The height of the bounding @@ -264,13 +264,13 @@ much as fits placed on the line and the rest on subsequent line(s). If \fIwrapLength\fR is so small that not even one character can fit on a given line, the \fIwrapLength\fR is ignored for that line and one character will be placed on the line anyhow. When wrapping is turned -off, only newline/return characters may cause a line break. +off, only newline/return characters may cause a line break. .PP When a text layout has been created using an underlined \fItkfont\fR, then any space characters that occur at the end of individual lines, -newlines/returns, and tabs will not be displayed underlined when +newlines/returns, and tabs will not be displayed underlined when \fBTk_DrawTextLayout\fR is called, because those characters are never actually drawn \- they are merely placeholders maintained in the -\fIlayout\fR. +\fIlayout\fR. .SH KEYWORDS font diff --git a/doc/Tk_Main.3 b/doc/Tk_Main.3 index a1bb149..ea5f771 100644 --- a/doc/Tk_Main.3 +++ b/doc/Tk_Main.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_Main 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS @@ -29,7 +29,7 @@ The value for this argument is usually \fBTcl_AppInit\fR. .SH DESCRIPTION .PP \fBTk_Main\fR acts as the main program for most Tk-based applications. -Starting with Tk 4.0 it is not called \fBmain\fR anymore because it +Starting with Tk 4.0 it is not called \fBmain\fR anymore because it is part of the Tk library and having a function \fBmain\fR in a library (particularly a shared library) causes problems on many systems. diff --git a/doc/WindowId.3 b/doc/WindowId.3 index 6d55dc0..f937963 100644 --- a/doc/WindowId.3 +++ b/doc/WindowId.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_WindowId 3 "8.4" Tk "Tk Library Procedures" .so man.macros .BS @@ -168,7 +168,7 @@ the window's minimum requested size. These values correspond to the last call to \fBTk_SetMinimumRequestSize\fR for \fItkwin\fR. .PP \fBTk_InternalBorderLeft\fR, \fBTk_InternalBorderRight\fR, -\fBTk_InternalBorderTop\fR and \fBTk_InternalBorderBottom\fR +\fBTk_InternalBorderTop\fR and \fBTk_InternalBorderBottom\fR return the width of one side of the internal border that has been requested for \fItkwin\fR, or 0 if no internal border was requested. The return value is simply the last value passed to diff --git a/doc/button.n b/doc/button.n index e9a45a3..233feb6 100644 --- a/doc/button.n +++ b/doc/button.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH button n 4.4 Tk "Tk Built-In Commands" .so man.macros .BS @@ -69,7 +69,7 @@ In this state the \fB\-disabledforeground\fR and Specifies a desired width for the button. If an image or bitmap is being displayed in the button then the value is in screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR). -For a text button (no image or with \fB\-compound none\fR) then the width +For a text button (no image or with \fB\-compound none\fR) then the width specifies how much space in characters to allocate for the text label. If the width is negative then this specifies a minimum width. If this option is not specified, the button's desired width is computed @@ -96,7 +96,7 @@ one of the characters may optionally be underlined using the \fB\-underline\fR option. It can display itself in either of three different ways, according to -the \fB\-state\fR option; +the \fB\-state\fR option; it can be made to appear raised, sunken, or flat; and it can be made to flash. When a user invokes the button (by pressing mouse button 1 with the cursor over the diff --git a/doc/checkbutton.n b/doc/checkbutton.n index 2e6f840..bfefca4 100644 --- a/doc/checkbutton.n +++ b/doc/checkbutton.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH checkbutton n 4.4 Tk "Tk Built-In Commands" .so man.macros .BS @@ -52,7 +52,7 @@ and setting \fB\-indicatoron\fR to false and \fB\-overrelief\fR to the effect is achieved of having a flat button that raises on mouse-over and which is depressed when activated. This is the behavior typically exhibited by -the Bold, Italic, and Underline checkbuttons on the toolbar of a +the Bold, Italic, and Underline checkbuttons on the toolbar of a word-processor, for example. .OP \-offvalue offValue Value Specifies value to store in the button's associated variable whenever diff --git a/doc/chooseDirectory.n b/doc/chooseDirectory.n index 86c593d..8528ddb 100644 --- a/doc/chooseDirectory.n +++ b/doc/chooseDirectory.n @@ -1,7 +1,7 @@ '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" .TH tk_chooseDirectory n 8.3 Tk "Tk Built-In Commands" .so man.macros .BS @@ -20,7 +20,7 @@ possible as command line arguments: \fB\-initialdir\fR \fIdirname\fR Specifies that the directories in \fIdirectory\fR should be displayed when the dialog pops up. If this parameter is not specified, -the initial directory defaults to the current working directory +the initial directory defaults to the current working directory on non-Windows systems and on Windows systems prior to Vista. On Vista and later systems, the initial directory defaults to the last user-selected directory for the application. If the diff --git a/doc/clipboard.n b/doc/clipboard.n index 374cbd1..6f047dd 100644 --- a/doc/clipboard.n +++ b/doc/clipboard.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH clipboard n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS @@ -17,7 +17,7 @@ clipboard \- Manipulate Tk clipboard .SH DESCRIPTION .PP This command provides a Tcl interface to the Tk clipboard, -which stores data for later retrieval using the selection mechanism +which stores data for later retrieval using the selection mechanism (via the \fB\-selection CLIPBOARD\fR option). In order to copy data into the clipboard, \fBclipboard clear\fR must be called, followed by a sequence of one or more calls to \fBclipboard @@ -52,7 +52,7 @@ Table 2 of the ICCCM), and defaults to \fBSTRING\fR. If \fIformat\fR is divided into fields separated by white space; each field is converted to its atom value, and the 32-bit atom value is transmitted instead of the atom name. For any other \fIformat\fR, \fIdata\fR is divided -into fields separated by white space and each +into fields separated by white space and each field is converted to a 32-bit integer; an array of integers is transmitted to the selection requester. Note that strings passed to \fBclipboard append\fR are concatenated before conversion, so the diff --git a/doc/event.n b/doc/event.n index 7a3cfca..12433cb 100644 --- a/doc/event.n +++ b/doc/event.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH event n 8.3 Tk "Tk Built-In Commands" .so man.macros .BS @@ -172,7 +172,7 @@ one of \fBNotifyNormal\fR, \fBNotifyGrab\fR, \fBNotifyUngrab\fR, or \fBNotifyWhileGrabbed\fR. Valid for \fBEnter\fR, \fBLeave\fR, \fBFocusIn\fR, and \fBFocusOut\fR events. -Corresponds to the \fB%m\fR substitution for binding scripts. +Corresponds to the \fB%m\fR substitution for binding scripts. .TP \fB\-override\fI boolean\fR \fIBoolean\fR must be a boolean value; it specifies the @@ -224,7 +224,7 @@ Corresponds to the \fB%#\fR substitution for binding scripts. For \fBKeyPress\fR, \fBKeyRelease\fR, \fBButtonPress\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events it must be an integer value. -For \fBVisibility\fR events it must be one of \fBVisibilityUnobscured\fR, +For \fBVisibility\fR events it must be one of \fBVisibilityUnobscured\fR, \fBVisibilityPartiallyObscured\fR, or \fBVisibilityFullyObscured\fR. This option overrides any modifiers such as \fBMeta\fR or \fBControl\fR specified in the base \fIevent\fR. @@ -302,9 +302,9 @@ If \fIWindow\fR is empty the coordinate is relative to the screen, and this option corresponds to the \fB%Y\fR substitution for binding scripts. .PP -Any options that are not specified when generating an event are filled -with the value 0, except for \fIserial\fR, which is filled with the -next X event serial number. +Any options that are not specified when generating an event are filled +with the value 0, except for \fIserial\fR, which is filled with the +next X event serial number. .SH "PREDEFINED VIRTUAL EVENTS" .PP Tk defines the following virtual events for the purposes of @@ -540,7 +540,7 @@ will be invoked, because a physical event is considered more specific than a virtual event, all other things being equal. However, when the user types Meta-Control-y the \fB<>\fR binding will be invoked, because the -\fBMeta\fR modifier in the physical pattern associated with the +\fBMeta\fR modifier in the physical pattern associated with the virtual binding is more specific than the \fB sequence for the physical event. .PP @@ -560,7 +560,7 @@ bind Entry {} .PP the behavior will change such in two ways. First, the shadowed \fB<>\fR binding will emerge. -Typing Control-y will no longer invoke the \fB\fR binding, +Typing Control-y will no longer invoke the \fB\fR binding, but instead invoke the virtual event \fB<>\fR. Second, pressing the F6 key will now also invoke the \fB<>\fR binding. .SS "MOVING THE MOUSE POINTER" diff --git a/doc/font.n b/doc/font.n index 49d8aad..72f9270 100644 --- a/doc/font.n +++ b/doc/font.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH font n 8.0 Tk "Tk Built-In Commands" .so man.macros .BS @@ -38,7 +38,7 @@ that character, which will be different from the base font if the base font does not contain the given character. If \fIchar\fR may be a hyphen, it should be preceded by \fB\-\|\-\fR to distinguish it from a misspelled \fIoption\fR. -.TP +.TP \fBfont configure \fIfontname\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . Query or modify the desired attributes for the named font called @@ -88,7 +88,7 @@ omitted, it defaults to the main window. Measures the amount of space the string \fItext\fR would use in the given \fIfont\fR when displayed in \fIwindow\fR. \fIfont\fR is a font description; see \fBFONT DESCRIPTIONS\fR below. If the \fIwindow\fR argument is -omitted, it +omitted, it defaults to the main window. The return value is the total width in pixels of \fItext\fR, not including the extra pixels used by highly exaggerated characters such as cursive diff --git a/doc/getOpenFile.n b/doc/getOpenFile.n index f5e92ff..39bce41 100644 --- a/doc/getOpenFile.n +++ b/doc/getOpenFile.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tk_getOpenFile n 4.2 Tk "Tk Built-In Commands" .so man.macros .BS @@ -65,8 +65,8 @@ discussion on the contents of \fIfilePatternList\fR. \fB\-initialdir\fR \fIdirectory\fR . Specifies that the files in \fIdirectory\fR should be displayed -when the dialog pops up. If this parameter is not specified, -the initial directory defaults to the current working directory +when the dialog pops up. If this parameter is not specified, +the initial directory defaults to the current working directory on non-Windows systems and on Windows systems prior to Vista. On Vista and later systems, the initial directory defaults to the last user-selected directory for the application. If the @@ -95,7 +95,7 @@ turns the file dialog into a sheet attached to the parent window. \fB\-title\fR \fItitleString\fR . Specifies a string to display as the title of the dialog box. If this -option is not specified, then a default title is displayed. +option is not specified, then a default title is displayed. .TP \fB\-typevariable\fR \fIvariableName\fR . diff --git a/doc/listbox.n b/doc/listbox.n index 0f263b4..66b75b9 100644 --- a/doc/listbox.n +++ b/doc/listbox.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH listbox n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS @@ -229,7 +229,7 @@ list. Returns an empty string. \fIpathName \fBitemcget \fIindex option\fR . Returns the current value of the item configuration option given -by \fIoption\fR. \fIOption\fR may have any of the values accepted +by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBitemconfigure\fR command. .TP \fIpathName \fBitemconfigure \fIindex\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR? @@ -249,7 +249,7 @@ are currently supported for items: .TP \fB\-background \fIcolor\fR . -\fIColor\fR specifies the background color to use when displaying the +\fIColor\fR specifies the background color to use when displaying the item. It may have any of the forms accepted by \fBTk_GetColor\fR. .TP \fB\-foreground \fIcolor\fR diff --git a/doc/loadTk.n b/doc/loadTk.n index d4ec51e..3673e98 100644 --- a/doc/loadTk.n +++ b/doc/loadTk.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH "Safe Tk" n 8.0 Tk "Tk Built-In Commands" .so man.macros .BS @@ -11,7 +11,7 @@ .SH NAME safe::loadTk \- Load Tk into a safe interpreter. .SH SYNOPSIS -\fBsafe::loadTk \fIslave\fR ?\fB\-use\fR \fIwindowId\fR? ?\fB\-display\fR \fIdisplayName\fR? +\fBsafe::loadTk \fIslave\fR ?\fB\-use\fR \fIwindowId\fR? ?\fB\-display\fR \fIdisplayName\fR? .BE .SH DESCRIPTION .PP diff --git a/doc/menu.n b/doc/menu.n index 1067f38..ed1bb33 100644 --- a/doc/menu.n +++ b/doc/menu.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH menu n 4.1 Tk "Tk Built-In Commands" .so man.macros .BS @@ -269,8 +269,8 @@ are appended to the standard Help menu of the user's menubar whenever the window's menubar is in front. The first items in the menu are provided by Mac OS X. .PP -When Tk sees a System menu on Windows, its items are appended to the -system menu that the menubar is attached to. This menu is tied to the +When Tk sees a System menu on Windows, its items are appended to the +system menu that the menubar is attached to. This menu is tied to the application icon and can be invoked with the mouse or by typing Alt+Spacebar. Due to limitations in the Windows API, any font changes, colors, images, bitmaps, or tearoff images will not appear in the @@ -676,7 +676,7 @@ option for the menu along with the \fB\-activebackground\fR option from the entry. Disabled state means that the entry should be insensitive: the default bindings will refuse to activate or invoke the entry. -In this state the entry is displayed according to the +In this state the entry is displayed according to the \fB\-disabledforeground\fR option for the menu and the \fB\-background\fR option from the entry. This option is not available for separator entries. diff --git a/doc/options.n b/doc/options.n index 36937b1..738a1c6 100644 --- a/doc/options.n +++ b/doc/options.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH options n 4.4 Tk "Tk Built-In Commands" .so man.macros .BS @@ -268,7 +268,7 @@ traversal (e.g., Tab and Shift-Tab). Before setting the focus to a window, the traversal scripts consult the value of the \fB\-takefocus\fR option. A value of \fB0\fR means that the window should be skipped entirely -during keyboard traversal. +during keyboard traversal. \fB1\fR means that the window should receive the input focus as long as it is viewable (it and all of its ancestors are mapped). An empty value for the option means that the traversal scripts make @@ -278,7 +278,7 @@ disabled, if it has no key bindings, or if it is not viewable. If the value has any other form, then the traversal scripts take the value, append the name of the window to it (with a separator space), and evaluate the resulting string as a Tcl script. -The script must return \fB0\fR, \fB1\fR, or an empty string: a +The script must return \fB0\fR, \fB1\fR, or an empty string: a \fB0\fR or \fB1\fR value specifies whether the window will receive the input focus, and an empty string results in the default decision described above. diff --git a/doc/panedwindow.n b/doc/panedwindow.n index e2c954a..fcfebf4 100644 --- a/doc/panedwindow.n +++ b/doc/panedwindow.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH panedwindow n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS @@ -151,7 +151,7 @@ Remove the proxy from the display. .TP \fIpathName \fBproxy place \fIx y\fR . -Place the proxy at the given \fIx\fR and \fIy\fR coordinates. +Place the proxy at the given \fIx\fR and \fIy\fR coordinates. .RE .TP \fIpathName \fBsash \fR?\fIargs\fR? @@ -239,13 +239,13 @@ dimension for vertical panedwindows. May be any value accepted by \fB\-padx \fIn\fR . Specifies a non-negative value indicating how much extra space to -leave on each side of the window in the X-direction. The value may +leave on each side of the window in the X-direction. The value may have any of the forms accepted by \fBTk_GetPixels\fR. .TP \fB\-pady \fIn\fR . Specifies a non-negative value indicating how much extra space to -leave on each side of the window in the Y-direction. The value may +leave on each side of the window in the Y-direction. The value may have any of the forms accepted by \fBTk_GetPixels\fR. .TP \fB\-sticky \fIstyle\fR diff --git a/doc/radiobutton.n b/doc/radiobutton.n index 557b42c..c79aa23 100644 --- a/doc/radiobutton.n +++ b/doc/radiobutton.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH radiobutton n 4.4 Tk "Tk Built-In Commands" .so man.macros .BS @@ -59,10 +59,10 @@ By setting this option to .QW flat and setting \fB\-indicatoron\fR to false and \fB\-overrelief\fR to .QW raised , -the effect is achieved +the effect is achieved of having a flat button that raises on mouse-over and which is depressed when activated. This is the behavior typically exhibited by -the Align-Left, Align-Right, and Center radiobuttons on the toolbar of a +the Align-Left, Align-Right, and Center radiobuttons on the toolbar of a word-processor, for example. .OP \-overrelief overRelief OverRelief Specifies an alternative relief for the radiobutton, to be used when the diff --git a/doc/scale.n b/doc/scale.n index 7bc5c59..0504b4b 100644 --- a/doc/scale.n +++ b/doc/scale.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH scale n 4.1 Tk "Tk Built-In Commands" .so man.macros .BS @@ -209,7 +209,7 @@ the horizontal behavior is described in parentheses. .IP [1] If button 1 is pressed in the trough, the scale's value will be incremented or decremented by the value of the \fB\-resolution\fR -option so that the slider moves in the direction of the cursor. +option so that the slider moves in the direction of the cursor. If the button is held down, the action auto-repeats. .IP [2] If button 1 is pressed over the slider, the slider can be dragged diff --git a/doc/selection.n b/doc/selection.n index e06a716..f5bb660 100644 --- a/doc/selection.n +++ b/doc/selection.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH selection n 8.1 Tk "Tk Built-In Commands" .so man.macros .BS @@ -36,7 +36,7 @@ atom name such as \fBPRIMARY\fR or \fBCLIPBOARD\fR; see the Inter-Client Communication Conventions Manual for complete details. \fISelection\fR defaults to \fBPRIMARY\fR and \fIwindow\fR defaults to .QW . . -Returns an empty string. +Returns an empty string. .TP \fBselection get\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR? ?\fB\-type\fR \fItype\fR? . @@ -79,7 +79,7 @@ automatically handled as type \fBUTF8_STRING\fR as well. When \fIselection\fR is requested, \fIwindow\fR is the selection owner, and \fItype\fR is the requested type, \fIcommand\fR will be executed as a Tcl command with two additional numbers appended to it -(with space separators). +(with space separators). The two additional numbers are \fIoffset\fR and \fImaxChars\fR: \fIoffset\fR specifies a starting character position in the selection and \fImaxChars\fR gives the maximum diff --git a/doc/tkerror.n b/doc/tkerror.n index 0780901..53cb0d1 100644 --- a/doc/tkerror.n +++ b/doc/tkerror.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tkerror n 4.1 Tk "Tk Built-In Commands" .so man.macros .BS @@ -20,11 +20,11 @@ Note: as of Tk 4.1 the \fBtkerror\fR command has been renamed to \fBbgerror\fR because the event loop (which is what usually invokes it) is now part of Tcl. For backward compatibility the \fBbgerror\fR provided by the current Tk version still -tries to call \fBtkerror\fR if there is one (or an auto loadable one), +tries to call \fBtkerror\fR if there is one (or an auto loadable one), so old script defining that error handler should still work, but you -should anyhow modify your scripts to use \fBbgerror\fR instead +should anyhow modify your scripts to use \fBbgerror\fR instead of \fBtkerror\fR because that support for the old name might vanish -in the near future. If that call fails, \fBbgerror\fR +in the near future. If that call fails, \fBbgerror\fR posts a dialog showing the error and offering to see the stack trace to the user. If you want your own error management you should directly override \fBbgerror\fR instead of \fBtkerror\fR. diff --git a/doc/ttk_Geometry.3 b/doc/ttk_Geometry.3 index 8dfae37..61015c5 100644 --- a/doc/ttk_Geometry.3 +++ b/doc/ttk_Geometry.3 @@ -75,7 +75,7 @@ Used to store error messages. .AP int left in Extra padding (in pixels) to add to the left side of a region. .AP "Tcl_Obj *" objPtr in -String value contains a symbolic name +String value contains a symbolic name to be converted to an enumerated value or bitmask. Internal rep may be be modified to cache corresponding value. .AP Ttk_Padding padding in @@ -84,18 +84,18 @@ Extra padding to add on the inside of a region. .AP Ttk_Box parcel in A rectangular region, allocated from a cavity. .AP int relief in -One of the standard Tk relief options -(TK_RELIEF_RAISED, TK_RELIEF_SUNKEN, etc.). +One of the standard Tk relief options +(TK_RELIEF_RAISED, TK_RELIEF_SUNKEN, etc.). See \fBTk_GetReliefFromObj\fR. .AP short right in Extra padding (in pixels) to add to the right side of a region. .AP Ttk_Side side in -One of \fBTTK_SIDE_LEFT\fR, \fBTTK_SIDE_TOP\fR, +One of \fBTTK_SIDE_LEFT\fR, \fBTTK_SIDE_TOP\fR, \fBTTK_SIDE_RIGHT\fR, or \fBTTK_SIDE_BOTTOM\fR. .AP unsigned sticky in A bitmask containing one or more of the bits -\fBTTK_STICK_W\fR (west, or left), -\fBTTK_STICK_E\fR (east, or right, +\fBTTK_STICK_W\fR (west, or left), +\fBTTK_STICK_E\fR (east, or right, \fBTTK_STICK_N\fR (north, or top), and \fBTTK_STICK_S\fR (south, or bottom). \fBTTK_FILL_X\fR is defined as a synonym for (TTK_STICK_W|TTK_STICK_E), @@ -104,7 +104,7 @@ and \fBTTK_FILL_BOTH\fR and \fBTTK_STICK_ALL\fR are synonyms for (TTK_FILL_X|TTK_FILL_Y). See also: \fIgrid(n)\fR. .AP Tk_Window tkwin in -Window whose screen geometry determines +Window whose screen geometry determines the conversion between absolute units and pixels. .AP short top in Extra padding at the top of a region. @@ -184,14 +184,14 @@ with all components equal to the specified \fIborder\fR. and returns a combined padding containing the sum of the individual padding components. .PP -\fBTtk_RelievePadding\fR +\fBTtk_RelievePadding\fR adds an extra 2 pixels of padding to \fIpadding\fR according to the specified \fIrelief\fR. -If \fIrelief\fR is \fBTK_RELIEF_SUNKEN\fR, +If \fIrelief\fR is \fBTK_RELIEF_SUNKEN\fR, adds two pixels at the top and left so the inner region is shifted down and to the left. If it is \fBTK_RELIEF_RAISED\fR, adds two pixels -at the bottom and right so +at the bottom and right so the inner region is shifted up and to the right. Otherwise, adds 1 pixel on all sides. This is typically used in element geometry procedures to simulate a @@ -201,17 +201,17 @@ look for pushbuttons. .PP \fBTtk_GetPaddingFromObj\fR converts the string in \fIobjPtr\fR to a \fBTtk_Padding\fR structure. -The string representation is a list of -up to four length specifications +The string representation is a list of +up to four length specifications .QW "\fIleft top right bottom\fR" . -If fewer than four elements are specified, +If fewer than four elements are specified, \fIbottom\fR defaults to \fItop\fR, -\fIright\fR defaults to \fIleft\fR, and +\fIright\fR defaults to \fIleft\fR, and \fItop\fR defaults to \fIleft\fR. See \fBTk_GetPixelsFromObj(3)\fR for the syntax of length specifications. .PP \fBTtk_GetBorderFromObj\fR is the same as \fBTtk_GetPaddingFromObj\fR -except that the lengths are specified as integers +except that the lengths are specified as integers (i.e., resolution-dependant values like \fI3m\fR are not allowed). .PP \fBTtk_GetStickyFromObj\fR converts the string in \fIobjPtr\fR diff --git a/doc/ttk_button.n b/doc/ttk_button.n index 2f3c845..62ebe47 100644 --- a/doc/ttk_button.n +++ b/doc/ttk_button.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::button n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -36,12 +36,12 @@ button (meaning, roughly, The default is \fBnormal\fR. .RS .PP -Depending on the theme, the default button may be displayed +Depending on the theme, the default button may be displayed with an extra highlight ring, or with a different border color. .RE .OP \-width width Width -If greater than zero, specifies how much space, in character widths, -to allocate for the text label. +If greater than zero, specifies how much space, in character widths, +to allocate for the text label. If less than zero, specifies a minimum width. If zero or unspecified, the natural width of the text label is used. Note that some themes may specify a non-zero \fB\-width\fR @@ -55,8 +55,8 @@ in the style. .\" .OP \-relief relief Relief .SH "WIDGET COMMAND" .PP -In addition to the standard -\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR +In addition to the standard +\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR commands, buttons support the following additional widget commands: .TP \fIpathName \fBinvoke\fR diff --git a/doc/ttk_checkbutton.n b/doc/ttk_checkbutton.n index 6236503..ed79f5a 100644 --- a/doc/ttk_checkbutton.n +++ b/doc/ttk_checkbutton.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::checkbutton n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -14,7 +14,7 @@ ttk::checkbutton \- On/off widget .BE .SH DESCRIPTION A \fBttk::checkbutton\fR widget is used to show or change a setting. -It has two states, selected and deselected. +It has two states, selected and deselected. The state of the checkbutton may be linked to a Tcl variable. .SO ttk_widget \-class \-compound \-cursor @@ -26,18 +26,18 @@ The state of the checkbutton may be linked to a Tcl variable. .OP \-command command Command A Tcl script to execute whenever the widget is invoked. .OP \-offvalue offValue OffValue -The value to store in the associated \fB\-variable\fR +The value to store in the associated \fB\-variable\fR when the widget is deselected. Defaults to \fB0\fR. .OP \-onvalue onValue OnValue -The value to store in the associated \fB\-variable\fR +The value to store in the associated \fB\-variable\fR when the widget is selected. Defaults to \fB1\fR. .OP \-variable variable Variable The name of a global variable whose value is linked to the widget. Defaults to the widget pathname if not specified. .SH "WIDGET COMMAND" .PP -In addition to the standard -\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR +In addition to the standard +\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR commands, checkbuttons support the following additional widget commands: .TP @@ -48,17 +48,17 @@ If the widget is currently selected, sets the \fB\-variable\fR to the \fB\-offvalue\fR and deselects the widget; otherwise, sets the \fB\-variable\fR to the \fB\-onvalue\fR Returns the result of the \fB\-command\fR. -.\" Missing: select, deselect, toggle +.\" Missing: select, deselect, toggle .\" Are these useful? They don't invoke the -command .\" Missing: flash. This is definitely not useful. .SH "WIDGET STATES" .PP The widget does not respond to user input if the \fBdisabled\fR state is set. -The widget sets the \fBselected\fR state whenever +The widget sets the \fBselected\fR state whenever the linked \fB\-variable\fR is set to the widget's \fB\-onvalue\fR, and clears it otherwise. -The widget sets the \fBalternate\fR state whenever the -linked \fB\-variable\fR is unset. +The widget sets the \fBalternate\fR state whenever the +linked \fB\-variable\fR is unset. (The \fBalternate\fR state may be used to indicate a .QW tri-state or diff --git a/doc/ttk_combobox.n b/doc/ttk_combobox.n index dc1c7d1..5e5b3fc 100644 --- a/doc/ttk_combobox.n +++ b/doc/ttk_combobox.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::combobox n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -15,7 +15,7 @@ ttk::combobox \- text field with popdown selection list .SH DESCRIPTION .PP A \fBttk::combobox\fR combines a text field with a pop-down list of values; -the user may select the value of the text field from among the +the user may select the value of the text field from among the values in the list. .SO ttk_widget \-class \-cursor \-takefocus @@ -37,14 +37,14 @@ The \fB\-postcommand\fR script may specify the \fB\-values\fR to display. .OP \-state state State One of \fBnormal\fR, \fBreadonly\fR, or \fBdisabled\fR. In the \fBreadonly\fR state, -the value may not be edited directly, and +the value may not be edited directly, and the user can only select one of the \fB\-values\fR from the dropdown list. -In the \fBnormal\fR state, +In the \fBnormal\fR state, the text field is directly editable. In the \fBdisabled\fR state, no interaction is possible. .OP \-textvariable textVariable TextVariable -Specifies the name of a global variable whose value is linked +Specifies the name of a global variable whose value is linked to the widget value. Whenever the variable changes value the widget value is updated, and vice versa. @@ -66,7 +66,7 @@ The following subcommands are possible for combobox widgets: '\"See \fIttk::widget(n)\fR. .TP \fIpathName \fBcurrent\fR ?\fInewIndex\fR? -If \fInewIndex\fR is supplied, sets the combobox value +If \fInewIndex\fR is supplied, sets the combobox value to the element at position \fInewIndex\fR in the list of \fB\-values\fR. Otherwise, returns the index of the current value in the list of \fB\-values\fR or \fB\-1\fR if the current value does not appear in the list. diff --git a/doc/ttk_entry.n b/doc/ttk_entry.n index 34779a6..984e957 100644 --- a/doc/ttk_entry.n +++ b/doc/ttk_entry.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::entry n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -18,9 +18,9 @@ ttk::entry \- Editable text field widget .PP An \fBttk::entry\fR widget displays a one-line text string and allows that string to be edited by the user. -The value of the string may be linked to a Tcl variable +The value of the string may be linked to a Tcl variable with the \fB\-textvariable\fR option. -Entry widgets support horizontal scrolling with the +Entry widgets support horizontal scrolling with the standard \fB\-xscrollcommand\fR option and \fBxview\fR widget command. .SO ttk_widget \-class \-cursor \-style @@ -28,7 +28,7 @@ standard \fB\-xscrollcommand\fR option and \fBxview\fR widget command. .SE .SH "WIDGET-SPECIFIC OPTIONS" .OP \-exportselection exportSelection ExportSelection -A boolean value specifying whether or not +A boolean value specifying whether or not a selection in the widget should be linked to the X selection. If the selection is exported, then selecting in the widget deselects the current X selection, selecting outside the widget deselects any @@ -65,7 +65,7 @@ Specifies one of three states for the entry, \fBnormal\fR, \fBdisabled\fR, or \fBreadonly\fR. See \fBWIDGET STATES\fR, below. .OP \-textvariable textVariable Variable -Specifies the name of a global variable whose value is linked +Specifies the name of a global variable whose value is linked to the entry widget's contents. Whenever the variable changes value, the widget's contents are updated, and vice versa. @@ -217,7 +217,7 @@ earlier one, then the entry's selection is cleared. '\"See \fIttk::widget(n)\fR. .TP \fIpathName \fBvalidate\fR -Force revalidation, independent of the conditions specified +Force revalidation, independent of the conditions specified by the \fB\-validate\fR option. Returns 0 if validation fails, 1 if it succeeds. Sets or clears the \fBinvalid\fR state accordingly. @@ -277,20 +277,20 @@ options are used to enable entry widget validation. .PP There are two main validation modes: \fIprevalidation\fR, in which the \fB\-validatecommand\fR is evaluated prior to each edit -and the return value is used to determine whether to accept +and the return value is used to determine whether to accept or reject the change; -and \fIrevalidation\fR, in which the \fB\-validatecommand\fR is +and \fIrevalidation\fR, in which the \fB\-validatecommand\fR is evaluated to determine whether the current value is valid. .PP The \fB\-validate\fR option determines when validation occurs; it may be set to any of the following values: .RS .IP \fBnone\fR -Default. This means validation will only occur when +Default. This means validation will only occur when specifically requested by the \fBvalidate\fR widget command. .IP \fBkey\fR The entry will be prevalidated prior to each edit -(specifically, whenever the \fBinsert\fR or \fBdelete\fR +(specifically, whenever the \fBinsert\fR or \fBdelete\fR widget commands are called). If prevalidation fails, the edit is rejected. .IP \fBfocus\fR @@ -311,20 +311,20 @@ may modify the entry widget's value via the widget \fBinsert\fR or \fBdelete\fR commands, or by setting the linked \fB\-textvariable\fR. If either does so during prevalidation, -then the edit is rejected +then the edit is rejected regardless of the value returned by the \fB\-validatecommand\fR. .PP -If \fB\-validatecommand\fR is empty (the default), +If \fB\-validatecommand\fR is empty (the default), validation always succeeds. .SS "VALIDATION SCRIPT SUBSTITUTIONS" .PP -It is possible to perform percent substitutions on the +It is possible to perform percent substitutions on the \fB\-validatecommand\fR and \fB\-invalidcommand\fR, just as in a \fBbind\fR script. The following substitutions are recognized: .RS .IP \fB%d\fR -Type of action: 1 for \fBinsert\fR prevalidation, +Type of action: 1 for \fBinsert\fR prevalidation, 0 for \fBdelete\fR prevalidation, or \-1 for revalidation. .IP \fB%i\fR @@ -348,19 +348,19 @@ The name of the entry widget. .PP The standard Tk entry widget automatically disables validation (by setting \fB\-validate\fR to \fBnone\fR) -if the \fB\-validatecommand\fR or \fB\-invalidcommand\fR modifies +if the \fB\-validatecommand\fR or \fB\-invalidcommand\fR modifies the entry's value. The Tk themed entry widget only disables validation if one of the validation scripts raises an error, or if \fB\-validatecommand\fR does not return a valid boolean value. -(Thus, it is not necessary to re-enable validation after +(Thus, it is not necessary to re-enable validation after modifying the entry value in a validation script). .PP In addition, the standard entry widget invokes validation whenever the linked \fB\-textvariable\fR is modified; the Tk themed entry widget does not. .SH "DEFAULT BINDINGS" .PP -The entry widget's default bindings enable the following behavior. +The entry widget's default bindings enable the following behavior. In the descriptions below, .QW word refers to a contiguous group of letters, digits, or @@ -442,22 +442,22 @@ Control-k deletes all the characters to the right of the insertion cursor. .SH "WIDGET STATES" .PP -In the \fBdisabled\fR state, +In the \fBdisabled\fR state, the entry cannot be edited and the text cannot be selected. In the \fBreadonly\fR state, -no insert cursor is displayed and -the entry cannot be edited +no insert cursor is displayed and +the entry cannot be edited (specifically: the \fBinsert\fR and \fBdelete\fR commands have no effect). -The \fBdisabled\fR state is the same as \fBreadonly\fR, +The \fBdisabled\fR state is the same as \fBreadonly\fR, and in addition text cannot be selected. .PP -Note that changes to the linked \fB\-textvariable\fR will +Note that changes to the linked \fB\-textvariable\fR will still be reflected in the entry, even if it is disabled or readonly. .PP Typically, the text is .QW grayed-out in the \fBdisabled\fR state, -and a different background is used in the \fBreadonly\fR state. +and a different background is used in the \fBreadonly\fR state. .PP The entry widget sets the \fBinvalid\fR state if revalidation fails, and clears it whenever validation succeeds. diff --git a/doc/ttk_frame.n b/doc/ttk_frame.n index 3b885e0..b54ce96 100644 --- a/doc/ttk_frame.n +++ b/doc/ttk_frame.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::frame n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -22,9 +22,9 @@ together. .SE .SH "WIDGET-SPECIFIC OPTIONS" .OP \-borderwidth borderWidth BorderWidth -The desired width of the widget border. Defaults to 0. +The desired width of the widget border. Defaults to 0. .OP \-relief relief Relief -One of the standard Tk border styles: +One of the standard Tk border styles: \fBflat\fR, \fBgroove\fR, \fBraised\fR, \fBridge\fR, \fBsolid\fR, or \fBsunken\fR. Defaults to \fBflat\fR. diff --git a/doc/ttk_image.n b/doc/ttk_image.n index 99d38c6..4985c20 100644 --- a/doc/ttk_image.n +++ b/doc/ttk_image.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk_image n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -16,7 +16,7 @@ ttk_image \- Define an element based on an image .PP The \fIimage\fR element factory creates a new element in the current theme whose visual appearance is determined -by Tk images. +by Tk images. \fIimageSpec\fP is a list of one or more elements. The first element is the default image name. The rest of the list is a sequence of \fIstatespec / value\fR @@ -36,7 +36,7 @@ Specifies a minimum height for the element. If less than zero, the base image's height is used as a default. .TP \fB\-padding\fR \fIpadding\fR -Specifies the element's interior padding. Defaults to +Specifies the element's interior padding. Defaults to \fB\-border\fR if not specified. .TP \fB\-sticky\fR \fIspec\fR @@ -53,13 +53,13 @@ Specifies a minimum width for the element. If less than zero, the base image's width is used as a default. .SH "IMAGE STRETCHING" .PP -If the element's allocated parcel is larger than the image, +If the element's allocated parcel is larger than the image, the image will be placed in the parcel based on the \fB\-sticky\fR option. If the image needs to stretch horizontally (i.e., \fB\-sticky ew\fR) or vertically (\fB\-sticky ns\fR), subregions of the image are replicated to fill the parcel based on the \fB\-border\fR option. -The \fB\-border\fR divides the image into 9 regions: +The \fB\-border\fR divides the image into 9 regions: four fixed corners, top and left edges (which may be tiled horizontally), left and right edges (which may be tiled vertically), and the central area (which may be tiled in both directions). diff --git a/doc/ttk_intro.n b/doc/ttk_intro.n index baef34d..bc3cd69 100644 --- a/doc/ttk_intro.n +++ b/doc/ttk_intro.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::intro n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -24,7 +24,7 @@ all aspects of the widget's appearance are controlled by the style of the widget (i.e. the style of the elements of the widget). .SH "THEMES" .PP -A \fItheme\fR is a collection of elements and styles +A \fItheme\fR is a collection of elements and styles that determine the look and feel of the widget set. Themes can be used to: .IP \(bu @@ -47,7 +47,7 @@ For example, a vertical scrollbar widget contains \fBuparrow\fR, .PP Element names use a recursive dotted notation. For example, \fBuparrow\fR identifies a generic arrow element, -and \fBScrollbar.uparrow\fR and \fBCombobox.uparrow\fR identify +and \fBScrollbar.uparrow\fR and \fBCombobox.uparrow\fR identify widget-specific elements. When looking for an element, the style engine looks for the specific name first, and if an element of that name is @@ -56,9 +56,9 @@ successive leading components of the element name. .PP Like widgets, elements have \fIoptions\fR which specify what to display and how to display it. -For example, the \fBtext\fR element +For example, the \fBtext\fR element (which displays a text string) has -\fB\-text\fR, \fB\-font\fR, \fB\-foreground\fR, \fB\-background\fR, +\fB\-text\fR, \fB\-font\fR, \fB\-foreground\fR, \fB\-background\fR, \fB\-underline\fR, and \fB\-width\fR options. The value of an element option is taken from: .IP \(bu @@ -105,14 +105,14 @@ and the various flavors of buttons which have \fBactive\fR state. The themed Tk widgets generalizes this idea: every widget has a bitmap of independent state flags. Widget state flags include \fBactive\fR, \fBdisabled\fR, -\fBpressed\fR, \fBfocus\fR, etc., +\fBpressed\fR, \fBfocus\fR, etc., (see \fIttk::widget(n)\fR for the full list of state flags). .PP -Instead of a \fB\-state\fR option, every widget now has +Instead of a \fB\-state\fR option, every widget now has a \fBstate\fR widget command which is used to set or query the state. A \fIstate specification\fR is a list of symbolic state names -indicating which bits are set, each optionally prefixed with an +indicating which bits are set, each optionally prefixed with an exclamation point indicating that the bit is cleared instead. .PP For example, the class bindings for the \fBttk::button\fR @@ -132,7 +132,7 @@ This specifies that the widget becomes \fBactive\fR when the pointer enters the widget, and inactive when it leaves. Similarly it becomes \fBpressed\fR when the mouse button is pressed, and \fB!pressed\fR on the ButtonRelease event. -In addition, the button unpresses if +In addition, the button unpresses if pointer is dragged outside the widget while Button-1 is held down, and represses if it's dragged back in. Finally, when the mouse button is released, the widget's @@ -143,7 +143,7 @@ but not by much). '\" Note to self: rewrite that paragraph. It's horrible. .SH "STYLES" .PP -Each widget is associated with a \fIstyle\fR, +Each widget is associated with a \fIstyle\fR, which specifies values for element options. Style names use a recursive dotted notation like layouts and elements; by default, widgets use the class name to look up a style in the current theme. @@ -157,7 +157,7 @@ ttk::\fBstyle configure\fR TButton \e ; .CE .PP -Many elements are displayed differently depending on the widget state. +Many elements are displayed differently depending on the widget state. For example, buttons have a different background when they are active, a different foreground when disabled, and a different relief when pressed. The \fBstyle map\fR command specifies dynamic option settings diff --git a/doc/ttk_label.n b/doc/ttk_label.n index ff93adf..6781b47 100644 --- a/doc/ttk_label.n +++ b/doc/ttk_label.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::label n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -15,7 +15,7 @@ ttk::label \- Display a text string and/or image .SH DESCRIPTION .PP A \fBttk::label\fR widget displays a textual label and/or image. -The label may be linked to a Tcl variable +The label may be linked to a Tcl variable to automatically change the displayed text. .SO ttk_widget \-class \-compound \-cursor @@ -31,7 +31,7 @@ relative to the inner margins. Legal values are \fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, and \fBcenter\fR. See also \fB\-justify\fR. .OP \-background frameColor FrameColor -The widget's background color. +The widget's background color. If unspecified, the theme default is used. .OP \-font font Font Font to use for label text. @@ -45,17 +45,17 @@ One of \fBleft\fR, \fBcenter\fR, or \fBright\fR. See also \fB\-anchor\fR. .OP \-padding padding Padding Specifies the amount of extra space to allocate for the widget. -The padding is a list of up to four length specifications +The padding is a list of up to four length specifications \fIleft top right bottom\fR. -If fewer than four elements are specified, +If fewer than four elements are specified, \fIbottom\fR defaults to \fItop\fR, -\fIright\fR defaults to \fIleft\fR, and +\fIright\fR defaults to \fIleft\fR, and \fItop\fR defaults to \fIleft\fR. .OP \-relief relief Relief .\" Rewrite this: Specifies the 3-D effect desired for the widget border. Valid values are -\fBflat\fR, \fBgroove\fR, \fBraised\fR, \fBridge\fR, \fBsolid\fR, +\fBflat\fR, \fBgroove\fR, \fBraised\fR, \fBridge\fR, \fBsolid\fR, and \fBsunken\fR. .OP \-text text Text Specifies a text string to be displayed inside the widget diff --git a/doc/ttk_labelframe.n b/doc/ttk_labelframe.n index 2dae91f..64edf6a 100644 --- a/doc/ttk_labelframe.n +++ b/doc/ttk_labelframe.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::labelframe n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -22,7 +22,7 @@ another widget. \-style .SE .SH "WIDGET-SPECIFIC OPTIONS" -.\" XXX: Currently included, but may go away: +.\" XXX: Currently included, but may go away: .\" XXX: .OP -borderwidth borderWidth BorderWidth .\" XXX: The desired width of the widget border. Default is theme-dependent. .\" XXX: .OP -relief relief Relief @@ -31,7 +31,7 @@ another widget. .\" XXX: \fBsolid\fR, or \fBsunken\fR. .\" XXX: Default is theme-dependent. .OP \-labelanchor labelAnchor LabelAnchor -Specifies where to place the label. +Specifies where to place the label. Allowed values are (clockwise from the top upper left corner): \fBnw\fR, \fBn\fR, \fBne\fR, \fBen\fR, \fBe\fR, \fBes\fR, \fBse\fR, \fBs\fR,\fBsw\fR, \fBws\fR, \fBw\fR and \fBwn\fR. @@ -43,10 +43,10 @@ The default value is theme-dependent. .OP \-text text Text Specifies the text of the label. .OP \-underline underline Underline -If set, specifies the integer index (0-based) of a character to +If set, specifies the integer index (0-based) of a character to underline in the text string. -The underlined character is used for mnemonic activation. -Mnemonic activation for a \fBttk::labelframe\fR +The underlined character is used for mnemonic activation. +Mnemonic activation for a \fBttk::labelframe\fR sets the keyboard focus to the first child of the \fBttk::labelframe\fR widget. .OP \-padding padding Padding Additional padding to include inside the border. diff --git a/doc/ttk_menubutton.n b/doc/ttk_menubutton.n index 33189e8..698bd0c 100644 --- a/doc/ttk_menubutton.n +++ b/doc/ttk_menubutton.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::menubutton n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -24,10 +24,10 @@ and displays a menu when pressed. .SE .SH "WIDGET-SPECIFIC OPTIONS" .OP \-direction direction Direction -Specifies where the menu is to be popped up relative -to the menubutton. +Specifies where the menu is to be popped up relative +to the menubutton. One of: \fBabove\fR, \fBbelow\fR, \fBleft\fR, \fBright\fR, -or \fBflush\fR. The default is \fBbelow\fR. +or \fBflush\fR. The default is \fBbelow\fR. \fBflush\fR pops the menu up directly over the menubutton. .OP \-menu menu Menu Specifies the path name of the menu associated with the menubutton. @@ -38,8 +38,8 @@ menubutton. .\" .OP \-padding padding Pad .SH "WIDGET COMMAND" .PP -Menubutton widgets support the standard -\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR +Menubutton widgets support the standard +\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR methods. No other widget methods are used. .SH "STANDARD STYLES" .PP diff --git a/doc/ttk_notebook.n b/doc/ttk_notebook.n index cecae48..4d1b789 100644 --- a/doc/ttk_notebook.n +++ b/doc/ttk_notebook.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::notebook n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -18,7 +18,7 @@ ttk::notebook \- Multi-paned container widget .fi .BE .SH DESCRIPTION -A \fBttk::notebook\fR widget manages a collection of windows +A \fBttk::notebook\fR widget manages a collection of windows and displays a single one at a time. Each slave window is associated with a \fItab\fR, which the user may select to change the currently-displayed window. @@ -28,35 +28,35 @@ which the user may select to change the currently-displayed window. .SE .SH "WIDGET-SPECIFIC OPTIONS" .OP \-height height Height -If present and greater than zero, +If present and greater than zero, specifies the desired height of the pane area (not including internal padding or tabs). Otherwise, the maximum height of all panes is used. .OP \-padding padding Padding Specifies the amount of extra space to add around the outside of the notebook. -The padding is a list of up to four length specifications +The padding is a list of up to four length specifications \fIleft top right bottom\fR. -If fewer than four elements are specified, +If fewer than four elements are specified, \fIbottom\fR defaults to \fItop\fR, -\fIright\fR defaults to \fIleft\fR, and +\fIright\fR defaults to \fIleft\fR, and \fItop\fR defaults to \fIleft\fR. .OP \-width width Width -If present and greater than zero, +If present and greater than zero, specifies the desired width of the pane area (not including internal padding). Otherwise, the maximum width of all panes is used. .SH "TAB OPTIONS" The following options may be specified for individual notebook panes: .OP \-state state State -Either \fBnormal\fR, \fBdisabled\fR or \fBhidden\fR. +Either \fBnormal\fR, \fBdisabled\fR or \fBhidden\fR. If \fBdisabled\fR, then the tab is not selectable. If \fBhidden\fR, then the tab is not shown. .OP \-sticky sticky Sticky Specifies how the slave window is positioned within the pane area. Value is a string containing zero or more of the characters \fBn, s, e,\fR or \fBw\fR. -Each letter refers to a side (north, south, east, or west) +Each letter refers to a side (north, south, east, or west) that the slave window will .QW stick to, as per the \fBgrid\fR geometry manager. @@ -73,7 +73,7 @@ Specifies how to display the image relative to the text, in the case both \fB\-text\fR and \fB\-image\fR are present. See \fIlabel(n)\fR for legal values. .OP \-underline underline Underline -Specifies the integer index (0-based) of a character to underline +Specifies the integer index (0-based) of a character to underline in the text string. The underlined character is used for mnemonic activation if \fBttk::notebook::enableTraversal\fR is called. @@ -87,7 +87,7 @@ The name of a slave window; .IP \(bu A positional specification of the form .QW @\fIx\fR,\fIy\fR , -which identifies the tab +which identifies the tab .IP \(bu The literal string .QW \fBcurrent\fR , @@ -95,7 +95,7 @@ which identifies the currently-selected tab; or: .IP \(bu The literal string .QW \fBend\fR , -which returns the number of tabs +which returns the number of tabs (only valid for .QW "\fIpathname \fBindex\fR" ). .SH "WIDGET COMMAND" @@ -142,9 +142,9 @@ or the total number of tabs if \fItabid\fR is the string .TP \fIpathname \fBinsert \fIpos subwindow options...\fR Inserts a pane at the specified position. -\fIpos\fR is either the string \fBend\fR, an integer index, +\fIpos\fR is either the string \fBend\fR, an integer index, or the name of a managed subwindow. -If \fIsubwindow\fR is already managed by the notebook, +If \fIsubwindow\fR is already managed by the notebook, moves it to the specified position. See \fBTAB OPTIONS\fR for the list of available options. .TP @@ -190,7 +190,7 @@ containing the notebook as follows: of any tab, will select that tab. .PP Multiple notebooks in a single toplevel may be enabled for traversal, -including nested notebooks. +including nested notebooks. However, notebook traversal only works properly if all panes are direct children of the notebook. .SH "VIRTUAL EVENTS" diff --git a/doc/ttk_progressbar.n b/doc/ttk_progressbar.n index 6306450..1945f70 100644 --- a/doc/ttk_progressbar.n +++ b/doc/ttk_progressbar.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::progressbar n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -44,15 +44,15 @@ that is, the progress bar completes one when the \fB\-value\fR increases by \fB\-maximum\fR. .OP \-variable variable Variable The name of a global Tcl variable which is linked to the \fB\-value\fR. -If specified, the \fB\-value\fR of the progress bar is -automatically set to the value of the variable whenever +If specified, the \fB\-value\fR of the progress bar is +automatically set to the value of the variable whenever the latter is modified. .OP \-phase phase Phase Read-only option. -The widget periodically increments the value of this option +The widget periodically increments the value of this option whenever the \fB\-value\fR is greater than 0 and, in \fIdeterminate\fR mode, less than \fB\-maximum\fR. -This option may be used by the current theme +This option may be used by the current theme to provide additional animation effects. .SH "WIDGET COMMAND" .PP @@ -72,7 +72,7 @@ Test the widget state; see \fIttk::widget(n)\fR. .TP \fIpathName \fBstart\fR ?\fIinterval\fR? Begin autoincrement mode: -schedules a recurring timer event that calls \fBstep\fR +schedules a recurring timer event that calls \fBstep\fR every \fIinterval\fR milliseconds. If omitted, \fIinterval\fR defaults to 50 milliseconds (20 steps/second). .TP @@ -80,7 +80,7 @@ If omitted, \fIinterval\fR defaults to 50 milliseconds (20 steps/second). Modify or query the widget state; see \fIttk::widget(n)\fR. .TP \fIpathName \fBstep\fR ?\fIamount\fR? -Increments the \fB\-value\fR by \fIamount\fR. +Increments the \fB\-value\fR by \fIamount\fR. \fIamount\fR defaults to 1.0 if omitted. .TP \fIpathName \fBstop\fR diff --git a/doc/ttk_radiobutton.n b/doc/ttk_radiobutton.n index c16f2cd..5b4dcce 100644 --- a/doc/ttk_radiobutton.n +++ b/doc/ttk_radiobutton.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::radiobutton n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -29,21 +29,21 @@ it sets the variable to its associated value. .OP \-command command Command A Tcl script to evaluate whenever the widget is invoked. .OP \-value Value Value -The value to store in the associated \fB\-variable\fR -when the widget is selected. +The value to store in the associated \fB\-variable\fR +when the widget is selected. .OP \-variable variable Variable The name of a global variable whose value is linked to the widget. Default value is \fB::selectedButton\fR. .SH "WIDGET COMMAND" .PP -In addition to the standard -\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR +In addition to the standard +\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR commands, radiobuttons support the following additional widget commands: .TP \fIpathname\fB invoke\fR Sets the \fB\-variable\fR to the \fB\-value\fR, selects the widget, -and evaluates the associated \fB\-command\fR. +and evaluates the associated \fB\-command\fR. Returns the result of the \fB\-command\fR, or the empty string if no \fB\-command\fR is specified. .\" Missing: select, deselect. Useful? @@ -51,11 +51,11 @@ string if no \fB\-command\fR is specified. .SH "WIDGET STATES" .PP The widget does not respond to user input if the \fBdisabled\fR state is set. -The widget sets the \fBselected\fR state whenever +The widget sets the \fBselected\fR state whenever the linked \fB\-variable\fR is set to the widget's \fB\-value\fR, and clears it otherwise. -The widget sets the \fBalternate\fR state whenever the -linked \fB\-variable\fR is unset. +The widget sets the \fBalternate\fR state whenever the +linked \fB\-variable\fR is unset. (The \fBalternate\fR state may be used to indicate a .QW tri-state or diff --git a/doc/ttk_scrollbar.n b/doc/ttk_scrollbar.n index 56df214..03d09f2 100644 --- a/doc/ttk_scrollbar.n +++ b/doc/ttk_scrollbar.n @@ -4,12 +4,12 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::scrollbar n 8.5 Tk "Tk Themed Widget" .so man.macros .BS .SH NAME -ttk::scrollbar \- Control the viewport of a scrollable widget +ttk::scrollbar \- Control the viewport of a scrollable widget .SH SYNOPSIS \fBttk::scrollbar\fR \fIpathName \fR?\fIoptions...\fR? .BE @@ -30,7 +30,7 @@ these are used to scroll the visible region in discrete units. .SE .SH "WIDGET-SPECIFIC OPTIONS" .OP \-command command Command -A Tcl script prefix to evaluate +A Tcl script prefix to evaluate to change the view in the widget associated with the scrollbar. Additional arguments are appended to the value of this option, as described in \fBSCROLLING COMMANDS\fR below, @@ -66,7 +66,7 @@ See \fIttk::widget(n)\fR. Test the widget state; see \fIttk::widget(n)\fR. .TP \fIpathName \fBset \fIfirst last\fR -This command is normally invoked by the scrollbar's associated widget +This command is normally invoked by the scrollbar's associated widget from an \fB\-xscrollcommand\fR or \fB\-yscrollcommand\fR callback. Specifies the visible range to be displayed. \fIfirst\fR and \fIlast\fR are real fractions between 0 and 1. @@ -147,7 +147,7 @@ of individual elements, based on the position and state of the mouse pointer. set f [frame .f] ttk::scrollbar $f.hsb \-orient horizontal \-command [list $f.t xview] ttk::scrollbar $f.vsb \-orient vertical \-command [list $f.t yview] -text $f.t \-xscrollcommand [list $f.hsb set] \-yscrollcommand [list $f.vsb set] +text $f.t \-xscrollcommand [list $f.hsb set] \-yscrollcommand [list $f.vsb set] grid $f.t \-row 0 \-column 0 \-sticky nsew grid $f.vsb \-row 0 \-column 1 \-sticky nsew grid $f.hsb \-row 1 \-column 0 \-sticky nsew diff --git a/doc/ttk_separator.n b/doc/ttk_separator.n index d955fc4..fea2701 100644 --- a/doc/ttk_separator.n +++ b/doc/ttk_separator.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::separator n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -26,8 +26,8 @@ One of \fBhorizontal\fR or \fBvertical\fR. Specifies the orientation of the separator. .SH "WIDGET COMMAND" .PP -Separator widgets support the standard -\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR +Separator widgets support the standard +\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR methods. No other widget methods are used. .SH "SEE ALSO" ttk::widget(n) diff --git a/doc/ttk_spinbox.n b/doc/ttk_spinbox.n index f10af3d..7ae586f 100644 --- a/doc/ttk_spinbox.n +++ b/doc/ttk_spinbox.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::spinbox n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -42,7 +42,7 @@ time one of the widget spin buttons is pressed. The up button applies a positive increment, the down button applies a negative increment. .OP \-values values Values This must be a Tcl list of values. If this option is set then this will -override any range set using the \fB\-from\fR, \fB\-to\fR and +override any range set using the \fB\-from\fR, \fB\-to\fR and \fB\-increment\fR options. The widget will instead use the values specified beginning with the first value. .OP \-wrap wrap Wrap @@ -60,7 +60,7 @@ Specifies a Tcl command to be invoked whenever a spinbutton is invoked. See the \fBttk::entry\fR manual for information about indexing characters. .SH "VALIDATION" .PP -See the \fBttk::entry\fR manual for information about using the +See the \fBttk::entry\fR manual for information about using the \fB\-validate\fR and \fB\-validatecommand\fR options. .SH "WIDGET COMMAND" .PP diff --git a/doc/ttk_style.n b/doc/ttk_style.n index dc3bade..985e3cd 100644 --- a/doc/ttk_style.n +++ b/doc/ttk_style.n @@ -1,9 +1,9 @@ '\" '\" Copyright (c) 2004 Joe English -'\" +'\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::style n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -23,9 +23,9 @@ which specifies the set of elements making up the widget and how they are arranged, along with dynamic and default settings for element options. By default, the style name is the same as the widget's class; -this may be overridden by the \fB\-style\fR option. +this may be overridden by the \fB\-style\fR option. .PP -A \fItheme\fR is a collection of elements and styles +A \fItheme\fR is a collection of elements and styles which controls the overall look and feel of an application. .SH DESCRIPTION .PP @@ -43,31 +43,31 @@ is used. \fBttk::style lookup \fIstyle\fR \fI\-option \fR?\fIstate \fR?\fIdefault\fR?? Returns the value specified for \fI\-option\fR in style \fIstyle\fR in state \fIstate\fR, using the standard lookup rules for element options. -\fIstate\fR is a list of state names; if omitted, +\fIstate\fR is a list of state names; if omitted, it defaults to all bits off (the .QW normal state). If the \fIdefault\fR argument is present, it is used as a fallback value in case no specification for \fI\-option\fR is found. -.\" Otherwise -- signal error? return empty string? Leave unspecified for now. +.\" Otherwise -- signal error? return empty string? Leave unspecified for now. .TP \fBttk::style layout \fIstyle\fR ?\fIlayoutSpec\fR? -Define the widget layout for style \fIstyle\fR. +Define the widget layout for style \fIstyle\fR. See \fBLAYOUTS\fR below for the format of \fIlayoutSpec\fR. If \fIlayoutSpec\fR is omitted, return the layout specification for style \fIstyle\fR. -.TP +.TP \fBttk::style element create\fR \fIelementName\fR \fItype\fR ?\fIargs...\fR? Creates a new element in the current theme of type \fItype\fR. -The only cross-platform built-in element type is \fIimage\fR -(see \fBttk_image\fR(n)) but themes may define other element types +The only cross-platform built-in element type is \fIimage\fR +(see \fBttk_image\fR(n)) but themes may define other element types (see \fBTtk_RegisterElementFactory\fR). On suitable versions of Windows an element factory is registered to create Windows theme elements (see \fBttk_vsapi\fR(n)). -.TP +.TP \fBttk::style element names\fR Returns the list of elements defined in the current theme. -.TP +.TP \fBttk::style element options \fIelement\fR Returns the list of \fIelement\fR's options. .TP @@ -79,7 +79,7 @@ If \fB\-settings\fR is present, \fIscript\fR is evaluated in the context of the new theme as per \fBttk::style theme settings\fR. .TP \fBttk::style theme settings \fIthemeName\fR \fIscript\fR -Temporarily sets the current theme to \fIthemeName\fR, +Temporarily sets the current theme to \fIthemeName\fR, evaluate \fIscript\fR, then restore the previous theme. Typically \fIscript\fR simply defines styles and elements, though arbitrary Tcl code may appear. @@ -99,7 +99,7 @@ The layout mechanism uses a simplified version of the \fBpack\fR geometry manager: given an initial cavity, each element is allocated a parcel. Valid options are: -.TP +.TP \fB\-side \fIside\fR Specifies which side of the cavity to place the element; one of \fBleft\fR, \fBright\fR, \fBtop\fR, or \fBbottom\fR. diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n index dd83c20..660b076 100644 --- a/doc/ttk_treeview.n +++ b/doc/ttk_treeview.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::treeview n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -15,15 +15,15 @@ ttk::treeview \- hierarchical multicolumn data display widget .SH DESCRIPTION .PP The \fBttk::treeview\fR widget displays a hierarchical collection of items. -Each item has a textual label, an optional image, +Each item has a textual label, an optional image, and an optional list of data values. The data values are displayed in successive columns after the tree label. .PP The order in which data values are displayed may be controlled -by setting the \fB\-displaycolumns\fR widget option. +by setting the \fB\-displaycolumns\fR widget option. The tree widget can also display column headings. -Columns may be accessed by number or by symbolic names +Columns may be accessed by number or by symbolic names listed in the \fB\-columns\fR widget option; see \fBCOLUMN IDENTIFIERS\fR. .PP @@ -40,7 +40,7 @@ and control the appearance of the item. .\" @@@HERE: describe selection, focus item .PP Treeview widgets support horizontal and vertical scrolling with the -standard \fB\-\fR[\fBxy\fR]\fBscrollcommand\fR options +standard \fB\-\fR[\fBxy\fR]\fBscrollcommand\fR options and [\fBxy\fR]\fBview\fR widget commands. .SO ttk_widget \-class \-cursor \-takefocus @@ -48,14 +48,14 @@ and [\fBxy\fR]\fBview\fR widget commands. .SE .SH "WIDGET-SPECIFIC OPTIONS" .OP \-columns columns Columns -A list of column identifiers, +A list of column identifiers, specifying the number of columns and their names. .\"X: This is a read-only option; it may only be set when the widget is created. .OP \-displaycolumns displayColumns DisplayColumns -A list of column identifiers +A list of column identifiers (either symbolic names or integer indices) -specifying which data columns are displayed -and the order in which they appear, +specifying which data columns are displayed +and the order in which they appear, or the string \fB#all\fP. If set to \fB#all\fP (the default), all columns are shown in the order given. @@ -76,7 +76,7 @@ If set to \fBextended\fR (the default), multiple items may be selected. If \fBbrowse\fR, only a single item will be selected at a time. If \fBnone\fR, the selection will not be changed. .PP -Note that application code and tag bindings can set the selection +Note that application code and tag bindings can set the selection however they wish, regardless of the value of \fB\-selectmode\fR. .RE .OP \-show show Show @@ -84,7 +84,7 @@ A list containing zero or more of the following values, specifying which elements of the tree to display. .RS .IP \fBtree\fR -Display tree labels in column #0. +Display tree labels in column #0. .IP \fBheadings\fR Display the heading row. .PP @@ -114,7 +114,7 @@ returns the list of children belonging to \fIitem\fR. .RS .PP If \fInewchildren\fR is specified, replaces \fIitem\fR's child list -with \fInewchildren\fR. +with \fInewchildren\fR. Items in the old child list not present in the new child list are detached from the tree. None of the items in \fInewchildren\fR may be an ancestor @@ -125,7 +125,7 @@ of \fIitem\fR. Query or modify the options for the specified \fIcolumn\fR. If no \fI\-option\fR is specified, returns a dictionary of option/value pairs. -If a single \fI\-option\fR is specified, +If a single \fI\-option\fR is specified, returns the value of that option. Otherwise, the options are updated with the specified values. The following options may be set on each column: @@ -134,7 +134,7 @@ The following options may be set on each column: \fB\-id \fIname\fR The column name. This is a read-only option. For example, [\fI$pathname \fBcolumn #\fIn \fB\-id\fR] -returns the data column associated with display column #\fIn\fR. +returns the data column associated with display column #\fIn\fR. .TP \fB\-anchor\fR Specifies how the text in this column should be aligned @@ -145,7 +145,7 @@ with respect to the cell. One of \fB\-minwidth\fR The minimum width of the column in pixels. The treeview widget will not make the column any smaller than -\fB\-minwidth\fR when the widget is resized or the user drags a +\fB\-minwidth\fR when the widget is resized or the user drags a column separator. .TP \fB\-stretch\fR @@ -184,7 +184,7 @@ Returns 1 if the specified \fIitem\fR is present in the tree, If \fIitem\fR is specified, sets the focus item to \fIitem\fR. Otherwise, returns the current focus item, or \fB{}\fR if there is none. .\" Need: way to clear the focus item. {} works for this... -.TP +.TP \fIpathname \fBheading \fIcolumn\fR ?\fI\-option \fR?\fIvalue \-option value...\fR? Query or modify the heading options for the specified \fIcolumn\fR. Valid options are: @@ -251,13 +251,13 @@ and data columns. Returns the integer index of \fIitem\fR within its parent's list of children. .TP \fIpathname \fBinsert \fIparent index\fR ?\fB\-id \fIid\fR? \fIoptions...\fR -Creates a new item. +Creates a new item. \fIparent\fR is the item ID of the parent item, or the empty string \fB{}\fR to create a new top-level item. \fIindex\fR is an integer, or the value \fBend\fR, specifying where in the list of \fIparent\fR's children to insert the new item. -If \fIindex\fR is less than or equal to zero, +If \fIindex\fR is less than or equal to zero, the new node is inserted at the beginning; if \fIindex\fR is greater than or equal to the current number of children, it is inserted at the end. @@ -276,9 +276,9 @@ Test the widget state; see \fIttk::widget(n)\fR. .TP \fIpathname \fBitem \fIitem\fR ?\fI\-option \fR?\fIvalue \-option value...\fR? Query or modify the options for the specified \fIitem\fR. -If no \fI\-option\fR is specified, +If no \fI\-option\fR is specified, returns a dictionary of option/value pairs. -If a single \fI\-option\fR is specified, +If a single \fI\-option\fR is specified, returns the value of that option. Otherwise, the item's options are updated with the specified values. See \fBITEM OPTIONS\fR for the list of available options. @@ -292,7 +292,7 @@ If \fIindex\fR is less than or equal to zero, \fIitem\fR is moved to the beginning; if greater than or equal to the number of children, it is moved to the end. .RE -.TP +.TP \fIpathname \fBnext \fIitem\fR Returns the identifier of \fIitem\fR's next sibling, or \fB{}\fR if \fIitem\fR is the last child of its parent. @@ -300,7 +300,7 @@ or \fB{}\fR if \fIitem\fR is the last child of its parent. \fIpathname \fBparent \fIitem\fR Returns the ID of the parent of \fIitem\fR, or \fB{}\fR if \fIitem\fR is at the top level of the hierarchy. -.TP +.TP \fIpathname \fBprev \fIitem\fR Returns the identifier of \fIitem\fR's previous sibling, or \fB{}\fR if \fIitem\fR is the first child of its parent. @@ -308,7 +308,7 @@ or \fB{}\fR if \fIitem\fR is the first child of its parent. \fIpathname \fBsee \fIitem\fR Ensure that \fIitem\fR is visible: sets all of \fIitem\fR's ancestors to \fB\-open true\fR, -and scrolls the widget if necessary so that \fIitem\fR is +and scrolls the widget if necessary so that \fIitem\fR is within the visible portion of the tree. .TP \fIpathname \fBselection\fR ?\fIselop itemList\fR? @@ -344,7 +344,7 @@ Modify or query the widget state; see \fIttk::widget(n)\fR. .RS .TP \fIpathName \fBtag bind \fItagName \fR?\fIsequence\fR? ?\fIscript\fR? -Add a Tk binding script for the event sequence \fIsequence\fR +Add a Tk binding script for the event sequence \fIsequence\fR to the tag \fItagName\fR. When an X event is delivered to an item, binding scripts for each of the item's \fB\-tags\fR are evaluated in order as per \fIbindtags(n)\fR. @@ -353,10 +353,10 @@ in order as per \fIbindtags(n)\fR. \fB\fR, \fB\fR, and virtual events are sent to the focus item. \fB\fR, \fB\fR, and \fB\fR events -are sent to the item under the mouse pointer. +are sent to the item under the mouse pointer. No other event types are supported. .PP -The binding \fIscript\fR undergoes \fB%\fR-substitutions before +The binding \fIscript\fR undergoes \fB%\fR-substitutions before evaluation; see \fBbind(n)\fR for details. .RE .TP @@ -364,10 +364,10 @@ evaluation; see \fBbind(n)\fR for details. Query or modify the options for the specified \fItagName\fR. If one or more \fIoption/value\fR pairs are specified, sets the value of those options for the specified tag. -If a single \fIoption\fR is specified, -returns the value of that option +If a single \fIoption\fR is specified, +returns the value of that option (or the empty string if the option has not been specified for \fItagName\fR). -With no additional arguments, +With no additional arguments, returns a dictionary of the option settings for \fItagName\fR. See \fBTAG OPTIONS\fR for the list of available options. .TP @@ -420,7 +420,7 @@ the extra values are ignored. A boolean value indicating whether the item's children should be displayed (\fB\-open true\fR) or hidden (\fB\-open false\fR). .OP \-tags tags Tags -A list of tags associated with this item. +A list of tags associated with this item. .SH "TAG OPTIONS" .PP The following options may be specified on tags: @@ -448,8 +448,8 @@ An integer \fIn\fR, specifying the \fIn\fRth data column. A string of the form \fB#\fIn\fR, where \fIn\fR is an integer, specifying the \fIn\fRth display column. .PP -\fBNOTE:\fR -Item \fB\-values\fR may be displayed in a different order than +\fBNOTE:\fR +Item \fB\-values\fR may be displayed in a different order than the order in which they are stored. .PP \fBNOTE:\fR Column #0 always refers to the tree column, @@ -457,7 +457,7 @@ even if \fB\-show tree\fR is not specified. .PP A \fIdata column number\fR is an index into an item's \fB\-values\fR list; a \fIdisplay column number\fR is the column number in the tree -where the values are displayed. +where the values are displayed. Tree labels are displayed in column #0. If \fB\-displaycolumns\fR is not set, then data column \fIn\fR is displayed in display column \fB#\fIn+1\fR. diff --git a/doc/ttk_vsapi.n b/doc/ttk_vsapi.n index 34145fb..334836c 100644 --- a/doc/ttk_vsapi.n +++ b/doc/ttk_vsapi.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk_vsapi n 8.5 Tk "Tk Themed Widget" .so man.macros .BS @@ -72,7 +72,7 @@ If no \fIstateMap\fR parameter is given there is an implicit default map of {{} 1} .SH "EXAMPLE" .PP -Create a correctly themed close button by changing the layout of +Create a correctly themed close button by changing the layout of a \fBttk::button\fR(n). This uses the WINDOW part WP_SMALLCLOSEBUTTON and as documented the states CBS_DISABLED, CBS_HOT, CBS_NORMAL and CBS_PUSHED are mapped from ttk states. diff --git a/doc/wm.n b/doc/wm.n index c44ab9b..b1a9fea 100644 --- a/doc/wm.n +++ b/doc/wm.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH wm n 8.5 Tk "Tk Built-In Commands" .so man.macros .BS @@ -796,7 +796,7 @@ Gridded geometry management is typically invoked by turning on the \fBsetGrid\fR option for a widget; it can also be invoked with the \fBwm grid\fR command or by calling \fBTk_SetGrid\fR. In each of these approaches the particular widget (or sometimes -code in the application as a whole) specifies the relationship between +code in the application as a whole) specifies the relationship between integral grid sizes for the window and pixel sizes. To return to non-gridded geometry management, invoke \fBwm grid\fR with empty argument strings. -- cgit v0.12 From 8281e14d143f2a712e48508878be90681109d5ea Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 2 Mar 2016 15:25:48 +0000 Subject: Revert part of [032c1ee138449c93dfa885fab07796783945e174|032c1ee138]: Only the patchlevel should have been changed, nothing else. --- unix/configure | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/unix/configure b/unix/configure index 3958a6b..5ffc3fa 100755 --- a/unix/configure +++ b/unix/configure @@ -9598,7 +9598,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 Intrinsic.h. + # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -9606,7 +9606,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 @@ -9633,7 +9633,7 @@ else sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Intrinsic.h"; then + if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi @@ -9647,18 +9647,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="-lXt $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. */ -#include +#include int main () { -XtMalloc (0) +XrmInitialize () ; return 0; } -- cgit v0.12 From 9d05857f2e1878b20cc6aa7cd5c87ed5c55aeea5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 2 Mar 2016 15:52:05 +0000 Subject: Update version in tk.spec --- unix/tk.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/tk.spec b/unix/tk.spec index af982f7..e43e28e 100644 --- a/unix/tk.spec +++ b/unix/tk.spec @@ -4,7 +4,7 @@ Name: tk Summary: Tk graphical toolkit for the Tcl scripting language. -Version: 8.6.4 +Version: 8.6.5 Release: 2 License: BSD Group: Development/Languages -- cgit v0.12 -- cgit v0.12 From 2fd9fcf08d73f688888ef8784be0c5493b80d818 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 3 Mar 2016 19:19:29 +0000 Subject: Bump trunk to 8.7a0 to accept new feature development. --- README | 6 +- generic/tk.h | 12 +- library/tk.tcl | 2 +- macosx/Tk-Common.xcconfig | 2 +- unix/configure | 11262 +++++++++++++++++--------------------------- unix/configure.in | 10 +- unix/tk.spec | 6 +- win/README | 2 +- win/configure | 6464 +++++++++++++------------ win/configure.in | 18 +- win/tcl.m4 | 8 +- 11 files changed, 7824 insertions(+), 9968 deletions(-) diff --git a/README b/README index aa5d0f6..cb3bdd5 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ README: Tk - This is the Tk 8.6.5 source distribution. + This is the Tk 8.7a0 source distribution. http://sourceforge.net/projects/tcl/files/Tcl/ You can get any source release of Tk from the URL above. @@ -10,9 +10,9 @@ This directory contains the sources and documentation for Tk, an X11 toolkit implemented with the Tcl scripting language. For details on features, incompatibilities, and potential problems with -this release, see the Tcl/Tk 8.6 Web page at +this release, see the Tcl/Tk 8.7 Web page at - http://www.tcl.tk/software/tcltk/8.6.html + http://www.tcl.tk/software/tcltk/8.7.html or refer to the "changes" file in this directory, which contains a historical record of all changes to Tk. diff --git a/generic/tk.h b/generic/tk.h index 75d82ba..6abb05e 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -18,7 +18,7 @@ #include #if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION < 6) -# error Tk 8.6 must be compiled with tcl.h from Tcl 8.6 or better +# error Tk 8.7 must be compiled with tcl.h from Tcl 8.6 or better #endif #ifndef CONST84 @@ -73,12 +73,12 @@ extern "C" { */ #define TK_MAJOR_VERSION 8 -#define TK_MINOR_VERSION 6 -#define TK_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TK_RELEASE_SERIAL 5 +#define TK_MINOR_VERSION 7 +#define TK_RELEASE_LEVEL TCL_ALPHA_RELEASE +#define TK_RELEASE_SERIAL 0 -#define TK_VERSION "8.6" -#define TK_PATCH_LEVEL "8.6.5" +#define TK_VERSION "8.7" +#define TK_PATCH_LEVEL "8.7a0" /* * A special definition used to allow this header file to be included from diff --git a/library/tk.tcl b/library/tk.tcl index 38162d1..7419325 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -13,7 +13,7 @@ # Insist on running with compatible version of Tcl package require Tcl 8.6 # Verify that we have Tk binary and script components from the same release -package require -exact Tk 8.6.5 +package require -exact Tk 8.7a0 # Create a ::tk namespace namespace eval ::tk { diff --git a/macosx/Tk-Common.xcconfig b/macosx/Tk-Common.xcconfig index 0d6e474..d75674a 100644 --- a/macosx/Tk-Common.xcconfig +++ b/macosx/Tk-Common.xcconfig @@ -43,4 +43,4 @@ TCL_PACKAGE_PATH = "$(LIBDIR)" TCL_DEFS = HAVE_TCL_CONFIG_H TK_LIBRARY = $(LIBDIR)/tk$(VERSION) TK_DEFS = HAVE_TK_CONFIG_H TCL_NO_DEPRECATED -VERSION = 8.6 +VERSION = 8.7 diff --git a/unix/configure b/unix/configure index 5ffc3fa..040f4a1 100755 --- a/unix/configure +++ b/unix/configure @@ -1,81 +1,459 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for tk 8.6. +# Generated by GNU Autoconf 2.69 for tk 8.7. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# # -# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi -DUALCASE=1; export DUALCASE # for MKS sh -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' fi +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." else - $as_unset $as_var + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." fi -done + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` - -# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -83,146 +461,91 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file else - as_expr=false + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -231,89 +554,247 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - +test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='tk' PACKAGE_TARNAME='tk' -PACKAGE_VERSION='8.6' -PACKAGE_STRING='tk 8.6' +PACKAGE_VERSION='8.7' +PACKAGE_STRING='tk 8.7' PACKAGE_BUGREPORT='' +PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCLSH_PROG BUILD_TCLSH MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR ac_ct_AR LIBOBJS TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS LDAIX_SRC CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB DLL_INSTALL_DIR INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT XFT_CFLAGS XFT_LIBS UNIX_FONT_OBJS TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_YEAR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_INCLUDE_SPEC TK_BUILD_STUB_LIB_SPEC TK_BUILD_STUB_LIB_PATH TK_SRC_DIR TK_SHARED_BUILD LD_LIBRARY_PATH_VAR TK_BUILD_LIB_SPEC TCL_STUB_FLAGS XINCLUDES XLIBSW LOCALES TK_WINDOWINGSYSTEM TK_PKG_DIR TK_LIBRARY LIB_RUNTIME_DIR PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_WISH_LIBS CFBUNDLELOCALIZATIONS TK_RSRC_FILE WISH_RSRC_FILE LIB_RSRC_FILE APP_RSRC_FILE REZ REZ_FLAGS LTLIBOBJS' +ac_subst_vars='LTLIBOBJS +REZ_FLAGS +REZ +APP_RSRC_FILE +LIB_RSRC_FILE +WISH_RSRC_FILE +TK_RSRC_FILE +CFBUNDLELOCALIZATIONS +EXTRA_WISH_LIBS +EXTRA_BUILD_HTML +EXTRA_INSTALL_BINARIES +EXTRA_INSTALL +EXTRA_APP_CC_SWITCHES +EXTRA_CC_SWITCHES +HTML_DIR +PRIVATE_INCLUDE_DIR +LIB_RUNTIME_DIR +TK_LIBRARY +TK_PKG_DIR +TK_WINDOWINGSYSTEM +LOCALES +XLIBSW +XINCLUDES +TCL_STUB_FLAGS +TK_BUILD_LIB_SPEC +LD_LIBRARY_PATH_VAR +TK_SHARED_BUILD +TK_SRC_DIR +TK_BUILD_STUB_LIB_PATH +TK_BUILD_STUB_LIB_SPEC +TK_INCLUDE_SPEC +TK_STUB_LIB_PATH +TK_STUB_LIB_SPEC +TK_STUB_LIB_FLAG +TK_STUB_LIB_FILE +TK_LIB_SPEC +TK_LIB_FLAG +TK_LIB_FILE +TK_YEAR +TK_PATCH_LEVEL +TK_MINOR_VERSION +TK_MAJOR_VERSION +TK_VERSION +UNIX_FONT_OBJS +XFT_LIBS +XFT_CFLAGS +XMKMF +LDFLAGS_DEFAULT +CFLAGS_DEFAULT +INSTALL_STUB_LIB +DLL_INSTALL_DIR +INSTALL_LIB +MAKE_STUB_LIB +MAKE_LIB +SHLIB_SUFFIX +SHLIB_CFLAGS +SHLIB_LD_LIBS +TK_SHLIB_LD_EXTRAS +TCL_SHLIB_LD_EXTRAS +SHLIB_LD +STLIB_LD +LD_SEARCH_FLAGS +CC_SEARCH_FLAGS +LDFLAGS_OPTIMIZE +LDFLAGS_DEBUG +CFLAGS_WARNING +CFLAGS_OPTIMIZE +CFLAGS_DEBUG +LDAIX_SRC +PLAT_SRCS +PLAT_OBJS +DL_OBJS +DL_LIBS +TCL_LIBS +LIBOBJS +AR +RANLIB +TCL_THREADS +EGREP +GREP +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +MAN_FLAGS +BUILD_TCLSH +TCLSH_PROG +TCL_STUB_LIB_SPEC +TCL_STUB_LIB_FLAG +TCL_STUB_LIB_FILE +TCL_LIB_SPEC +TCL_LIB_FLAG +TCL_LIB_FILE +TCL_SRC_DIR +TCL_BIN_DIR +TCL_PATCH_LEVEL +TCL_VERSION +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_tcl +enable_man_symlinks +enable_man_compression +enable_man_suffix +enable_threads +enable_shared +enable_64bit +enable_64bit_vis +enable_rpath +enable_corefoundation +enable_load +enable_symbols +enable_aqua +with_x +enable_xft +enable_xss +enable_framework +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +XMKMF' + # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -336,34 +817,49 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -385,33 +881,59 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; esac - eval "enable_$ac_feature='$ac_optarg'" ;; + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -438,6 +960,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -462,13 +990,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -533,6 +1064,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -583,26 +1124,36 @@ do ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; esac - eval "with_$ac_package='$ac_optarg'" ;; + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -622,27 +1173,26 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -650,31 +1200,36 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "missing argument to $ac_option" fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac -done +fi -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -688,8 +1243,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -701,74 +1254,72 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -777,7 +1328,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tk 8.6 to adapt to many kinds of systems. +\`configure' configures tk 8.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -791,20 +1342,17 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -814,18 +1362,25 @@ for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/tk] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -838,11 +1393,12 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tk 8.6:";; + short | recursive ) echo "Configuration of tk 8.7:";; esac cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-man-symlinks use symlinks for the manpages (default: off) @@ -879,169 +1435,546 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor + XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. +Report bugs to the package provider. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tk configure 8.6 -generated by GNU Autoconf 2.59 +tk configure 8.7 +generated by GNU Autoconf 2.69 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -It was created by tk $as_me 8.6, which was -generated by GNU Autoconf 2.59. Invocation command line was - - $ $0 $@ +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## -_ACEOF +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () { -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -} >&5 +} # ac_fn_c_try_compile -cat >&5 <<_ACEOF +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -## ----------- ## -## Core tests. ## -## ----------- ## +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by tk $as_me 8.7, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## _ACEOF @@ -1054,7 +1987,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1065,13 +1997,13 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" + as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else @@ -1087,104 +2019,115 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. @@ -1192,112 +2135,137 @@ cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -1310,35 +2278,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - - - - - - - - - -TK_VERSION=8.6 +TK_VERSION=8.7 TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=6 -TK_PATCH_LEVEL=".5" +TK_MINOR_VERSION=7 +TK_PATCH_LEVEL="a0" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" @@ -1357,15 +2300,15 @@ LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" # 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" - with_tclconfig="${withval}" -fi; - 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 +# Check whether --with-tcl was given. +if test "${with_tcl+set}" = set; then : + withval=$with_tcl; with_tclconfig="${withval}" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5 +$as_echo_n "checking for Tcl configuration... " >&6; } + if ${ac_cv_c_tclconfig+:} false; then : + $as_echo_n "(cached) " >&6 else @@ -1374,17 +2317,15 @@ else 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;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 +$as_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; }; } + as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5 fi fi @@ -1460,28 +2401,26 @@ 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; }; } + as_fn_error $? "Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" "$LINENO" 5 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 +$as_echo "found ${TCL_BIN_DIR}/tclConfig.sh" >&6; } fi fi - echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 +$as_echo_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... " >&6; } if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - echo "$as_me:$LINENO: result: loading" >&5 -echo "${ECHO_T}loading" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 +$as_echo "loading" >&6; } . "${TCL_BIN_DIR}/tclConfig.sh" else - echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 +$as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } fi # eval is required to do the TCL_DBGX substitution @@ -1542,25 +2481,19 @@ echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 if test "${TCL_MAJOR_VERSION}" -ne 8 ; then - { { echo "$as_me:$LINENO: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ -Found config for Tcl ${TCL_VERSION}" >&5 -echo "$as_me: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ -Found config for Tcl ${TCL_VERSION}" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ +Found config for Tcl ${TCL_VERSION}" "$LINENO" 5 fi if test "${TCL_MINOR_VERSION}" -lt 6 ; then - { { echo "$as_me:$LINENO: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ -Found config for Tcl ${TCL_VERSION}" >&5 -echo "$as_me: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ -Found config for Tcl ${TCL_VERSION}" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ +Found config for Tcl ${TCL_VERSION}" "$LINENO" 5 fi - echo "$as_me:$LINENO: checking for tclsh" >&5 -echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 - if test "${ac_cv_path_tclsh+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 +$as_echo_n "checking for tclsh... " >&6; } + if ${ac_cv_path_tclsh+:} false; then : + $as_echo_n "(cached) " >&6 else search_path=`echo ${PATH} | sed -e 's/:/ /g'` @@ -1581,22 +2514,22 @@ fi if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG="$ac_cv_path_tclsh" - echo "$as_me:$LINENO: result: $TCLSH_PROG" >&5 -echo "${ECHO_T}$TCLSH_PROG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLSH_PROG" >&5 +$as_echo "$TCLSH_PROG" >&6; } else # It is not an error if an installed version of Tcl can't be located. TCLSH_PROG="" - echo "$as_me:$LINENO: result: No tclsh found on PATH" >&5 -echo "${ECHO_T}No tclsh found on PATH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: No tclsh found on PATH" >&5 +$as_echo "No tclsh found on PATH" >&6; } fi - echo "$as_me:$LINENO: checking for tclsh in Tcl build directory" >&5 -echo $ECHO_N "checking for tclsh in Tcl build directory... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclsh in Tcl build directory" >&5 +$as_echo_n "checking for tclsh in Tcl build directory... " >&6; } BUILD_TCLSH="${TCL_BIN_DIR}"/tclsh - echo "$as_me:$LINENO: result: $BUILD_TCLSH" >&5 -echo "${ECHO_T}$BUILD_TCLSH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_TCLSH" >&5 +$as_echo "$BUILD_TCLSH" >&6; } @@ -1619,62 +2552,60 @@ TK_SRC_DIR="`cd "$srcdir"/..; pwd`" #------------------------------------------------------------------------ - echo "$as_me:$LINENO: checking whether to use symlinks for manpages" >&5 -echo $ECHO_N "checking whether to use symlinks for manpages... $ECHO_C" >&6 - # Check whether --enable-man-symlinks or --disable-man-symlinks was given. -if test "${enable_man_symlinks+set}" = set; then - enableval="$enable_man_symlinks" - test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use symlinks for manpages" >&5 +$as_echo_n "checking whether to use symlinks for manpages... " >&6; } + # Check whether --enable-man-symlinks was given. +if test "${enable_man_symlinks+set}" = set; then : + enableval=$enable_man_symlinks; test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks" else enableval="no" -fi; - echo "$as_me:$LINENO: result: $enableval" >&5 -echo "${ECHO_T}$enableval" >&6 - - echo "$as_me:$LINENO: checking whether to compress the manpages" >&5 -echo $ECHO_N "checking whether to compress the manpages... $ECHO_C" >&6 - # Check whether --enable-man-compression or --disable-man-compression was given. -if test "${enable_man_compression+set}" = set; then - enableval="$enable_man_compression" - case $enableval in - yes) { { echo "$as_me:$LINENO: error: missing argument to --enable-man-compression" >&5 -echo "$as_me: error: missing argument to --enable-man-compression" >&2;} - { (exit 1); exit 1; }; };; +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 +$as_echo "$enableval" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to compress the manpages" >&5 +$as_echo_n "checking whether to compress the manpages... " >&6; } + # Check whether --enable-man-compression was given. +if test "${enable_man_compression+set}" = set; then : + enableval=$enable_man_compression; case $enableval in + yes) as_fn_error $? "missing argument to --enable-man-compression" "$LINENO" 5;; no) ;; *) MAN_FLAGS="$MAN_FLAGS --compress $enableval";; esac else enableval="no" -fi; - echo "$as_me:$LINENO: result: $enableval" >&5 -echo "${ECHO_T}$enableval" >&6 +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 +$as_echo "$enableval" >&6; } if test "$enableval" != "no"; then - echo "$as_me:$LINENO: checking for compressed file suffix" >&5 -echo $ECHO_N "checking for compressed file suffix... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compressed file suffix" >&5 +$as_echo_n "checking for compressed file suffix... " >&6; } touch TeST $enableval TeST Z=`ls TeST* | sed 's/^....//'` rm -f TeST* MAN_FLAGS="$MAN_FLAGS --extension $Z" - echo "$as_me:$LINENO: result: $Z" >&5 -echo "${ECHO_T}$Z" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $Z" >&5 +$as_echo "$Z" >&6; } fi - echo "$as_me:$LINENO: checking whether to add a package name suffix for the manpages" >&5 -echo $ECHO_N "checking whether to add a package name suffix for the manpages... $ECHO_C" >&6 - # Check whether --enable-man-suffix or --disable-man-suffix was given. -if test "${enable_man_suffix+set}" = set; then - enableval="$enable_man_suffix" - case $enableval in + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to add a package name suffix for the manpages" >&5 +$as_echo_n "checking whether to add a package name suffix for the manpages... " >&6; } + # Check whether --enable-man-suffix was given. +if test "${enable_man_suffix+set}" = set; then : + enableval=$enable_man_suffix; case $enableval in yes) enableval="tk" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; no) ;; *) MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; esac else enableval="no" -fi; - echo "$as_me:$LINENO: result: $enableval" >&5 -echo "${ECHO_T}$enableval" >&6 +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 +$as_echo "$enableval" >&6; } @@ -1697,10 +2628,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1710,35 +2641,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -1748,39 +2681,50 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1790,99 +2734,60 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + + fi fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC +if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else + ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -1900,24 +2805,25 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1927,39 +2833,41 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -1969,66 +2877,78 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2040,112 +2960,108 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else - echo "$as_me: failed program was:" >&5 + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (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 - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -2153,38 +3069,90 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2196,45 +3164,46 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi - rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2248,55 +3217,34 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2307,39 +3255,49 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ -ac_cv_prog_cc_g=no + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -2355,23 +3313,18 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -2394,12 +3347,17 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2414,205 +3372,37 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - 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_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg fi -rm -f conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac +if test "x$ac_cv_prog_cc_c89" != xno; then : -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_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 - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_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 - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_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 - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2620,18 +3410,14 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for inline" >&5 -echo $ECHO_N "checking for inline... $ECHO_C" >&6 -if test "${ac_cv_c_inline+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; @@ -2640,41 +3426,16 @@ $ac_kw foo_t foo () {return 0; } #endif _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_c_inline=$ac_kw; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break done fi -echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -echo "${ECHO_T}$ac_cv_c_inline" >&6 - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; @@ -2702,15 +3463,15 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -2724,11 +3485,7 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -2737,78 +3494,34 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : break fi @@ -2820,8 +3533,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -2831,11 +3544,7 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -2844,85 +3553,40 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -2932,31 +3596,142 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -2971,51 +3746,23 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : + $EGREP "memchr" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -3025,18 +3772,14 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : + $EGREP "free" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -3046,16 +3789,13 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : : else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -3075,109 +3815,39 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./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 - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_run "$LINENO"; then : -( exit $ac_status ) -ac_cv_header_stdc=no +else + ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF +$as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+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. */ -$ac_includes_default - -#include <$ac_header> -_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 - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -3185,196 +3855,48 @@ fi done -if test "${ac_cv_header_stdlib_h+set}" = set; then - echo "$as_me:$LINENO: checking for stdlib.h" >&5 -echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 -if test "${ac_cv_header_stdlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking stdlib.h usability" >&5 -echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#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_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking stdlib.h presence" >&5 -echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ----------------------------- ## -## Report this to the tk lists. ## -## ----------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for stdlib.h" >&5 -echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 -if test "${ac_cv_header_stdlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_stdlib_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 - -fi -if test $ac_cv_header_stdlib_h = yes; then +ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : tk_ok=1 else tk_ok=0 fi -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtol" >/dev/null 2>&1; then - : + $EGREP "strtol" >/dev/null 2>&1; then : + else tk_ok=0 fi rm -f conftest* -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtoul" >/dev/null 2>&1; then - : + $EGREP "strtoul" >/dev/null 2>&1; then : + else tk_ok=0 fi rm -f conftest* -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtod" >/dev/null 2>&1; then - : + $EGREP "strtod" >/dev/null 2>&1; then : + else tk_ok=0 fi @@ -3382,9 +3904,7 @@ rm -f conftest* if test $tk_ok = 0; then -cat >>confdefs.h <<\_ACEOF -#define NO_STDLIB_H 1 -_ACEOF +$as_echo "#define NO_STDLIB_H 1" >>confdefs.h fi @@ -3394,18 +3914,14 @@ fi #------------------------------------------------------------------------ if test -z "$no_pipe" && test -n "$GCC"; then - echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 -echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 -if test "${tcl_cv_cc_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5 +$as_echo_n "checking if the compiler understands -pipe... " >&6; } +if ${tcl_cv_cc_pipe+:} false; then : + $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3416,40 +3932,16 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_cc_pipe=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_pipe=no + tcl_cv_cc_pipe=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$hold_cflags fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 -echo "${ECHO_T}$tcl_cv_cc_pipe" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5 +$as_echo "$tcl_cv_cc_pipe" >&6; } if test $tcl_cv_cc_pipe = yes; then CFLAGS="$CFLAGS -pipe" fi @@ -3460,13 +3952,13 @@ fi #------------------------------------------------------------------------ - # Check whether --enable-threads or --disable-threads was given. -if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval + # Check whether --enable-threads was given. +if test "${enable_threads+set}" = set; then : + enableval=$enable_threads; tcl_ok=$enableval else tcl_ok=yes -fi; +fi + if test "${TCL_THREADS}" = 1; then tcl_threaded_core=1; @@ -3477,92 +3969,56 @@ fi; # USE_THREAD_ALLOC tells us to try the special thread-based # allocator that significantly reduces lock contention -cat >>confdefs.h <<\_ACEOF -#define USE_THREAD_ALLOC 1 -_ACEOF +$as_echo "#define USE_THREAD_ALLOC 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF +$as_echo "#define _REENTRANT 1" >>confdefs.h if test "`uname -s`" = "SunOS" ; then -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF +$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h fi -cat >>confdefs.h <<\_ACEOF -#define _THREAD_SAFE 1 -_ACEOF +$as_echo "#define _THREAD_SAFE 1" >>confdefs.h - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 -if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 +$as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_mutex_init+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 pthread_mutex_init (); int main () { -pthread_mutex_init (); +return pthread_mutex_init (); ; 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_mutex_init=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthread_pthread_mutex_init=no + ac_cv_lib_pthread_pthread_mutex_init=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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_pthread_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 -if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no @@ -3574,71 +4030,43 @@ fi # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] - echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 -echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 -if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5 +$as_echo_n "checking for __pthread_mutex_init in -lpthread... " >&6; } +if ${ac_cv_lib_pthread___pthread_mutex_init+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 __pthread_mutex_init (); int main () { -__pthread_mutex_init (); +return __pthread_mutex_init (); ; 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread___pthread_mutex_init=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthread___pthread_mutex_init=no + ac_cv_lib_pthread___pthread_mutex_init=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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_pthread___pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 -if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_pthread___pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no @@ -3650,71 +4078,43 @@ fi # The space is needed THREADS_LIBS=" -lpthread" else - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 -if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5 +$as_echo_n "checking for pthread_mutex_init in -lpthreads... " >&6; } +if ${ac_cv_lib_pthreads_pthread_mutex_init+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 pthread_mutex_init (); int main () { -pthread_mutex_init (); +return pthread_mutex_init (); ; 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthreads_pthread_mutex_init=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pthreads_pthread_mutex_init=no + ac_cv_lib_pthreads_pthread_mutex_init=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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_pthreads_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 -if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no @@ -3724,142 +4124,86 @@ fi # The space is needed THREADS_LIBS=" -lpthreads" else - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 -if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5 +$as_echo_n "checking for pthread_mutex_init in -lc... " >&6; } +if ${ac_cv_lib_c_pthread_mutex_init+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 pthread_mutex_init (); int main () { -pthread_mutex_init (); +return pthread_mutex_init (); ; 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_pthread_mutex_init=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_c_pthread_mutex_init=no + ac_cv_lib_c_pthread_mutex_init=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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_c_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 -if test $ac_cv_lib_c_pthread_mutex_init = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_c_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then - echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 -if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5 +$as_echo_n "checking for pthread_mutex_init in -lc_r... " >&6; } +if ${ac_cv_lib_c_r_pthread_mutex_init+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 pthread_mutex_init (); int main () { -pthread_mutex_init (); +return pthread_mutex_init (); ; 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_r_pthread_mutex_init=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_c_r_pthread_mutex_init=no + ac_cv_lib_c_r_pthread_mutex_init=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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_c_r_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 -if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 +$as_echo "$ac_cv_lib_c_r_pthread_mutex_init" >&6; } +if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes; then : tcl_ok=yes else tcl_ok=no @@ -3870,8 +4214,8 @@ fi THREADS_LIBS=" -pthread" else TCL_THREADS=0 - { echo "$as_me:$LINENO: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&5 -echo "$as_me: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&5 +$as_echo "$as_me: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&2;} fi fi fi @@ -3882,104 +4226,13 @@ echo "$as_me: WARNING: Don't know how to find pthread lib on your system - you m ac_saved_libs=$LIBS LIBS="$LIBS $THREADS_LIBS" - - -for ac_func in pthread_attr_setstacksize pthread_atfork -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+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. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* 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 $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - 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 - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then + for ac_func in pthread_attr_setstacksize pthread_atfork +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -3990,24 +4243,22 @@ done TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output - echo "$as_me:$LINENO: checking for building with threads" >&5 -echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for building with threads" >&5 +$as_echo_n "checking for building with threads... " >&6; } if test "${TCL_THREADS}" = 1; then -cat >>confdefs.h <<\_ACEOF -#define TCL_THREADS 1 -_ACEOF +$as_echo "#define TCL_THREADS 1" >>confdefs.h if test "${tcl_threaded_core}" = 1; then - echo "$as_me:$LINENO: result: yes (threaded core)" >&5 -echo "${ECHO_T}yes (threaded core)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (threaded core)" >&5 +$as_echo "yes (threaded core)" >&6; } else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4017,15 +4268,15 @@ echo "${ECHO_T}no" >&6 LIBS="$LIBS$THREADS_LIBS" - echo "$as_me:$LINENO: checking how to build libraries" >&5 -echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 - # Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5 +$as_echo_n "checking how to build libraries... " >&6; } + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; tcl_ok=$enableval else tcl_ok=yes -fi; +fi + if test "${enable_shared+set}" = set; then enableval="$enable_shared" @@ -4035,17 +4286,15 @@ fi; fi if test "$tcl_ok" = "yes" ; then - echo "$as_me:$LINENO: result: shared" >&5 -echo "${ECHO_T}shared" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5 +$as_echo "shared" >&6; } SHARED_BUILD=1 else - echo "$as_me:$LINENO: result: static" >&5 -echo "${ECHO_T}static" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5 +$as_echo "static" >&6; } SHARED_BUILD=0 -cat >>confdefs.h <<\_ACEOF -#define STATIC_BUILD 1 -_ACEOF +$as_echo "#define STATIC_BUILD 1" >>confdefs.h fi @@ -4059,10 +4308,10 @@ _ACEOF if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -4072,35 +4321,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. @@ -4110,28 +4361,38 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - RANLIB=$ac_ct_RANLIB + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else RANLIB="$ac_cv_prog_RANLIB" fi @@ -4140,52 +4401,47 @@ fi # Step 0.a: Enable 64 bit support? - echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 -echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6 - # Check whether --enable-64bit or --disable-64bit was given. -if test "${enable_64bit+set}" = set; then - enableval="$enable_64bit" - do64bit=$enableval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5 +$as_echo_n "checking if 64bit support is requested... " >&6; } + # Check whether --enable-64bit was given. +if test "${enable_64bit+set}" = set; then : + enableval=$enable_64bit; do64bit=$enableval else do64bit=no -fi; - echo "$as_me:$LINENO: result: $do64bit" >&5 -echo "${ECHO_T}$do64bit" >&6 +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 +$as_echo "$do64bit" >&6; } # Step 0.b: Enable Solaris 64 bit VIS support? - echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 -echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 - # Check whether --enable-64bit-vis or --disable-64bit-vis was given. -if test "${enable_64bit_vis+set}" = set; then - enableval="$enable_64bit_vis" - do64bitVIS=$enableval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5 +$as_echo_n "checking if 64bit Sparc VIS support is requested... " >&6; } + # Check whether --enable-64bit-vis was given. +if test "${enable_64bit_vis+set}" = set; then : + enableval=$enable_64bit_vis; do64bitVIS=$enableval else do64bitVIS=no -fi; - echo "$as_me:$LINENO: result: $do64bitVIS" >&5 -echo "${ECHO_T}$do64bitVIS" >&6 +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5 +$as_echo "$do64bitVIS" >&6; } # Force 64bit on with VIS - if test "$do64bitVIS" = "yes"; then + if test "$do64bitVIS" = "yes"; then : do64bit=yes fi - # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. - echo "$as_me:$LINENO: checking if compiler supports visibility \"hidden\"" >&5 -echo $ECHO_N "checking if compiler supports visibility \"hidden\"... $ECHO_C" >&6 -if test "${tcl_cv_cc_visibility_hidden+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5 +$as_echo_n "checking if compiler supports visibility \"hidden\"... " >&6; } +if ${tcl_cv_cc_visibility_hidden+:} false; then : + $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern __attribute__((__visibility__("hidden"))) void f(void); @@ -4198,79 +4454,50 @@ f(); 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 +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_visibility_hidden=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_visibility_hidden=no + tcl_cv_cc_visibility_hidden=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_visibility_hidden" >&5 -echo "${ECHO_T}$tcl_cv_cc_visibility_hidden" >&6 - if test $tcl_cv_cc_visibility_hidden = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5 +$as_echo "$tcl_cv_cc_visibility_hidden" >&6; } + if test $tcl_cv_cc_visibility_hidden = yes; then : -cat >>confdefs.h <<\_ACEOF -#define MODULE_SCOPE extern __attribute__((__visibility__("hidden"))) -_ACEOF +$as_echo "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define HAVE_HIDDEN 1 -_ACEOF +$as_echo "#define HAVE_HIDDEN 1" >>confdefs.h fi - # Step 0.d: Disable -rpath support? - echo "$as_me:$LINENO: checking if rpath support is requested" >&5 -echo $ECHO_N "checking if rpath support is requested... $ECHO_C" >&6 - # Check whether --enable-rpath or --disable-rpath was given. -if test "${enable_rpath+set}" = set; then - enableval="$enable_rpath" - doRpath=$enableval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5 +$as_echo_n "checking if rpath support is requested... " >&6; } + # Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then : + enableval=$enable_rpath; doRpath=$enableval else doRpath=yes -fi; - echo "$as_me:$LINENO: result: $doRpath" >&5 -echo "${ECHO_T}$doRpath" >&6 +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5 +$as_echo "$doRpath" >&6; } # Step 1: set the variable "system" to hold the name and version number # for the system. - echo "$as_me:$LINENO: checking system version" >&5 -echo $ECHO_N "checking system version... $ECHO_C" >&6 -if test "${tcl_cv_sys_version+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking system version" >&5 +$as_echo_n "checking system version... " >&6; } +if ${tcl_cv_sys_version+:} false; then : + $as_echo_n "(cached) " >&6 else if test -f /usr/lib/NextStep/software_version; then @@ -4278,8 +4505,8 @@ else else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then - { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 -echo "$as_me: WARNING: can't find uname command" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5 +$as_echo "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else # Special check for weird MP-RAS system (uname returns weird @@ -4295,79 +4522,51 @@ echo "$as_me: WARNING: can't find uname command" >&2;} fi fi -echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 -echo "${ECHO_T}$tcl_cv_sys_version" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5 +$as_echo "$tcl_cv_sys_version" >&6; } system=$tcl_cv_sys_version # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 dlopen (); int main () { -dlopen (); +return dlopen (); ; 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no + ac_cv_lib_dl_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : have_dl=yes else have_dl=no @@ -4393,7 +4592,7 @@ fi ECHO_VERSION='`echo ${VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g - if test "$GCC" = yes; then + if test "$GCC" = yes; then : CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall" @@ -4404,14 +4603,13 @@ else CFLAGS_WARNING="" fi - if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. @@ -4421,35 +4619,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. @@ -4459,27 +4659,38 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - AR=$ac_ct_AR + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi else AR="$ac_cv_prog_AR" fi @@ -4489,13 +4700,12 @@ fi PLAT_OBJS="" PLAT_SRCS="" LDAIX_SRC="" - if test x"${SHLIB_VERSION}" = x; then + if test x"${SHLIB_VERSION}" = x; then : SHLIB_VERSION="1.0" fi - case $system in AIX-*) - if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then + if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then : # AIX requires the _r compiler when gcc isn't being used case "${CC}" in @@ -4507,11 +4717,10 @@ fi CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'` ;; esac - echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 -echo "${ECHO_T}Using $CC for compiling with threads" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5 +$as_echo "Using $CC for compiling with threads" >&6; } fi - LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" @@ -4524,12 +4733,12 @@ fi LDAIX_SRC='$(UNIX_DIR)/ldAix' # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = yes; then + if test "$do64bit" = yes; then : - if test "$GCC" = yes; then + if test "$GCC" = yes; then : - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else @@ -4542,17 +4751,15 @@ else fi - fi - - if test "`uname -m`" = ia64; then + if test "`uname -m`" = ia64; then : # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" - if test "$GCC" = yes; then + if test "$GCC" = yes; then : CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' @@ -4561,12 +4768,11 @@ else CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else - if test "$GCC" = yes; then + if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared -Wl,-bexpall' @@ -4576,14 +4782,12 @@ else LDFLAGS="$LDFLAGS -brtl" fi - SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi - ;; BeOS*) SHLIB_CFLAGS="-fPIC" @@ -4597,71 +4801,43 @@ fi # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- - echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 -echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6 -if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5 +$as_echo_n "checking for inet_ntoa in -lbind... " >&6; } +if ${ac_cv_lib_bind_inet_ntoa+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbind $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 inet_ntoa (); int main () { -inet_ntoa (); +return inet_ntoa (); ; 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bind_inet_ntoa=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_bind_inet_ntoa=no + ac_cv_lib_bind_inet_ntoa=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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_bind_inet_ntoa" >&5 -echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6 -if test $ac_cv_lib_bind_inet_ntoa = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5 +$as_echo "$ac_cv_lib_bind_inet_ntoa" >&6; } +if test "x$ac_cv_lib_bind_inet_ntoa" = xyes; then : LIBS="$LIBS -lbind -lsocket" fi @@ -4698,16 +4874,12 @@ fi TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a' SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$@.a" - echo "$as_me:$LINENO: checking for Cygwin version of gcc" >&5 -echo $ECHO_N "checking for Cygwin version of gcc... $ECHO_C" >&6 -if test "${ac_cv_cygwin+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cygwin version of gcc" >&5 +$as_echo_n "checking for Cygwin version of gcc... " >&6; } +if ${ac_cv_cygwin+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __CYGWIN__ @@ -4722,49 +4894,21 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_cygwin=no else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_cygwin=yes + ac_cv_cygwin=yes fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_cygwin" >&5 -echo "${ECHO_T}$ac_cv_cygwin" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cygwin" >&5 +$as_echo "$ac_cv_cygwin" >&6; } if test "$ac_cv_cygwin" = "no"; then - { { echo "$as_me:$LINENO: error: ${CC} is not a cygwin compiler." >&5 -echo "$as_me: error: ${CC} is not a cygwin compiler." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "${CC} is not a cygwin compiler." "$LINENO" 5 fi if test "x${TCL_THREADS}" = "x0"; then - { { echo "$as_me:$LINENO: error: CYGWIN compile is only supported with --enable-threads" >&5 -echo "$as_me: error: CYGWIN compile is only supported with --enable-threads" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "CYGWIN compile is only supported with --enable-threads" "$LINENO" 5 fi do64bit_ok=yes if test "x${SHARED_BUILD}" = "x1"; then @@ -4794,71 +4938,43 @@ echo "$as_me: error: CYGWIN compile is only supported with --enable-threads" >&2 SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}' DL_OBJS="tclLoadDl.o" DL_LIBS="-lroot" - echo "$as_me:$LINENO: checking for inet_ntoa in -lnetwork" >&5 -echo $ECHO_N "checking for inet_ntoa in -lnetwork... $ECHO_C" >&6 -if test "${ac_cv_lib_network_inet_ntoa+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5 +$as_echo_n "checking for inet_ntoa in -lnetwork... " >&6; } +if ${ac_cv_lib_network_inet_ntoa+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnetwork $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 inet_ntoa (); int main () { -inet_ntoa (); +return inet_ntoa (); ; 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_network_inet_ntoa=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_network_inet_ntoa=no + ac_cv_lib_network_inet_ntoa=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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_network_inet_ntoa" >&5 -echo "${ECHO_T}$ac_cv_lib_network_inet_ntoa" >&6 -if test $ac_cv_lib_network_inet_ntoa = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5 +$as_echo "$ac_cv_lib_network_inet_ntoa" >&6; } +if test "x$ac_cv_lib_network_inet_ntoa" = xyes; then : LIBS="$LIBS -lnetwork" fi @@ -4866,18 +4982,14 @@ fi HP-UX-*.11.*) # Use updated header definitions where possible -cat >>confdefs.h <<\_ACEOF -#define _XOPEN_SOURCE_EXTENDED 1 -_ACEOF +$as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define _XOPEN_SOURCE 1 -_ACEOF +$as_echo "#define _XOPEN_SOURCE 1" >>confdefs.h LIBS="$LIBS -lxnet" # Use the XOPEN network library - if test "`uname -m`" = ia64; then + if test "`uname -m`" = ia64; then : SHLIB_SUFFIX=".so" @@ -4886,78 +4998,49 @@ else SHLIB_SUFFIX=".sl" fi - - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 shl_load (); int main () { -shl_load (); +return shl_load (); ; 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no + ac_cv_lib_dld_shl_load=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : tcl_ok=yes else tcl_ok=no fi - if test "$tcl_ok" = yes; then + if test "$tcl_ok" = yes; then : SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" @@ -4969,8 +5052,7 @@ fi LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi - - if test "$GCC" = yes; then + if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} @@ -4981,30 +5063,28 @@ else fi - # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes"; then + if test "$do64bit" = "yes"; then : - if test "$GCC" = yes; then + if test "$GCC" = yes; then : case `${CC} -dumpmachine` in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD='${CC} -shared' - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} ;; esac @@ -5016,82 +5096,52 @@ else fi - -fi - ;; +fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 shl_load (); int main () { -shl_load (); +return shl_load (); ; 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no + ac_cv_lib_dld_shl_load=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : tcl_ok=yes else tcl_ok=no fi - if test "$tcl_ok" = yes; then + if test "$tcl_ok" = yes; then : SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" @@ -5103,28 +5153,24 @@ fi LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" -fi - ;; +fi ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - case $LIBOBJS in - "mkstemp.$ac_objext" | \ - *" mkstemp.$ac_objext" | \ - "mkstemp.$ac_objext "* | \ + case " $LIBOBJS " in *" mkstemp.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;; + *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" + ;; esac - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi - ;; IRIX-6.*) SHLIB_CFLAGS="" @@ -5132,21 +5178,18 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - case $LIBOBJS in - "mkstemp.$ac_objext" | \ - *" mkstemp.$ac_objext" | \ - "mkstemp.$ac_objext "* | \ + case " $LIBOBJS " in *" mkstemp.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;; + *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" + ;; esac - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi - - if test "$GCC" = yes; then + if test "$GCC" = yes; then : CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" @@ -5165,7 +5208,6 @@ else LDFLAGS="$LDFLAGS -n32" fi - ;; IRIX64-6.*) SHLIB_CFLAGS="" @@ -5173,29 +5215,26 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - case $LIBOBJS in - "mkstemp.$ac_objext" | \ - *" mkstemp.$ac_objext" | \ - "mkstemp.$ac_objext "* | \ + case " $LIBOBJS " in *" mkstemp.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;; + *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" + ;; esac - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = yes; then + if test "$do64bit" = yes; then : - if test "$GCC" = yes; then + if test "$GCC" = yes; then : - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 -echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} else @@ -5206,9 +5245,7 @@ else fi - fi - ;; Linux*|GNU*|NetBSD-Debian) SHLIB_CFLAGS="-fPIC" @@ -5224,31 +5261,25 @@ fi DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "`uname -m`" = "alpha"; then + if test "`uname -m`" = "alpha"; then : CFLAGS="$CFLAGS -mieee" fi + if test $do64bit = yes; then : - if test $do64bit = yes; then - - echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 -echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_m64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5 +$as_echo_n "checking if compiler accepts -m64 flag... " >&6; } +if ${tcl_cv_cc_m64+:} false; then : + $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -5259,62 +5290,35 @@ main () 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 +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_m64=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_m64=no + tcl_cv_cc_m64=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 -echo "${ECHO_T}$tcl_cv_cc_m64" >&6 - if test $tcl_cv_cc_m64 = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5 +$as_echo "$tcl_cv_cc_m64" >&6; } + if test $tcl_cv_cc_m64 = yes; then : CFLAGS="$CFLAGS -m64" do64bit_ok=yes fi - fi - # The combo of gcc + glibc has a bug related to inlining of # functions like strtod(). The -fno-builtin flag should address # this problem but it does not work. The -fno-inline flag is kind # of overkill but it works. Disable inlining only when one of the # files in compat/*.c is being linked in. - if test x"${USE_COMPAT}" != x; then + if test x"${USE_COMPAT}" != x; then : CFLAGS="$CFLAGS -fno-inline" fi - ;; Lynx*) SHLIB_CFLAGS="-fPIC" @@ -5324,12 +5328,11 @@ fi DL_OBJS="tclLoadDl.o" DL_LIBS="-mshared -ldl" LD_FLAGS="-Wl,--export-dynamic" - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi - ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" @@ -5375,11 +5378,10 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' LDFLAGS="-Wl,-export-dynamic" @@ -5396,7 +5398,7 @@ fi CFLAGS_OPTIMIZE="-O2" ;; esac - if test "${TCL_THREADS}" = "1"; then + if test "${TCL_THREADS}" = "1"; then : # On OpenBSD: Compile with -pthread # Don't link with -lpthread @@ -5404,7 +5406,6 @@ fi CFLAGS="$CFLAGS -pthread" fi - # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots @@ -5417,13 +5418,12 @@ fi DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "${TCL_THREADS}" = "1"; then + if test "${TCL_THREADS}" = "1"; then : # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` @@ -5431,7 +5431,6 @@ fi LDFLAGS="$LDFLAGS -pthread" fi - ;; FreeBSD-*) # This configuration from FreeBSD Ports. @@ -5442,20 +5441,18 @@ fi DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' fi - - if test "${TCL_THREADS}" = "1"; then + if test "${TCL_THREADS}" = "1"; then : # The -pthread needs to go in the LDFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LIBS" fi - case $system in FreeBSD-3.*) # Version numbers are dot-stripped by system policy. @@ -5478,23 +5475,19 @@ fi CFLAGS="`echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" - if test $do64bit = yes; then + if test $do64bit = yes; then : case `arch` in ppc) - echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 -echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_arch_ppc64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5 +$as_echo_n "checking if compiler accepts -arch ppc64 flag... " >&6; } +if ${tcl_cv_cc_arch_ppc64+:} false; then : + $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -5505,62 +5498,33 @@ main () 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 +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_arch_ppc64=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_arch_ppc64=no + tcl_cv_cc_arch_ppc64=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 -echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6 - if test $tcl_cv_cc_arch_ppc64 = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5 +$as_echo "$tcl_cv_cc_arch_ppc64" >&6; } + if test $tcl_cv_cc_arch_ppc64 = yes; then : CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes -fi -;; +fi;; i386) - echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 -echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6 -if test "${tcl_cv_cc_arch_x86_64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5 +$as_echo_n "checking if compiler accepts -arch x86_64 flag... " >&6; } +if ${tcl_cv_cc_arch_x86_64+:} false; then : + $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -5571,79 +5535,48 @@ main () 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 +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_arch_x86_64=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_arch_x86_64=no + tcl_cv_cc_arch_x86_64=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 -echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6 - if test $tcl_cv_cc_arch_x86_64 = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5 +$as_echo "$tcl_cv_cc_arch_x86_64" >&6; } + if test $tcl_cv_cc_arch_x86_64 = yes; then : CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes -fi -;; +fi;; *) - { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 -echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 +$as_echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; esac else # Check for combined 32-bit and 64-bit fat build if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \ - && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then + && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then : fat_32_64=yes fi - fi - SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}' - echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 -echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_single_module+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -single_module flag" >&5 +$as_echo_n "checking if ld accepts -single_module flag... " >&6; } +if ${tcl_cv_ld_single_module+:} false; then : + $as_echo_n "(cached) " >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -5654,71 +5587,41 @@ int i; 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 +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_single_module=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_single_module=no + tcl_cv_ld_single_module=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 -echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 - if test $tcl_cv_ld_single_module = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_single_module" >&5 +$as_echo "$tcl_cv_ld_single_module" >&6; } + if test $tcl_cv_ld_single_module = yes; then : SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi - SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" # Don't use -prebind when building for Mac OS X 10.4 or later only: if test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \ - "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then + "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then : LDFLAGS="$LDFLAGS -prebind" fi - LDFLAGS="$LDFLAGS -headerpad_max_install_names" - echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 -echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_search_paths_first+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5 +$as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; } +if ${tcl_cv_ld_search_paths_first+:} false; then : + $as_echo_n "(cached) " >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -5729,88 +5632,58 @@ int i; 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 +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_search_paths_first=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_search_paths_first=no + tcl_cv_ld_search_paths_first=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 -echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 - if test $tcl_cv_ld_search_paths_first = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5 +$as_echo "$tcl_cv_ld_search_paths_first" >&6; } + if test $tcl_cv_ld_search_paths_first = yes; then : LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi - - if test "$tcl_cv_cc_visibility_hidden" != yes; then + if test "$tcl_cv_cc_visibility_hidden" != yes; then : -cat >>confdefs.h <<\_ACEOF -#define MODULE_SCOPE __private_extern__ -_ACEOF +$as_echo "#define MODULE_SCOPE __private_extern__" >>confdefs.h fi - CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" -cat >>confdefs.h <<\_ACEOF -#define MAC_OSX_TCL 1 -_ACEOF +$as_echo "#define MAC_OSX_TCL 1" >>confdefs.h PLAT_OBJS='${MAC_OSX_OBJS}' PLAT_SRCS='${MAC_OSX_SRCS}' - echo "$as_me:$LINENO: checking whether to use CoreFoundation" >&5 -echo $ECHO_N "checking whether to use CoreFoundation... $ECHO_C" >&6 - # Check whether --enable-corefoundation or --disable-corefoundation was given. -if test "${enable_corefoundation+set}" = set; then - enableval="$enable_corefoundation" - tcl_corefoundation=$enableval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use CoreFoundation" >&5 +$as_echo_n "checking whether to use CoreFoundation... " >&6; } + # Check whether --enable-corefoundation was given. +if test "${enable_corefoundation+set}" = set; then : + enableval=$enable_corefoundation; tcl_corefoundation=$enableval else tcl_corefoundation=yes -fi; - echo "$as_me:$LINENO: result: $tcl_corefoundation" >&5 -echo "${ECHO_T}$tcl_corefoundation" >&6 - if test $tcl_corefoundation = yes; then +fi - echo "$as_me:$LINENO: checking for CoreFoundation.framework" >&5 -echo $ECHO_N "checking for CoreFoundation.framework... $ECHO_C" >&6 -if test "${tcl_cv_lib_corefoundation+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_corefoundation" >&5 +$as_echo "$tcl_corefoundation" >&6; } + if test $tcl_corefoundation = yes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CoreFoundation.framework" >&5 +$as_echo_n "checking for CoreFoundation.framework... " >&6; } +if ${tcl_cv_lib_corefoundation+:} false; then : + $as_echo_n "(cached) " >&6 else hold_libs=$LIBS - if test "$fat_32_64" = yes; then + if test "$fat_32_64" = yes; then : for v in CFLAGS CPPFLAGS LDFLAGS; do # On Tiger there is no 64-bit CF, so remove 64-bit @@ -5820,13 +5693,8 @@ else eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done fi - LIBS="$LIBS -framework CoreFoundation" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -5837,77 +5705,45 @@ CFBundleRef b = CFBundleGetMainBundle(); 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 +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_lib_corefoundation=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_lib_corefoundation=no + tcl_cv_lib_corefoundation=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test "$fat_32_64" = yes; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$fat_32_64" = yes; then : for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi - LIBS=$hold_libs fi -echo "$as_me:$LINENO: result: $tcl_cv_lib_corefoundation" >&5 -echo "${ECHO_T}$tcl_cv_lib_corefoundation" >&6 - if test $tcl_cv_lib_corefoundation = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation" >&5 +$as_echo "$tcl_cv_lib_corefoundation" >&6; } + if test $tcl_cv_lib_corefoundation = yes; then : LIBS="$LIBS -framework CoreFoundation" -cat >>confdefs.h <<\_ACEOF -#define HAVE_COREFOUNDATION 1 -_ACEOF +$as_echo "#define HAVE_COREFOUNDATION 1" >>confdefs.h else tcl_corefoundation=no fi + if test "$fat_32_64" = yes -a $tcl_corefoundation = yes; then : - if test "$fat_32_64" = yes -a $tcl_corefoundation = yes; then - - echo "$as_me:$LINENO: checking for 64-bit CoreFoundation" >&5 -echo $ECHO_N "checking for 64-bit CoreFoundation... $ECHO_C" >&6 -if test "${tcl_cv_lib_corefoundation_64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit CoreFoundation" >&5 +$as_echo_n "checking for 64-bit CoreFoundation... " >&6; } +if ${tcl_cv_lib_corefoundation_64+:} false; then : + $as_echo_n "(cached) " >&6 else for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -5918,60 +5754,31 @@ CFBundleRef b = CFBundleGetMainBundle(); 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 +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_lib_corefoundation_64=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_lib_corefoundation_64=no + tcl_cv_lib_corefoundation_64=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi -echo "$as_me:$LINENO: result: $tcl_cv_lib_corefoundation_64" >&5 -echo "${ECHO_T}$tcl_cv_lib_corefoundation_64" >&6 - if test $tcl_cv_lib_corefoundation_64 = no; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation_64" >&5 +$as_echo "$tcl_cv_lib_corefoundation_64" >&6; } + if test $tcl_cv_lib_corefoundation_64 = no; then : -cat >>confdefs.h <<\_ACEOF -#define NO_COREFOUNDATION_64 1 -_ACEOF +$as_echo "#define NO_COREFOUNDATION_64 1" >>confdefs.h LDFLAGS="$LDFLAGS -Wl,-no_arch_warnings" fi - fi - fi - ;; NEXTSTEP-*) SHLIB_CFLAGS="" @@ -5987,9 +5794,7 @@ fi SHLIB_LD_LIBS="" CFLAGS_OPTIMIZE="" # Optimizer is buggy -cat >>confdefs.h <<\_ACEOF -#define _OE_SOCKETS 1 -_ACEOF +$as_echo "#define _OE_SOCKETS 1" >>confdefs.h ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) @@ -6007,14 +5812,13 @@ _ACEOF OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" - if test "$SHARED_BUILD" = 1; then + if test "$SHARED_BUILD" = 1; then : SHLIB_LD="ld -shared" else SHLIB_LD="ld -non_shared" fi - SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -6025,7 +5829,7 @@ fi OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" - if test "$SHARED_BUILD" = 1; then + if test "$SHARED_BUILD" = 1; then : SHLIB_LD='ld -shared -expect_unresolved "*"' @@ -6034,30 +5838,27 @@ else SHLIB_LD='ld -non_shared -expect_unresolved "*"' fi - SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - if test $doRpath = yes; then + if test $doRpath = yes; then : CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi - - if test "$GCC" = yes; then + if test "$GCC" = yes; then : CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi - # see pthread_intro(3) for pthread support on osf1, k.furukawa - if test "${TCL_THREADS}" = 1; then + if test "${TCL_THREADS}" = 1; then : CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` - if test "$GCC" = yes; then + if test "$GCC" = yes; then : LIBS="$LIBS -lpthread -lmach -lexc" @@ -6068,9 +5869,7 @@ else fi - fi - ;; QNX-6*) # QNX RTP @@ -6089,7 +5888,7 @@ fi # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. - if test "$GCC" = yes; then + if test "$GCC" = yes; then : SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" @@ -6100,7 +5899,6 @@ else LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi - SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" @@ -6145,21 +5943,17 @@ fi # won't define thread-safe library routines. -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF +$as_echo "#define _REENTRANT 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF +$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h SHLIB_CFLAGS="-KPIC" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - if test "$GCC" = yes; then + if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' @@ -6172,37 +5966,32 @@ else LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi - ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. -cat >>confdefs.h <<\_ACEOF -#define _REENTRANT 1 -_ACEOF +$as_echo "#define _REENTRANT 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF +$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = yes; then + if test "$do64bit" = yes; then : arch=`isainfo` - if test "$arch" = "sparcv9 sparc"; then + if test "$arch" = "sparcv9 sparc"; then : - if test "$GCC" = yes; then + if test "$GCC" = yes; then : - if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then + if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then : - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} else @@ -6213,11 +6002,10 @@ else fi - else do64bit_ok=yes - if test "$do64bitVIS" = yes; then + if test "$do64bitVIS" = yes; then : CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" @@ -6228,17 +6016,15 @@ else LDFLAGS_ARCH="-xarch=v9" fi - # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" fi - else - if test "$arch" = "amd64 i386"; then + if test "$arch" = "amd64 i386"; then : - if test "$GCC" = yes; then + if test "$GCC" = yes; then : case $system in SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) @@ -6246,8 +6032,8 @@ else CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; esac else @@ -6264,169 +6050,32 @@ else fi - else - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 -echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5 +$as_echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} fi - fi - fi - #-------------------------------------------------------------------- # On Solaris 5.x i386 with the sunpro compiler we need to link # with sunmath to get floating point rounding control #-------------------------------------------------------------------- - if test "$GCC" = yes; then + if test "$GCC" = yes; then : use_sunmath=no else arch=`isainfo` - echo "$as_me:$LINENO: checking whether to use -lsunmath for fp rounding control" >&5 -echo $ECHO_N "checking whether to use -lsunmath for fp rounding control... $ECHO_C" >&6 - if test "$arch" = "amd64 i386" -o "$arch" = "i386"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use -lsunmath for fp rounding control" >&5 +$as_echo_n "checking whether to use -lsunmath for fp rounding control... " >&6; } + if test "$arch" = "amd64 i386" -o "$arch" = "i386"; then : - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } MATH_LIBS="-lsunmath $MATH_LIBS" - if test "${ac_cv_header_sunmath_h+set}" = set; then - echo "$as_me:$LINENO: checking for sunmath.h" >&5 -echo $ECHO_N "checking for sunmath.h... $ECHO_C" >&6 -if test "${ac_cv_header_sunmath_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sunmath_h" >&5 -echo "${ECHO_T}$ac_cv_header_sunmath_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking sunmath.h usability" >&5 -echo $ECHO_N "checking sunmath.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#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_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking sunmath.h presence" >&5 -echo $ECHO_N "checking sunmath.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: sunmath.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sunmath.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sunmath.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sunmath.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sunmath.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sunmath.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sunmath.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sunmath.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sunmath.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sunmath.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sunmath.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sunmath.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sunmath.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sunmath.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sunmath.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sunmath.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ----------------------------- ## -## Report this to the tk lists. ## -## ----------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for sunmath.h" >&5 -echo $ECHO_N "checking for sunmath.h... $ECHO_C" >&6 -if test "${ac_cv_header_sunmath_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_sunmath_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sunmath_h" >&5 -echo "${ECHO_T}$ac_cv_header_sunmath_h" >&6 + ac_fn_c_check_header_mongrel "$LINENO" "sunmath.h" "ac_cv_header_sunmath_h" "$ac_includes_default" +if test "x$ac_cv_header_sunmath_h" = xyes; then : fi @@ -6435,26 +6084,24 @@ fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } use_sunmath=no fi - fi - SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - if test "$GCC" = yes; then + if test "$GCC" = yes; then : SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "$do64bit_ok" = yes; then + if test "$do64bit_ok" = yes; then : - if test "$arch" = "sparcv9 sparc"; then + if test "$arch" = "sparcv9 sparc"; then : # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. @@ -6465,26 +6112,22 @@ fi #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" else - if test "$arch" = "amd64 i386"; then + if test "$arch" = "amd64 i386"; then : SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" fi - fi - fi - else - if test "$use_sunmath" = yes; then + if test "$use_sunmath" = yes; then : textmode=textoff else textmode=text fi - case $system in SunOS-5.[1-9][0-9]*|SunOS-5.[7-9]) SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";; @@ -6495,7 +6138,6 @@ fi LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi - ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" @@ -6506,19 +6148,15 @@ fi DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. - echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 -echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_Bexport+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld accepts -Bexport flag" >&5 +$as_echo_n "checking for ld accepts -Bexport flag... " >&6; } +if ${tcl_cv_ld_Bexport+:} false; then : + $as_echo_n "(cached) " >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6529,93 +6167,63 @@ int i; 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 +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_Bexport=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_Bexport=no + tcl_cv_ld_Bexport=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 -echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6 - if test $tcl_cv_ld_Bexport = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_Bexport" >&5 +$as_echo "$tcl_cv_ld_Bexport" >&6; } + if test $tcl_cv_ld_Bexport = yes; then : LDFLAGS="$LDFLAGS -Wl,-Bexport" fi - CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; esac - if test "$do64bit" = yes -a "$do64bit_ok" = no; then + if test "$do64bit" = yes -a "$do64bit_ok" = no; then : - { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 -echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 +$as_echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi - - if test "$do64bit" = yes -a "$do64bit_ok" = yes; then + if test "$do64bit" = yes -a "$do64bit_ok" = yes; then : -cat >>confdefs.h <<\_ACEOF -#define TCL_CFG_DO64BIT 1 -_ACEOF +$as_echo "#define TCL_CFG_DO64BIT 1" >>confdefs.h fi - # Step 4: disable dynamic loading if requested via a command-line switch. - # Check whether --enable-load or --disable-load was given. -if test "${enable_load+set}" = set; then - enableval="$enable_load" - tcl_ok=$enableval + # Check whether --enable-load was given. +if test "${enable_load+set}" = set; then : + enableval=$enable_load; tcl_ok=$enableval else tcl_ok=yes -fi; - if test "$tcl_ok" = no; then - DL_OBJS="" fi + if test "$tcl_ok" = no; then : + DL_OBJS="" +fi - if test "x$DL_OBJS" != x; then + if test "x$DL_OBJS" != x; then : BUILD_DLTEST="\$(DLTEST_TARGETS)" else - { echo "$as_me:$LINENO: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&5 -echo "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&5 +$as_echo "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&2;} SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" @@ -6627,14 +6235,13 @@ echo "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libr BUILD_DLTEST="" fi - LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. - if test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes; then + if test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes; then : case $system in AIX-*) ;; @@ -6648,35 +6255,29 @@ fi esac fi + if test "$tcl_cv_cc_visibility_hidden" != yes; then : - if test "$tcl_cv_cc_visibility_hidden" != yes; then - -cat >>confdefs.h <<\_ACEOF -#define MODULE_SCOPE extern -_ACEOF +$as_echo "#define MODULE_SCOPE extern" >>confdefs.h fi - - if test "$SHARED_LIB_SUFFIX" = ""; then + if test "$SHARED_LIB_SUFFIX" = ""; then : SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}' fi - - if test "$UNSHARED_LIB_SUFFIX" = ""; then + if test "$UNSHARED_LIB_SUFFIX" = ""; then : UNSHARED_LIB_SUFFIX='${VERSION}.a' fi - DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)" - if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""; then + if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""; then : LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' - if test "${SHLIB_SUFFIX}" = ".dll"; then + if test "${SHLIB_SUFFIX}" = ".dll"; then : INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" @@ -6687,12 +6288,11 @@ else fi - else LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} - if test "$RANLIB" = ""; then + if test "$RANLIB" = ""; then : MAKE_LIB='$(STLIB_LD) $@ ${OBJS}' @@ -6701,14 +6301,12 @@ else MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@' fi - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' fi - # Stub lib does not depend on shared/static configuration - if test "$RANLIB" = ""; then + if test "$RANLIB" = ""; then : MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}' @@ -6717,33 +6315,27 @@ else MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@' fi - INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"' # Define TCL_LIBS now that we know what DL_LIBS is. # The trick here is that we don't want to change the value of TCL_LIBS if # it is already set when tclConfig.sh had been loaded by Tk. - if test "x${TCL_LIBS}" = x; then + if test "x${TCL_LIBS}" = x; then : TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}" fi - # See if the compiler supports casting to a union type. # This is used to stop gcc from printing a compiler # warning when initializing a union member. - echo "$as_me:$LINENO: checking for cast to union support" >&5 -echo $ECHO_N "checking for cast to union support... $ECHO_C" >&6 -if test "${tcl_cv_cast_to_union+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5 +$as_echo_n "checking for cast to union support... " >&6; } +if ${tcl_cv_cast_to_union+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6757,45 +6349,19 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_cast_to_union=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cast_to_union=no + tcl_cv_cast_to_union=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $tcl_cv_cast_to_union" >&5 -echo "${ECHO_T}$tcl_cv_cast_to_union" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5 +$as_echo "$tcl_cv_cast_to_union" >&6; } if test "$tcl_cv_cast_to_union" = "yes"; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_CAST_TO_UNION 1 -_ACEOF +$as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h fi @@ -6841,38 +6407,34 @@ _ACEOF - echo "$as_me:$LINENO: checking for build with symbols" >&5 -echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 - # Check whether --enable-symbols or --disable-symbols was given. -if test "${enable_symbols+set}" = set; then - enableval="$enable_symbols" - tcl_ok=$enableval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5 +$as_echo_n "checking for build with symbols... " >&6; } + # Check whether --enable-symbols was given. +if test "${enable_symbols+set}" = set; then : + enableval=$enable_symbols; tcl_ok=$enableval else tcl_ok=no -fi; +fi + # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. DBGX="" if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' -cat >>confdefs.h <<\_ACEOF -#define NDEBUG 1 -_ACEOF +$as_echo "#define NDEBUG 1" >>confdefs.h - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } -cat >>confdefs.h <<\_ACEOF -#define TCL_CFG_OPTIMIZED 1 -_ACEOF +$as_echo "#define TCL_CFG_OPTIMIZED 1" >>confdefs.h else CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' if test "$tcl_ok" = "yes"; then - echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 -echo "${ECHO_T}yes (standard debugging)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5 +$as_echo "yes (standard debugging)" >&6; } fi fi @@ -6880,9 +6442,7 @@ echo "${ECHO_T}yes (standard debugging)" >&6 if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then -cat >>confdefs.h <<\_ACEOF -#define TCL_MEM_DEBUG 1 -_ACEOF +$as_echo "#define TCL_MEM_DEBUG 1" >>confdefs.h fi @@ -6890,11 +6450,11 @@ _ACEOF if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then - echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 -echo "${ECHO_T}enabled symbols mem debugging" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem debugging" >&5 +$as_echo "enabled symbols mem debugging" >&6; } else - echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 -echo "${ECHO_T}enabled $tcl_ok debugging" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5 +$as_echo "enabled $tcl_ok debugging" >&6; } fi fi @@ -6904,18 +6464,14 @@ echo "${ECHO_T}enabled $tcl_ok debugging" >&6 #-------------------------------------------------------------------- - echo "$as_me:$LINENO: checking for required early compiler flags" >&5 -echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5 +$as_echo_n "checking for required early compiler flags... " >&6; } tcl_flags="" - if test "${tcl_cv_flag__isoc99_source+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if ${tcl_cv_flag__isoc99_source+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -6926,38 +6482,10 @@ char *p = (char *)strtoll; char *q = (char *)strtoull; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__isoc99_source=no else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include @@ -6969,58 +6497,28 @@ char *p = (char *)strtoll; char *q = (char *)strtoull; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__isoc99_source=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_flag__isoc99_source=no + tcl_cv_flag__isoc99_source=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then -cat >>confdefs.h <<\_ACEOF -#define _ISOC99_SOURCE 1 -_ACEOF +$as_echo "#define _ISOC99_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _ISOC99_SOURCE" fi - if test "${tcl_cv_flag__largefile64_source+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if ${tcl_cv_flag__largefile64_source+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -7031,38 +6529,10 @@ struct stat64 buf; int i = stat64("/", &buf); return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile64_source=no else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE64_SOURCE 1 #include @@ -7074,58 +6544,28 @@ struct stat64 buf; int i = stat64("/", &buf); return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile64_source=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_flag__largefile64_source=no + tcl_cv_flag__largefile64_source=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then -cat >>confdefs.h <<\_ACEOF -#define _LARGEFILE64_SOURCE 1 -_ACEOF +$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" fi - if test "${tcl_cv_flag__largefile_source64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if ${tcl_cv_flag__largefile_source64+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -7136,38 +6576,10 @@ char *p = (char *)open64; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile_source64=no else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE_SOURCE64 1 #include @@ -7179,72 +6591,42 @@ char *p = (char *)open64; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_flag__largefile_source64=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_flag__largefile_source64=no + tcl_cv_flag__largefile_source64=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then -cat >>confdefs.h <<\_ACEOF -#define _LARGEFILE_SOURCE64 1 -_ACEOF +$as_echo "#define _LARGEFILE_SOURCE64 1" >>confdefs.h tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" fi if test "x${tcl_flags}" = "x" ; then - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } else - echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 -echo "${ECHO_T}${tcl_flags}" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5 +$as_echo "${tcl_flags}" >&6; } fi - echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 -echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 - if test "${tcl_cv_type_64bit+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit integer type" >&5 +$as_echo_n "checking for 64-bit integer type... " >&6; } + if ${tcl_cv_type_64bit+:} false; then : + $as_echo_n "(cached) " >&6 else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -7255,44 +6637,16 @@ __int64 value = (__int64) 0; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_type_64bit=__int64 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_type_64bit="long long" + tcl_type_64bit="long long" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -7305,66 +6659,35 @@ switch (0) { return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_type_64bit=${tcl_type_64bit} -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then -cat >>confdefs.h <<\_ACEOF -#define TCL_WIDE_INT_IS_LONG 1 -_ACEOF +$as_echo "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h - echo "$as_me:$LINENO: result: using long" >&5 -echo "${ECHO_T}using long" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: using long" >&5 +$as_echo "using long" >&6; } else cat >>confdefs.h <<_ACEOF #define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} _ACEOF - echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 -echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_cv_type_64bit}" >&5 +$as_echo "${tcl_cv_type_64bit}" >&6; } # Now check for auxiliary declarations - echo "$as_me:$LINENO: checking for struct dirent64" >&5 -echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 -if test "${tcl_cv_struct_dirent64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5 +$as_echo_n "checking for struct dirent64... " >&6; } +if ${tcl_cv_struct_dirent64+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -7376,58 +6699,28 @@ struct dirent64 p; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_struct_dirent64=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_struct_dirent64=no + tcl_cv_struct_dirent64=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 -echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5 +$as_echo "$tcl_cv_struct_dirent64" >&6; } if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_DIRENT64 1 -_ACEOF +$as_echo "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h fi - echo "$as_me:$LINENO: checking for struct stat64" >&5 -echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 -if test "${tcl_cv_struct_stat64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5 +$as_echo_n "checking for struct stat64... " >&6; } +if ${tcl_cv_struct_stat64+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -7439,161 +6732,40 @@ struct stat64 p; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_struct_stat64=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_struct_stat64=no + tcl_cv_struct_stat64=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 -echo "${ECHO_T}$tcl_cv_struct_stat64" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5 +$as_echo "$tcl_cv_struct_stat64" >&6; } if test "x${tcl_cv_struct_stat64}" = "xyes" ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_STAT64 1 -_ACEOF +$as_echo "#define HAVE_STRUCT_STAT64 1" >>confdefs.h fi - - -for ac_func in open64 lseek64 -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+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. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* 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 $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - 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 - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then + for ac_func in open64 lseek64 +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done - echo "$as_me:$LINENO: checking for off64_t" >&5 -echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 - if test "${tcl_cv_type_off64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5 +$as_echo_n "checking for off64_t... " >&6; } + if ${tcl_cv_type_off64_t+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -7605,51 +6777,25 @@ off64_t offset; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_type_off64_t=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_type_off64_t=no + tcl_cv_type_off64_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_TYPE_OFF64_T 1 -_ACEOF +$as_echo "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi fi @@ -7658,235 +6804,229 @@ echo "${ECHO_T}no" >&6 # Check endianness because we can optimize some operations #-------------------------------------------------------------------- -echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include -#include + #include int main () { -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif ; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include -#include + #include int main () { #if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif + not big endian + #endif ; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_bigendian=no + ac_cv_c_bigendian=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include -# It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +#include + int main () { - _ascii (); _ebcdic (); +#ifndef _BIG_ENDIAN + not big endian + #endif + ; return 0; } _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 - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +$ac_includes_default int main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./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 +if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + ac_cv_c_bigendian=yes fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -case $ac_cv_c_bigendian in - yes) +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac #------------------------------------------------------------------------ @@ -7901,10 +7041,10 @@ if test "$TCL_EXEC_PREFIX" != "$exec_prefix"; then fi if test "$TCL_PREFIX" != "$prefix"; then - { echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Different --prefix selected for Tk and Tcl! [package require Tk] may not work correctly in tclsh." >&5 -echo "$as_me: WARNING: +$as_echo "$as_me: WARNING: Different --prefix selected for Tk and Tcl! [package require Tk] may not work correctly in tclsh." >&2;} fi @@ -7919,17 +7059,13 @@ fi # special flag. #-------------------------------------------------------------------- -echo "$as_me:$LINENO: checking for fd_set in sys/types" >&5 -echo $ECHO_N "checking for fd_set in sys/types... $ECHO_C" >&6 -if test "${tcl_cv_type_fd_set+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fd_set in sys/types" >&5 +$as_echo_n "checking for fd_set in sys/types... " >&6; } +if ${tcl_cv_type_fd_set+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -7940,58 +7076,30 @@ fd_set readMask, writeMask; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_type_fd_set=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_type_fd_set=no + tcl_cv_type_fd_set=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $tcl_cv_type_fd_set" >&5 -echo "${ECHO_T}$tcl_cv_type_fd_set" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_type_fd_set" >&5 +$as_echo "$tcl_cv_type_fd_set" >&6; } tk_ok=$tcl_cv_type_fd_set if test $tk_ok = no; then - echo "$as_me:$LINENO: checking for fd_mask in sys/select" >&5 -echo $ECHO_N "checking for fd_mask in sys/select... $ECHO_C" >&6 -if test "${tcl_cv_grep_fd_mask+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fd_mask in sys/select" >&5 +$as_echo_n "checking for fd_mask in sys/select... " >&6; } +if ${tcl_cv_grep_fd_mask+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "fd_mask" >/dev/null 2>&1; then + $EGREP "fd_mask" >/dev/null 2>&1; then : tcl_cv_grep_fd_mask=present else tcl_cv_grep_fd_mask=missing @@ -7999,22 +7107,18 @@ fi rm -f conftest* fi -echo "$as_me:$LINENO: result: $tcl_cv_grep_fd_mask" >&5 -echo "${ECHO_T}$tcl_cv_grep_fd_mask" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_grep_fd_mask" >&5 +$as_echo "$tcl_cv_grep_fd_mask" >&6; } if test $tcl_cv_grep_fd_mask = present; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_SYS_SELECT_H 1 -_ACEOF +$as_echo "#define HAVE_SYS_SELECT_H 1" >>confdefs.h tk_ok=yes fi fi if test $tk_ok = no; then -cat >>confdefs.h <<\_ACEOF -#define NO_FD_SET 1 -_ACEOF +$as_echo "#define NO_FD_SET 1" >>confdefs.h fi @@ -8022,166 +7126,24 @@ fi # Find out all about time handling differences. #------------------------------------------------------------------------------ - for ac_header in sys/time.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_TIME_H 1 _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_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ----------------------------- ## -## Report this to the tk lists. ## -## ----------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 -if test "${ac_cv_header_time+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 +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -8196,44 +7158,18 @@ return 0; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_time=no + ac_cv_header_time=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then -cat >>confdefs.h <<\_ACEOF -#define TIME_WITH_SYS_TIME 1 -_ACEOF +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi @@ -8246,117 +7182,24 @@ fi #-------------------------------------------------------------------- - echo "$as_me:$LINENO: checking for strtod" >&5 -echo $ECHO_N "checking for strtod... $ECHO_C" >&6 -if test "${ac_cv_func_strtod+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. */ -/* Define strtod to an innocuous variant, in case declares strtod. - For example, HP-UX 11i declares gettimeofday. */ -#define strtod innocuous_strtod - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char strtod (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef strtod - -/* 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 strtod (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_strtod) || defined (__stub___strtod) -choke me -#else -char (*f) () = strtod; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != strtod; - ; - 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_func_strtod=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_strtod=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_strtod" >&5 -echo "${ECHO_T}$ac_cv_func_strtod" >&6 -if test $ac_cv_func_strtod = yes; then + ac_fn_c_check_func "$LINENO" "strtod" "ac_cv_func_strtod" +if test "x$ac_cv_func_strtod" = xyes; then : tcl_strtod=1 else tcl_strtod=0 fi if test "$tcl_strtod" = 1; then - echo "$as_me:$LINENO: checking for Solaris2.4/Tru64 strtod bugs" >&5 -echo $ECHO_N "checking for Solaris2.4/Tru64 strtod bugs... $ECHO_C" >&6 -if test "${tcl_cv_strtod_buggy+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris2.4/Tru64 strtod bugs" >&5 +$as_echo_n "checking for Solaris2.4/Tru64 strtod bugs... " >&6; } +if ${tcl_cv_strtod_buggy+:} false; then : + $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : tcl_cv_strtod_buggy=buggy else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern double strtod(); @@ -8379,45 +7222,28 @@ cat >>conftest.$ac_ext <<_ACEOF exit(0); } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./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 +if ac_fn_c_try_run "$LINENO"; then : tcl_cv_strtod_buggy=ok else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -tcl_cv_strtod_buggy=buggy + tcl_cv_strtod_buggy=buggy fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi -echo "$as_me:$LINENO: result: $tcl_cv_strtod_buggy" >&5 -echo "${ECHO_T}$tcl_cv_strtod_buggy" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_strtod_buggy" >&5 +$as_echo "$tcl_cv_strtod_buggy" >&6; } if test "$tcl_cv_strtod_buggy" = buggy; then - case $LIBOBJS in - "fixstrtod.$ac_objext" | \ - *" fixstrtod.$ac_objext" | \ - "fixstrtod.$ac_objext "* | \ + case " $LIBOBJS " in *" fixstrtod.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS fixstrtod.$ac_objext" ;; + *) LIBOBJS="$LIBOBJS fixstrtod.$ac_objext" + ;; esac USE_COMPAT=1 -cat >>confdefs.h <<\_ACEOF -#define strtod fixstrtod -_ACEOF +$as_echo "#define strtod fixstrtod" >>confdefs.h fi fi @@ -8428,64 +7254,9 @@ _ACEOF # they don't exist. #-------------------------------------------------------------------- -echo "$as_me:$LINENO: checking for mode_t" >&5 -echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 -if test "${ac_cv_type_mode_t+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. */ -$ac_includes_default -int -main () -{ -if ((mode_t *) 0) - return 0; -if (sizeof (mode_t)) - return 0; - ; - return 0; -} -_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_type_mode_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = xyes; then : -ac_cv_type_mode_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 -echo "${ECHO_T}$ac_cv_type_mode_t" >&6 -if test $ac_cv_type_mode_t = yes; then - : else cat >>confdefs.h <<_ACEOF @@ -8494,64 +7265,9 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 -if test "${ac_cv_type_pid_t+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. */ -$ac_includes_default -int -main () -{ -if ((pid_t *) 0) - return 0; -if (sizeof (pid_t)) - return 0; - ; - return 0; -} -_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_type_pid_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : -ac_cv_type_pid_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6 -if test $ac_cv_type_pid_t = yes; then - : else cat >>confdefs.h <<_ACEOF @@ -8560,88 +7276,29 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 -if test "${ac_cv_type_size_t+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. */ -$ac_includes_default -int -main () -{ -if ((size_t *) 0) - return 0; -if (sizeof (size_t)) - return 0; - ; - return 0; -} -_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_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : -ac_cv_type_size_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 -if test $ac_cv_type_size_t = yes; then - : else cat >>confdefs.h <<_ACEOF -#define size_t unsigned +#define size_t unsigned int _ACEOF fi -echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 -echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 -if test "${ac_cv_type_uid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if ${ac_cv_type_uid_t+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1; then + $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no @@ -8649,147 +7306,59 @@ fi rm -f conftest* fi -echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 -echo "${ECHO_T}$ac_cv_type_uid_t" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then -cat >>confdefs.h <<\_ACEOF -#define uid_t int -_ACEOF +$as_echo "#define uid_t int" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define gid_t int -_ACEOF +$as_echo "#define gid_t int" >>confdefs.h fi -echo "$as_me:$LINENO: checking for intptr_t" >&5 -echo $ECHO_N "checking for intptr_t... $ECHO_C" >&6 -if test "${ac_cv_type_intptr_t+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. */ -$ac_includes_default -int -main () -{ -if ((intptr_t *) 0) - return 0; -if (sizeof (intptr_t)) - return 0; - ; - return 0; -} -_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_type_intptr_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_intptr_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_intptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_intptr_t" >&6 -if test $ac_cv_type_intptr_t = yes; then +ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default" +if test "x$ac_cv_type_intptr_t" = xyes; then : -cat >>confdefs.h <<\_ACEOF -#define HAVE_INTPTR_T 1 -_ACEOF +$as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h else - echo "$as_me:$LINENO: checking for pointer-size signed integer type" >&5 -echo $ECHO_N "checking for pointer-size signed integer type... $ECHO_C" >&6 -if test "${tcl_cv_intptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pointer-size signed integer type" >&5 +$as_echo_n "checking for pointer-size signed integer type... " >&6; } +if ${tcl_cv_intptr_t+:} false; then : + $as_echo_n "(cached) " >&6 else for tcl_cv_intptr_t in "int" "long" "long long" none; do if test "$tcl_cv_intptr_t" != none; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($tcl_cv_intptr_t))]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_ok=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_ok=no + tcl_ok=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$tcl_ok" = yes && break; fi done fi -echo "$as_me:$LINENO: result: $tcl_cv_intptr_t" >&5 -echo "${ECHO_T}$tcl_cv_intptr_t" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_intptr_t" >&5 +$as_echo "$tcl_cv_intptr_t" >&6; } if test "$tcl_cv_intptr_t" != none; then cat >>confdefs.h <<_ACEOF @@ -8800,132 +7369,48 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 -if test "${ac_cv_type_uintptr_t+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. */ -$ac_includes_default -int -main () -{ -if ((uintptr_t *) 0) - return 0; -if (sizeof (uintptr_t)) - return 0; - ; - return 0; -} -_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_type_uintptr_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_uintptr_t=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 -if test $ac_cv_type_uintptr_t = yes; then +ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" +if test "x$ac_cv_type_uintptr_t" = xyes; then : -cat >>confdefs.h <<\_ACEOF -#define HAVE_UINTPTR_T 1 -_ACEOF +$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h else - echo "$as_me:$LINENO: checking for pointer-size unsigned integer type" >&5 -echo $ECHO_N "checking for pointer-size unsigned integer type... $ECHO_C" >&6 -if test "${tcl_cv_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pointer-size unsigned integer type" >&5 +$as_echo_n "checking for pointer-size unsigned integer type... " >&6; } +if ${tcl_cv_uintptr_t+:} false; then : + $as_echo_n "(cached) " >&6 else for tcl_cv_uintptr_t in "unsigned int" "unsigned long" "unsigned long long" \ none; do if test "$tcl_cv_uintptr_t" != none; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($tcl_cv_uintptr_t))]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_ok=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_ok=no + tcl_ok=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$tcl_ok" = yes && break; fi done fi -echo "$as_me:$LINENO: result: $tcl_cv_uintptr_t" >&5 -echo "${ECHO_T}$tcl_cv_uintptr_t" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_uintptr_t" >&5 +$as_echo "$tcl_cv_uintptr_t" >&6; } if test "$tcl_cv_uintptr_t" != none; then cat >>confdefs.h <<_ACEOF @@ -8941,17 +7426,13 @@ fi # In OS/390 struct pwd has no pw_gecos field #------------------------------------------- -echo "$as_me:$LINENO: checking pw_gecos in struct pwd" >&5 -echo $ECHO_N "checking pw_gecos in struct pwd... $ECHO_C" >&6 -if test "${tcl_cv_pwd_pw_gecos+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pw_gecos in struct pwd" >&5 +$as_echo_n "checking pw_gecos in struct pwd... " >&6; } +if ${tcl_cv_pwd_pw_gecos+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -8962,44 +7443,18 @@ struct passwd pwd; pwd.pw_gecos; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_pwd_pw_gecos=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_pwd_pw_gecos=no + tcl_cv_pwd_pw_gecos=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $tcl_cv_pwd_pw_gecos" >&5 -echo "${ECHO_T}$tcl_cv_pwd_pw_gecos" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_pwd_pw_gecos" >&5 +$as_echo "$tcl_cv_pwd_pw_gecos" >&6; } if test $tcl_cv_pwd_pw_gecos = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_PW_GECOS 1 -_ACEOF +$as_echo "#define HAVE_PW_GECOS 1" >>confdefs.h fi @@ -9008,41 +7463,41 @@ fi #-------------------------------------------------------------------- if test "`uname -s`" = "Darwin" ; then - echo "$as_me:$LINENO: checking whether to use Aqua" >&5 -echo $ECHO_N "checking whether to use Aqua... $ECHO_C" >&6 - # Check whether --enable-aqua or --disable-aqua was given. -if test "${enable_aqua+set}" = set; then - enableval="$enable_aqua" - tk_aqua=$enableval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use Aqua" >&5 +$as_echo_n "checking whether to use Aqua... " >&6; } + # Check whether --enable-aqua was given. +if test "${enable_aqua+set}" = set; then : + enableval=$enable_aqua; tk_aqua=$enableval else tk_aqua=no -fi; +fi + if test $tk_aqua = yes -o $tk_aqua = cocoa; then tk_aqua=yes if test $tcl_corefoundation = no; then - { echo "$as_me:$LINENO: WARNING: Aqua can only be used when CoreFoundation is available" >&5 -echo "$as_me: WARNING: Aqua can only be used when CoreFoundation is available" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Aqua can only be used when CoreFoundation is available" >&5 +$as_echo "$as_me: WARNING: Aqua can only be used when CoreFoundation is available" >&2;} tk_aqua=no fi if test ! -d /System/Library/Frameworks/Cocoa.framework; then - { echo "$as_me:$LINENO: WARNING: Aqua can only be used when Cocoa is available" >&5 -echo "$as_me: WARNING: Aqua can only be used when Cocoa is available" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Aqua can only be used when Cocoa is available" >&5 +$as_echo "$as_me: WARNING: Aqua can only be used when Cocoa is available" >&2;} tk_aqua=no fi if test "`uname -r | awk -F. '{print $1}'`" -lt 9; then - { echo "$as_me:$LINENO: WARNING: Aqua requires Mac OS X 10.5 or later" >&5 -echo "$as_me: WARNING: Aqua requires Mac OS X 10.5 or later" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Aqua requires Mac OS X 10.5 or later" >&5 +$as_echo "$as_me: WARNING: Aqua requires Mac OS X 10.5 or later" >&2;} tk_aqua=no fi fi - echo "$as_me:$LINENO: result: $tk_aqua" >&5 -echo "${ECHO_T}$tk_aqua" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tk_aqua" >&5 +$as_echo "$tk_aqua" >&6; } if test "$fat_32_64" = yes; then if test $tk_aqua = no; then - echo "$as_me:$LINENO: checking for 64-bit X11" >&5 -echo $ECHO_N "checking for 64-bit X11... $ECHO_C" >&6 -if test "${tcl_cv_lib_x11_64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit X11" >&5 +$as_echo_n "checking for 64-bit X11... " >&6; } +if ${tcl_cv_lib_x11_64+:} false; then : + $as_echo_n "(cached) " >&6 else for v in CFLAGS CPPFLAGS LDFLAGS; do @@ -9050,11 +7505,7 @@ else done CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -9065,49 +7516,25 @@ XrmInitialize(); 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 +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_lib_x11_64=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_lib_x11_64=no + tcl_cv_lib_x11_64=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi -echo "$as_me:$LINENO: result: $tcl_cv_lib_x11_64" >&5 -echo "${ECHO_T}$tcl_cv_lib_x11_64" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_x11_64" >&5 +$as_echo "$tcl_cv_lib_x11_64" >&6; } fi # remove 64-bit arch flags from CFLAGS et al. for combined 32 & 64 bit # fat builds if configuration does not support 64-bit. if test "$tcl_cv_lib_x11_64" = no; then - { echo "$as_me:$LINENO: Removing 64-bit architectures from compiler & linker flags" >&5 -echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Removing 64-bit architectures from compiler & linker flags" >&5 +$as_echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;} for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done @@ -9115,19 +7542,15 @@ echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;} fi if test $tk_aqua = no; then # check if weak linking whole libraries is possible. - echo "$as_me:$LINENO: checking if ld accepts -weak-l flag" >&5 -echo $ECHO_N "checking if ld accepts -weak-l flag... $ECHO_C" >&6 -if test "${tcl_cv_ld_weak_l+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -weak-l flag" >&5 +$as_echo_n "checking if ld accepts -weak-l flag... " >&6; } +if ${tcl_cv_ld_weak_l+:} false; then : + $as_echo_n "(cached) " >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-weak-lm" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -9138,186 +7561,24 @@ double f = sin(1.0); 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 +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_ld_weak_l=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_ld_weak_l=no + tcl_cv_ld_weak_l=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -echo "$as_me:$LINENO: result: $tcl_cv_ld_weak_l" >&5 -echo "${ECHO_T}$tcl_cv_ld_weak_l" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_weak_l" >&5 +$as_echo "$tcl_cv_ld_weak_l" >&6; } fi - -for ac_header in AvailabilityMacros.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_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_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ----------------------------- ## -## Report this to the tk lists. ## -## ----------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 + for ac_header in AvailabilityMacros.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "AvailabilityMacros.h" "ac_cv_header_AvailabilityMacros_h" "$ac_includes_default" +if test "x$ac_cv_header_AvailabilityMacros_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_AVAILABILITYMACROS_H 1 _ACEOF fi @@ -9325,18 +7586,14 @@ fi done if test "$ac_cv_header_AvailabilityMacros_h" = yes; then - echo "$as_me:$LINENO: checking if weak import is available" >&5 -echo $ECHO_N "checking if weak import is available... $ECHO_C" >&6 -if test "${tcl_cv_cc_weak_import+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if weak import is available" >&5 +$as_echo_n "checking if weak import is available... " >&6; } +if ${tcl_cv_cc_weak_import+:} false; then : + $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ @@ -9356,60 +7613,30 @@ rand(); 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 +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_cc_weak_import=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_weak_import=no + tcl_cv_cc_weak_import=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_weak_import" >&5 -echo "${ECHO_T}$tcl_cv_cc_weak_import" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_weak_import" >&5 +$as_echo "$tcl_cv_cc_weak_import" >&6; } if test $tcl_cv_cc_weak_import = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_WEAK_IMPORT 1 -_ACEOF +$as_echo "#define HAVE_WEAK_IMPORT 1" >>confdefs.h fi - echo "$as_me:$LINENO: checking if Darwin SUSv3 extensions are available" >&5 -echo $ECHO_N "checking if Darwin SUSv3 extensions are available... $ECHO_C" >&6 -if test "${tcl_cv_cc_darwin_c_source+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Darwin SUSv3 extensions are available" >&5 +$as_echo_n "checking if Darwin SUSv3 extensions are available... " >&6; } +if ${tcl_cv_cc_darwin_c_source+:} false; then : + $as_echo_n "(cached) " >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ @@ -9430,45 +7657,19 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_cc_darwin_c_source=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cc_darwin_c_source=no + tcl_cv_cc_darwin_c_source=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$hold_cflags fi -echo "$as_me:$LINENO: result: $tcl_cv_cc_darwin_c_source" >&5 -echo "${ECHO_T}$tcl_cv_cc_darwin_c_source" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_darwin_c_source" >&5 +$as_echo "$tcl_cv_cc_darwin_c_source" >&6; } if test $tcl_cv_cc_darwin_c_source = yes; then -cat >>confdefs.h <<\_ACEOF -#define _DARWIN_C_SOURCE 1 -_ACEOF +$as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h fi fi @@ -9478,18 +7679,14 @@ fi if test $tk_aqua = yes; then -cat >>confdefs.h <<\_ACEOF -#define MAC_OSX_TK 1 -_ACEOF +$as_echo "#define MAC_OSX_TK 1" >>confdefs.h LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit" EXTRA_CC_SWITCHES='-std=gnu99 -x objective-c' TK_WINDOWINGSYSTEM=AQUA if test -n "${enable_symbols}" -a "${enable_symbols}" != no; then -cat >>confdefs.h <<\_ACEOF -#define TK_MAC_DEBUG 1 -_ACEOF +$as_echo "#define TK_MAC_DEBUG 1" >>confdefs.h fi else @@ -9503,44 +7700,47 @@ else #-------------------------------------------------------------------- - echo "$as_me:$LINENO: checking for X" >&5 -echo $ECHO_N "checking for X... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 +$as_echo_n "checking for X... " >&6; } -# Check whether --with-x or --without-x was given. -if test "${with_x+set}" = set; then - withval="$with_x" +# Check whether --with-x was given. +if test "${with_x+set}" = set; then : + withval=$with_x; +fi -fi; # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else - if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then - # Both variables are already set. - have_x=yes - else - if test "${ac_cv_have_x+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + case $x_includes,$x_libraries in #( + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( + *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : + $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no -rm -fr conftest.dir +rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir - # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat >Imakefile <<'_ACEOF' -acfindx: - @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' -_ACEOF - if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` +incroot: + @echo incroot='${INCROOT}' +usrlibdir: + @echo usrlibdir='${USRLIBDIR}' +libdir: + @echo libdir='${LIBDIR}' +_ACEOF + if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. + for ac_var in incroot usrlibdir libdir; do + eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" + done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl; do - if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && - test -f $ac_im_libdir/libX11.$ac_extension; then + for ac_extension in a so sl dylib la dll; do + if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && + test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done @@ -9548,37 +7748,41 @@ _ACEOF # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in - /usr/include) ;; + /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in - /usr/lib | /lib) ;; + /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. - rm -fr conftest.dir + rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include +/usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 +/usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include +/usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 +/usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 @@ -9600,38 +7804,14 @@ ac_x_header_dirs=' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then +if ac_fn_c_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir @@ -9639,7 +7819,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi done fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then @@ -9648,11 +7828,7 @@ if test "$ac_x_libraries" = no; then # Don't add to $LIBS permanently. ac_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 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -9663,117 +7839,73 @@ XrmInitialize () 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 +if ac_fn_c_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -LIBS=$ac_save_LIBS -for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` + LIBS=$ac_save_LIBS +for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! - for ac_extension in a so sl; do - if test -r $ac_dir/libXt.$ac_extension; then + for ac_extension in a so sl dylib la dll; do + if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no -if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then - # Didn't find X anywhere. Cache the known absence of X. - ac_cv_have_x="have_x=no" -else - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" -fi +case $ac_x_includes,$ac_x_libraries in #( + no,* | *,no | *\'*) + # Didn't find X, or a directory has "'" in its name. + ac_cv_have_x="have_x=no";; #( + *) + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$ac_x_includes'\ + ac_x_libraries='$ac_x_libraries'" +esac fi - - fi +;; #( + *) have_x=yes;; + esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then - echo "$as_me:$LINENO: result: $have_x" >&5 -echo "${ECHO_T}$have_x" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 +$as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 -echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 + ac_cv_have_x="have_x=yes\ + ac_x_includes='$x_includes'\ + ac_x_libraries='$x_libraries'" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 +$as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else not_really_there="yes" fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext else if test ! -r $x_includes/X11/Xlib.h; then not_really_there="yes" @@ -9781,49 +7913,25 @@ rm -f conftest.err conftest.$ac_ext fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then - echo "$as_me:$LINENO: checking for X11 header files" >&5 -echo $ECHO_N "checking for X11 header files... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 header files" >&5 +$as_echo_n "checking for X11 header files... " >&6; } found_xincludes="no" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then +if ac_fn_c_try_cpp "$LINENO"; then : found_xincludes="yes" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - found_xincludes="no" fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext if test "$found_xincludes" = "no"; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Xlib.h; then - echo "$as_me:$LINENO: result: $i" >&5 -echo "${ECHO_T}$i" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5 +$as_echo "$i" >&6; } XINCLUDES=" -I$i" found_xincludes="yes" break @@ -9837,19 +7945,19 @@ echo "${ECHO_T}$i" >&6 fi fi if test "$found_xincludes" = "no"; then - echo "$as_me:$LINENO: result: couldn't find any!" >&5 -echo "${ECHO_T}couldn't find any!" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: couldn't find any!" >&5 +$as_echo "couldn't find any!" >&6; } fi if test "$no_x" = yes; then - echo "$as_me:$LINENO: checking for X11 libraries" >&5 -echo $ECHO_N "checking for X11 libraries... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 libraries" >&5 +$as_echo_n "checking for X11 libraries... " >&6; } XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then - echo "$as_me:$LINENO: result: $i" >&5 -echo "${ECHO_T}$i" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5 +$as_echo "$i" >&6; } XLIBSW="-L$i -lX11" x_libraries="$i" break @@ -9863,78 +7971,50 @@ echo "${ECHO_T}$i" >&6 fi fi if test "$XLIBSW" = nope ; then - echo "$as_me:$LINENO: checking for XCreateWindow in -lXwindow" >&5 -echo $ECHO_N "checking for XCreateWindow in -lXwindow... $ECHO_C" >&6 -if test "${ac_cv_lib_Xwindow_XCreateWindow+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XCreateWindow in -lXwindow" >&5 +$as_echo_n "checking for XCreateWindow in -lXwindow... " >&6; } +if ${ac_cv_lib_Xwindow_XCreateWindow+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXwindow $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 XCreateWindow (); int main () { -XCreateWindow (); +return XCreateWindow (); ; 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xwindow_XCreateWindow=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_Xwindow_XCreateWindow=no + ac_cv_lib_Xwindow_XCreateWindow=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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_Xwindow_XCreateWindow" >&5 -echo "${ECHO_T}$ac_cv_lib_Xwindow_XCreateWindow" >&6 -if test $ac_cv_lib_Xwindow_XCreateWindow = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xwindow_XCreateWindow" >&5 +$as_echo "$ac_cv_lib_Xwindow_XCreateWindow" >&6; } +if test "x$ac_cv_lib_Xwindow_XCreateWindow" = xyes; then : XLIBSW=-lXwindow fi fi if test "$XLIBSW" = nope ; then - echo "$as_me:$LINENO: result: could not find any! Using -lX11." >&5 -echo "${ECHO_T}could not find any! Using -lX11." >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find any! Using -lX11." >&5 +$as_echo "could not find any! Using -lX11." >&6; } XLIBSW=-lX11 fi @@ -9983,65 +8063,37 @@ fi #-------------------------------------------------------------------- if test $tk_aqua = no; then - echo "$as_me:$LINENO: checking for main in -lXbsd" >&5 -echo $ECHO_N "checking for main in -lXbsd... $ECHO_C" >&6 -if test "${ac_cv_lib_Xbsd_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXbsd" >&5 +$as_echo_n "checking for main in -lXbsd... " >&6; } +if ${ac_cv_lib_Xbsd_main+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXbsd $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { -main (); +return main (); ; 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xbsd_main=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_Xbsd_main=no + ac_cv_lib_Xbsd_main=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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_Xbsd_main" >&5 -echo "${ECHO_T}$ac_cv_lib_Xbsd_main" >&6 -if test $ac_cv_lib_Xbsd_main = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xbsd_main" >&5 +$as_echo "$ac_cv_lib_Xbsd_main" >&6; } +if test "x$ac_cv_lib_Xbsd_main" = xyes; then : LIBS="$LIBS -lXbsd" fi @@ -10059,17 +8111,13 @@ fi #-------------------------------------------------------------------- if test -d /usr/include/mit -a $tk_aqua = no; then - echo "$as_me:$LINENO: checking MIT X libraries" >&5 -echo $ECHO_N "checking MIT X libraries... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MIT X libraries" >&5 +$as_echo_n "checking MIT X libraries... " >&6; } tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS -I/usr/include/mit" tk_oldLibs=$LIBS LIBS="$LIBS -lX11-mit" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -10084,43 +8132,19 @@ main () 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 +if ac_fn_c_try_link "$LINENO"; then : - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } XLIBSW="-lX11-mit" XINCLUDES="-I/usr/include/mit" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$tk_oldCFlags LIBS=$tk_oldLibs fi @@ -10130,20 +8154,20 @@ fi #-------------------------------------------------------------------- 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use xft" >&5 +$as_echo_n "checking whether to use xft... " >&6; } + # Check whether --enable-xft was given. +if test "${enable_xft+set}" = set; then : + enableval=$enable_xft; enable_xft=$enableval else enable_xft="default" -fi; +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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_xft" >&5 +$as_echo "$enable_xft" >&6; } else found_xft="yes" XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || found_xft="no" @@ -10153,63 +8177,17 @@ echo "${ECHO_T}$enable_xft" >&6 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_xft" >&5 +$as_echo "$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_fn_c_check_header_compile "$LINENO" "X11/Xft/Xft.h" "ac_cv_header_X11_Xft_Xft_h" "#include +" +if test "x$ac_cv_header_X11_Xft_Xft_h" = xyes; then : -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 @@ -10225,72 +8203,43 @@ fi 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XftFontOpen in -lXft" >&5 +$as_echo_n "checking for XftFontOpen in -lXft... " >&6; } +if ${ac_cv_lib_Xft_XftFontOpen+:} false; then : + $as_echo_n "(cached) " >&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 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 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 +if ac_fn_c_try_link "$LINENO"; 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 + ac_cv_lib_Xft_XftFontOpen=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xft_XftFontOpen" >&5 +$as_echo "$ac_cv_lib_Xft_XftFontOpen" >&6; } +if test "x$ac_cv_lib_Xft_XftFontOpen" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXFT 1 _ACEOF @@ -10311,71 +8260,43 @@ fi CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" tk_oldLibs=$LIBS LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW -lfontconfig" - echo "$as_me:$LINENO: checking for FcFontSort in -lfontconfig" >&5 -echo $ECHO_N "checking for FcFontSort in -lfontconfig... $ECHO_C" >&6 -if test "${ac_cv_lib_fontconfig_FcFontSort+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FcFontSort in -lfontconfig" >&5 +$as_echo_n "checking for FcFontSort in -lfontconfig... " >&6; } +if ${ac_cv_lib_fontconfig_FcFontSort+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfontconfig $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 FcFontSort (); int main () { -FcFontSort (); +return FcFontSort (); ; 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fontconfig_FcFontSort=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_fontconfig_FcFontSort=no + ac_cv_lib_fontconfig_FcFontSort=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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_fontconfig_FcFontSort" >&5 -echo "${ECHO_T}$ac_cv_lib_fontconfig_FcFontSort" >&6 -if test $ac_cv_lib_fontconfig_FcFontSort = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fontconfig_FcFontSort" >&5 +$as_echo "$ac_cv_lib_fontconfig_FcFontSort" >&6; } +if test "x$ac_cv_lib_fontconfig_FcFontSort" = xyes; then : XFT_LIBS="$XFT_LIBS -lfontconfig" @@ -10386,8 +8307,8 @@ fi 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;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't find xft configuration, or xft is unusable" >&5 +$as_echo "$as_me: WARNING: Can't find xft configuration, or xft is unusable" >&2;} fi enable_xft=no XFT_CFLAGS="" @@ -10399,9 +8320,7 @@ echo "$as_me: WARNING: Can't find xft configuration, or xft is unusable" >&2;} if test $enable_xft = "yes" ; then UNIX_FONT_OBJS=tkUnixRFont.o -cat >>confdefs.h <<\_ACEOF -#define HAVE_XFT 1 -_ACEOF +$as_echo "#define HAVE_XFT 1" >>confdefs.h else UNIX_FONT_OBJS=tkUnixFont.o @@ -10420,55 +8339,9 @@ if test $tk_aqua = no; then 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 + ac_fn_c_check_header_compile "$LINENO" "X11/XKBlib.h" "ac_cv_header_X11_XKBlib_h" "#include +" +if test "x$ac_cv_header_X11_XKBlib_h" = xyes; then : xkblib_header_found=yes @@ -10480,71 +8353,43 @@ 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XkbKeycodeToKeysym in -lX11" >&5 +$as_echo_n "checking for XkbKeycodeToKeysym in -lX11... " >&6; } +if ${ac_cv_lib_X11_XkbKeycodeToKeysym+:} false; then : + $as_echo_n "(cached) " >&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 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 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 +if ac_fn_c_try_link "$LINENO"; 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 + ac_cv_lib_X11_XkbKeycodeToKeysym=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XkbKeycodeToKeysym" >&5 +$as_echo "$ac_cv_lib_X11_XkbKeycodeToKeysym" >&6; } +if test "x$ac_cv_lib_X11_XkbKeycodeToKeysym" = xyes; then : xkbkeycodetokeysym_found=yes @@ -10559,9 +8404,7 @@ fi fi if test $xkbkeycodetokeysym_found = "yes" ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_XKBKEYCODETOKEYSYM 1 -_ACEOF +$as_echo "#define HAVE_XKBKEYCODETOKEYSYM 1" >>confdefs.h fi CFLAGS=$tk_oldCFlags @@ -10573,15 +8416,11 @@ fi #-------------------------------------------------------------------- if test $tk_aqua = no && test "$GCC" = yes; then - echo "$as_me:$LINENO: checking whether XKeycodeToKeysym is deprecated" >&5 -echo $ECHO_N "checking whether XKeycodeToKeysym is deprecated... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether XKeycodeToKeysym is deprecated" >&5 +$as_echo_n "checking whether XKeycodeToKeysym is deprecated... " >&6; } tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS -Werror" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -10596,48 +8435,22 @@ main () 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 +if ac_fn_c_try_link "$LINENO"; then : - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -cat >>confdefs.h <<\_ACEOF -#define XKEYCODETOKEYSYM_IS_DEPRECATED 1 -_ACEOF +$as_echo "#define XKEYCODETOKEYSYM_IS_DEPRECATED 1" >>confdefs.h fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$tk_oldCFlags fi @@ -10657,306 +8470,115 @@ if test $tk_aqua = no; then LIBS="$tk_oldLibs $XLIBSW" xss_header_found=no xss_lib_found=no - echo "$as_me:$LINENO: checking whether to try to use XScreenSaver" >&5 -echo $ECHO_N "checking whether to try to use XScreenSaver... $ECHO_C" >&6 - # Check whether --enable-xss or --disable-xss was given. -if test "${enable_xss+set}" = set; then - enableval="$enable_xss" - enable_xss=$enableval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to try to use XScreenSaver" >&5 +$as_echo_n "checking whether to try to use XScreenSaver... " >&6; } + # Check whether --enable-xss was given. +if test "${enable_xss+set}" = set; then : + enableval=$enable_xss; enable_xss=$enableval else enable_xss=yes -fi; +fi + if test "$enable_xss" = "no" ; then - echo "$as_me:$LINENO: result: $enable_xss" >&5 -echo "${ECHO_T}$enable_xss" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_xss" >&5 +$as_echo "$enable_xss" >&6; } else - echo "$as_me:$LINENO: result: $enable_xss" >&5 -echo "${ECHO_T}$enable_xss" >&6 - echo "$as_me:$LINENO: checking for X11/extensions/scrnsaver.h" >&5 -echo $ECHO_N "checking for X11/extensions/scrnsaver.h... $ECHO_C" >&6 -if test "${ac_cv_header_X11_extensions_scrnsaver_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_extensions_scrnsaver_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_X11_extensions_scrnsaver_h=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_scrnsaver_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_scrnsaver_h" >&6 -if test $ac_cv_header_X11_extensions_scrnsaver_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_xss" >&5 +$as_echo "$enable_xss" >&6; } + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/scrnsaver.h" "ac_cv_header_X11_extensions_scrnsaver_h" "#include +" +if test "x$ac_cv_header_X11_extensions_scrnsaver_h" = xyes; then : xss_header_found=yes fi - echo "$as_me:$LINENO: checking for XScreenSaverQueryInfo" >&5 -echo $ECHO_N "checking for XScreenSaverQueryInfo... $ECHO_C" >&6 -if test "${ac_cv_func_XScreenSaverQueryInfo+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. */ -/* Define XScreenSaverQueryInfo to an innocuous variant, in case declares XScreenSaverQueryInfo. - For example, HP-UX 11i declares gettimeofday. */ -#define XScreenSaverQueryInfo innocuous_XScreenSaverQueryInfo - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char XScreenSaverQueryInfo (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef XScreenSaverQueryInfo - -/* 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 XScreenSaverQueryInfo (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_XScreenSaverQueryInfo) || defined (__stub___XScreenSaverQueryInfo) -choke me -#else -char (*f) () = XScreenSaverQueryInfo; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != XScreenSaverQueryInfo; - ; - 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_func_XScreenSaverQueryInfo=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_fn_c_check_func "$LINENO" "XScreenSaverQueryInfo" "ac_cv_func_XScreenSaverQueryInfo" +if test "x$ac_cv_func_XScreenSaverQueryInfo" = xyes; then : -ac_cv_func_XScreenSaverQueryInfo=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_XScreenSaverQueryInfo" >&5 -echo "${ECHO_T}$ac_cv_func_XScreenSaverQueryInfo" >&6 -if test $ac_cv_func_XScreenSaverQueryInfo = yes; then - : else - echo "$as_me:$LINENO: checking for XScreenSaverQueryInfo in -lXext" >&5 -echo $ECHO_N "checking for XScreenSaverQueryInfo in -lXext... $ECHO_C" >&6 -if test "${ac_cv_lib_Xext_XScreenSaverQueryInfo+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XScreenSaverQueryInfo in -lXext" >&5 +$as_echo_n "checking for XScreenSaverQueryInfo in -lXext... " >&6; } +if ${ac_cv_lib_Xext_XScreenSaverQueryInfo+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 XScreenSaverQueryInfo (); int main () { -XScreenSaverQueryInfo (); +return XScreenSaverQueryInfo (); ; 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xext_XScreenSaverQueryInfo=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_Xext_XScreenSaverQueryInfo=no + ac_cv_lib_Xext_XScreenSaverQueryInfo=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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_Xext_XScreenSaverQueryInfo" >&5 -echo "${ECHO_T}$ac_cv_lib_Xext_XScreenSaverQueryInfo" >&6 -if test $ac_cv_lib_Xext_XScreenSaverQueryInfo = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XScreenSaverQueryInfo" >&5 +$as_echo "$ac_cv_lib_Xext_XScreenSaverQueryInfo" >&6; } +if test "x$ac_cv_lib_Xext_XScreenSaverQueryInfo" = xyes; then : XLIBSW="$XLIBSW -lXext" xss_lib_found=yes else - echo "$as_me:$LINENO: checking for XScreenSaverQueryInfo in -lXss" >&5 -echo $ECHO_N "checking for XScreenSaverQueryInfo in -lXss... $ECHO_C" >&6 -if test "${ac_cv_lib_Xss_XScreenSaverQueryInfo+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XScreenSaverQueryInfo in -lXss" >&5 +$as_echo_n "checking for XScreenSaverQueryInfo in -lXss... " >&6; } +if ${ac_cv_lib_Xss_XScreenSaverQueryInfo+:} false; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXss -lXext $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #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 XScreenSaverQueryInfo (); int main () { -XScreenSaverQueryInfo (); +return XScreenSaverQueryInfo (); ; 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xss_XScreenSaverQueryInfo=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_Xss_XScreenSaverQueryInfo=no + ac_cv_lib_Xss_XScreenSaverQueryInfo=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core 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_Xss_XScreenSaverQueryInfo" >&5 -echo "${ECHO_T}$ac_cv_lib_Xss_XScreenSaverQueryInfo" >&6 -if test $ac_cv_lib_Xss_XScreenSaverQueryInfo = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xss_XScreenSaverQueryInfo" >&5 +$as_echo "$ac_cv_lib_Xss_XScreenSaverQueryInfo" >&6; } +if test "x$ac_cv_lib_Xss_XScreenSaverQueryInfo" = xyes; then : if test "$tcl_cv_ld_weak_l" = yes; then # On Darwin, weak link libXss if possible, @@ -10978,9 +8600,7 @@ fi fi if test $enable_xss = yes -a $xss_lib_found = yes -a $xss_header_found = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_XSS 1 -_ACEOF +$as_echo "#define HAVE_XSS 1" >>confdefs.h fi CFLAGS=$tk_oldCFlags @@ -10992,66 +8612,36 @@ fi # #define for __CHAR_UNSIGNED__. #-------------------------------------------------------------------- - -echo "$as_me:$LINENO: checking whether char is unsigned" >&5 -echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6 -if test "${ac_cv_c_char_unsigned+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 +$as_echo_n "checking whether char is unsigned... " >&6; } +if ${ac_cv_c_char_unsigned+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((char) -1) < 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_char_unsigned=no else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_char_unsigned=yes + ac_cv_c_char_unsigned=yes fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 -echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 +$as_echo "$ac_cv_c_char_unsigned" >&6; } if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then - cat >>confdefs.h <<\_ACEOF -#define __CHAR_UNSIGNED__ 1 -_ACEOF + $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h fi @@ -11090,38 +8680,38 @@ WISH_RSRC_FILE='wish$(VERSION).rsrc' if test "`uname -s`" = "Darwin" ; then if test "`uname -s`" = "Darwin" ; then - echo "$as_me:$LINENO: checking how to package libraries" >&5 -echo $ECHO_N "checking how to package libraries... $ECHO_C" >&6 - # Check whether --enable-framework or --disable-framework was given. -if test "${enable_framework+set}" = set; then - enableval="$enable_framework" - enable_framework=$enableval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to package libraries" >&5 +$as_echo_n "checking how to package libraries... " >&6; } + # Check whether --enable-framework was given. +if test "${enable_framework+set}" = set; then : + enableval=$enable_framework; enable_framework=$enableval else enable_framework=no -fi; +fi + if test $enable_framework = yes; then if test $SHARED_BUILD = 0; then - { echo "$as_me:$LINENO: WARNING: Frameworks can only be built if --enable-shared is yes" >&5 -echo "$as_me: WARNING: Frameworks can only be built if --enable-shared is yes" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be built if --enable-shared is yes" >&5 +$as_echo "$as_me: WARNING: Frameworks can only be built if --enable-shared is yes" >&2;} enable_framework=no fi if test $tcl_corefoundation = no; then - { echo "$as_me:$LINENO: WARNING: Frameworks can only be used when CoreFoundation is available" >&5 -echo "$as_me: WARNING: Frameworks can only be used when CoreFoundation is available" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be used when CoreFoundation is available" >&5 +$as_echo "$as_me: WARNING: Frameworks can only be used when CoreFoundation is available" >&2;} enable_framework=no fi fi if test $enable_framework = yes; then - echo "$as_me:$LINENO: result: framework" >&5 -echo "${ECHO_T}framework" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: framework" >&5 +$as_echo "framework" >&6; } FRAMEWORK_BUILD=1 else if test $SHARED_BUILD = 1; then - echo "$as_me:$LINENO: result: shared library" >&5 -echo "${ECHO_T}shared library" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared library" >&5 +$as_echo "shared library" >&6; } else - echo "$as_me:$LINENO: result: static library" >&5 -echo "${ECHO_T}static library" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: static library" >&5 +$as_echo "static library" >&6; } fi FRAMEWORK_BUILD=0 fi @@ -11133,7 +8723,7 @@ echo "${ECHO_T}static library" >&6 TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tk-Info.plist' EXTRA_WISH_LIBS='-sectcreate __TEXT __info_plist Wish-Info.plist' EXTRA_APP_CC_SWITCHES="${EXTRA_APP_CC_SWITCHES}"' -mdynamic-no-pic' - ac_config_files="$ac_config_files Tk-Info.plist:../macosx/Tk-Info.plist.in Wish-Info.plist:../macosx/Wish-Info.plist.in" + ac_config_files="$ac_config_files Tk-Info.plist:../macosx/Tk-Info.plist.in Wish-Info.plist:../macosx/Wish-Info.plist.in" for l in ${LOCALES}; do CFBUNDLELOCALIZATIONS="${CFBUNDLELOCALIZATIONS}$l"; done TK_YEAR="`date +%Y`" @@ -11141,13 +8731,11 @@ fi if test "$FRAMEWORK_BUILD" = "1" ; then -cat >>confdefs.h <<\_ACEOF -#define TK_FRAMEWORK 1 -_ACEOF +$as_echo "#define TK_FRAMEWORK 1" >>confdefs.h # Construct a fake local framework structure to make linking with # '-framework Tk' and running of tktest work - ac_config_commands="$ac_config_commands Tk.framework" + ac_config_commands="$ac_config_commands Tk.framework" LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH" if test "${libdir}" = '${exec_prefix}/lib'; then @@ -11285,7 +8873,7 @@ TK_SHARED_BUILD=${SHARED_BUILD} - ac_config_files="$ac_config_files Makefile:../unix/Makefile.in tkConfig.sh:../unix/tkConfig.sh.in tk.pc:../unix/tk.pc.in" +ac_config_files="$ac_config_files Makefile:../unix/Makefile.in tkConfig.sh:../unix/tkConfig.sh.in tk.pc:../unix/tk.pc.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -11305,39 +8893,70 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else - echo "not updating unwritable cache $cache_file" + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -11346,63 +8965,55 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, +# take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -11411,12 +9022,15 @@ LTLIBOBJS=$ac_ltlibobjs CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" -: ${CONFIG_STATUS=./config.status} + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -11426,81 +9040,253 @@ cat >$CONFIG_STATUS <<_ACEOF debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi -DUALCASE=1; export DUALCASE # for MKS sh -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' fi +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi -done + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` - -# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -11508,148 +9294,111 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file else - as_expr=false + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + +} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -11658,31 +9407,20 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by tk $as_me 8.6, which was -generated by GNU Autoconf 2.59. Invocation command line was +# values after options handling. +ac_log=" +This file was extended by tk $as_me 8.7, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -11690,43 +9428,41 @@ generated by GNU Autoconf 2.59. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" -cat >>$CONFIG_STATUS <<\_ACEOF +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE Configuration files: $config_files @@ -11734,83 +9470,78 @@ $config_files Configuration commands: $config_commands -Report bugs to ." -_ACEOF +Report bugs to the package provider." -cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -tk config.status 8.6 -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +tk config.status 8.7 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; esac shift @@ -11824,42 +9555,54 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 -cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # -# INIT-COMMANDS section. +# INIT-COMMANDS # - VERSION=${TK_VERSION} && tk_aqua=${tk_aqua} _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Tk-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Tk-Info.plist:../macosx/Tk-Info.plist.in" ;; - "Wish-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Wish-Info.plist:../macosx/Wish-Info.plist.in" ;; - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile:../unix/Makefile.in" ;; - "tkConfig.sh" ) CONFIG_FILES="$CONFIG_FILES tkConfig.sh:../unix/tkConfig.sh.in" ;; - "tk.pc" ) CONFIG_FILES="$CONFIG_FILES tk.pc:../unix/tk.pc.in" ;; - "Tk.framework" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Tk.framework" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; + case $ac_config_target in + "Tk-Info.plist") CONFIG_FILES="$CONFIG_FILES Tk-Info.plist:../macosx/Tk-Info.plist.in" ;; + "Wish-Info.plist") CONFIG_FILES="$CONFIG_FILES Wish-Info.plist:../macosx/Wish-Info.plist.in" ;; + "Tk.framework") CONFIG_COMMANDS="$CONFIG_COMMANDS Tk.framework" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:../unix/Makefile.in" ;; + "tkConfig.sh") CONFIG_FILES="$CONFIG_FILES tkConfig.sh:../unix/tkConfig.sh.in" ;; + "tk.pc") CONFIG_FILES="$CONFIG_FILES tk.pc:../unix/tk.pc.in" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -11870,523 +9613,409 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} { - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" -# -# CONFIG_FILES section. -# -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@TCL_VERSION@,$TCL_VERSION,;t t -s,@TCL_PATCH_LEVEL@,$TCL_PATCH_LEVEL,;t t -s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t -s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t -s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t -s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t -s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t -s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t -s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t -s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t -s,@TCLSH_PROG@,$TCLSH_PROG,;t t -s,@BUILD_TCLSH@,$BUILD_TCLSH,;t t -s,@MAN_FLAGS@,$MAN_FLAGS,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@TCL_THREADS@,$TCL_THREADS,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@AR@,$AR,;t t -s,@ac_ct_AR@,$ac_ct_AR,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@TCL_LIBS@,$TCL_LIBS,;t t -s,@DL_LIBS@,$DL_LIBS,;t t -s,@DL_OBJS@,$DL_OBJS,;t t -s,@PLAT_OBJS@,$PLAT_OBJS,;t t -s,@PLAT_SRCS@,$PLAT_SRCS,;t t -s,@LDAIX_SRC@,$LDAIX_SRC,;t t -s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t -s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t -s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t -s,@LDFLAGS_DEBUG@,$LDFLAGS_DEBUG,;t t -s,@LDFLAGS_OPTIMIZE@,$LDFLAGS_OPTIMIZE,;t t -s,@CC_SEARCH_FLAGS@,$CC_SEARCH_FLAGS,;t t -s,@LD_SEARCH_FLAGS@,$LD_SEARCH_FLAGS,;t t -s,@STLIB_LD@,$STLIB_LD,;t t -s,@SHLIB_LD@,$SHLIB_LD,;t t -s,@TCL_SHLIB_LD_EXTRAS@,$TCL_SHLIB_LD_EXTRAS,;t t -s,@TK_SHLIB_LD_EXTRAS@,$TK_SHLIB_LD_EXTRAS,;t t -s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t -s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t -s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t -s,@MAKE_LIB@,$MAKE_LIB,;t t -s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t -s,@INSTALL_LIB@,$INSTALL_LIB,;t t -s,@DLL_INSTALL_DIR@,$DLL_INSTALL_DIR,;t t -s,@INSTALL_STUB_LIB@,$INSTALL_STUB_LIB,;t t -s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t -s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t -s,@XFT_CFLAGS@,$XFT_CFLAGS,;t t -s,@XFT_LIBS@,$XFT_LIBS,;t t -s,@UNIX_FONT_OBJS@,$UNIX_FONT_OBJS,;t t -s,@TK_VERSION@,$TK_VERSION,;t t -s,@TK_MAJOR_VERSION@,$TK_MAJOR_VERSION,;t t -s,@TK_MINOR_VERSION@,$TK_MINOR_VERSION,;t t -s,@TK_PATCH_LEVEL@,$TK_PATCH_LEVEL,;t t -s,@TK_YEAR@,$TK_YEAR,;t t -s,@TK_LIB_FILE@,$TK_LIB_FILE,;t t -s,@TK_LIB_FLAG@,$TK_LIB_FLAG,;t t -s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t -s,@TK_STUB_LIB_FILE@,$TK_STUB_LIB_FILE,;t t -s,@TK_STUB_LIB_FLAG@,$TK_STUB_LIB_FLAG,;t t -s,@TK_STUB_LIB_SPEC@,$TK_STUB_LIB_SPEC,;t t -s,@TK_STUB_LIB_PATH@,$TK_STUB_LIB_PATH,;t t -s,@TK_INCLUDE_SPEC@,$TK_INCLUDE_SPEC,;t t -s,@TK_BUILD_STUB_LIB_SPEC@,$TK_BUILD_STUB_LIB_SPEC,;t t -s,@TK_BUILD_STUB_LIB_PATH@,$TK_BUILD_STUB_LIB_PATH,;t t -s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t -s,@TK_SHARED_BUILD@,$TK_SHARED_BUILD,;t t -s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t -s,@TK_BUILD_LIB_SPEC@,$TK_BUILD_LIB_SPEC,;t t -s,@TCL_STUB_FLAGS@,$TCL_STUB_FLAGS,;t t -s,@XINCLUDES@,$XINCLUDES,;t t -s,@XLIBSW@,$XLIBSW,;t t -s,@LOCALES@,$LOCALES,;t t -s,@TK_WINDOWINGSYSTEM@,$TK_WINDOWINGSYSTEM,;t t -s,@TK_PKG_DIR@,$TK_PKG_DIR,;t t -s,@TK_LIBRARY@,$TK_LIBRARY,;t t -s,@LIB_RUNTIME_DIR@,$LIB_RUNTIME_DIR,;t t -s,@PRIVATE_INCLUDE_DIR@,$PRIVATE_INCLUDE_DIR,;t t -s,@HTML_DIR@,$HTML_DIR,;t t -s,@EXTRA_CC_SWITCHES@,$EXTRA_CC_SWITCHES,;t t -s,@EXTRA_APP_CC_SWITCHES@,$EXTRA_APP_CC_SWITCHES,;t t -s,@EXTRA_INSTALL@,$EXTRA_INSTALL,;t t -s,@EXTRA_INSTALL_BINARIES@,$EXTRA_INSTALL_BINARIES,;t t -s,@EXTRA_BUILD_HTML@,$EXTRA_BUILD_HTML,;t t -s,@EXTRA_WISH_LIBS@,$EXTRA_WISH_LIBS,;t t -s,@CFBUNDLELOCALIZATIONS@,$CFBUNDLELOCALIZATIONS,;t t -s,@TK_RSRC_FILE@,$TK_RSRC_FILE,;t t -s,@WISH_RSRC_FILE@,$WISH_RSRC_FILE,;t t -s,@LIB_RSRC_FILE@,$LIB_RSRC_FILE,;t t -s,@APP_RSRC_FILE@,$APP_RSRC_FILE,;t t -s,@REZ@,$REZ,;t t -s,@REZ_FLAGS@,$REZ_FLAGS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + case $ac_mode in + :F) + # + # CONFIG_FILE + # +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - Tk.framework ) n=Tk && + case $ac_file$ac_mode in + "Tk.framework":C) n=Tk && f=$n.framework && v=Versions/$VERSION && rm -rf $f && mkdir -p $f/$v/Resources && ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v && @@ -12394,17 +10023,18 @@ echo "$as_me: executing $ac_dest commands" >&6;} if test $tk_aqua = yes; then ln -s ../../../../$n.rsrc $f/$v/Resources; fi && unset n f v ;; + esac -done -_ACEOF +done # for ac_tag -cat >>$CONFIG_STATUS <<\_ACEOF -{ (exit 0); exit 0; } +as_fn_exit 0 _ACEOF -chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -12424,7 +10054,11 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi diff --git a/unix/configure.in b/unix/configure.in index cb412af..a748246 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -3,8 +3,8 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. -AC_INIT([tk],[8.6]) -AC_PREREQ(2.59) +AC_INIT([tk],[8.7]) +AC_PREREQ(2.69) dnl This is only used when included from macosx/configure.ac m4_ifdef([SC_USE_CONFIG_HEADERS], [ @@ -22,10 +22,10 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ #endif /* _TKCONFIG */]) ]) -TK_VERSION=8.6 +TK_VERSION=8.7 TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=6 -TK_PATCH_LEVEL=".5" +TK_MINOR_VERSION=7 +TK_PATCH_LEVEL="a0" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" diff --git a/unix/tk.spec b/unix/tk.spec index e43e28e..c4ec12b 100644 --- a/unix/tk.spec +++ b/unix/tk.spec @@ -4,15 +4,15 @@ Name: tk Summary: Tk graphical toolkit for the Tcl scripting language. -Version: 8.6.5 +Version: 8.7a0 Release: 2 License: BSD Group: Development/Languages Source: http://prdownloads.sourceforge.net/tcl/tk%{version}-src.tar.gz URL: http://www.tcl.tk/ Buildroot: /var/tmp/%{name}%{version} -Buildrequires: XFree86-devel tcl >= %version -Requires: tcl >= %version +Buildrequires: XFree86-devel tcl >= 8.6.0 +Requires: tcl >= 8.6.0 %description The Tcl (Tool Command Language) provides a powerful platform for diff --git a/win/README b/win/README index 8670446..7f1818e 100644 --- a/win/README +++ b/win/README @@ -1,4 +1,4 @@ -Tk 8.6 for Windows +Tk 8.7 for Windows Originally by Scott Stanton while at Sun Microsystems Labs diff --git a/win/configure b/win/configure index cbac248..494e71a 100755 --- a/win/configure +++ b/win/configure @@ -1,81 +1,459 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59. +# Generated by GNU Autoconf 2.69. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# # -# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi -DUALCASE=1; export DUALCASE # for MKS sh -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." else - $as_unset $as_var + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." fi -done + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` - -# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -83,146 +461,91 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file else - as_expr=false + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -231,38 +554,25 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - +test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= @@ -270,51 +580,212 @@ PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= +PACKAGE_URL= ac_unique_file="../generic/tk.h" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AR ac_ct_AR RANLIB ac_ct_RANLIB RC ac_ct_RC SET_MAKE TCL_THREADS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_DEFS CYGPATH CELIB_DIR DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING MAN2TCLFLAGS CFLAGS_DEFAULT LDFLAGS_DEFAULT VC_MANIFEST_EMBED_DLL VC_MANIFEST_EMBED_EXE BUILD_TCLSH TCLSH_PROG TK_WIN_VERSION MACHINE TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_DBGX TK_LIB_FILE TK_DLL_FILE TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_BUILD_STUB_LIB_SPEC TK_SRC_DIR TK_BIN_DIR TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_DBGX CFG_TK_SHARED_LIB_SUFFIX CFG_TK_UNSHARED_LIB_SUFFIX CFG_TK_EXPORT_FILE_SUFFIX EXTRA_CFLAGS DEPARG CC_OBJNAME CC_EXENAME LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LDFLAGS_CONSOLE LDFLAGS_WINDOW TK_RES STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX TK_SHARED_BUILD LIBS_GUI DLLSUFFIX LIBPREFIX LIBSUFFIX EXESUFFIX LIBRARIES MAKE_LIB MAKE_STUB_LIB POST_MAKE_LIB MAKE_DLL MAKE_EXE TK_LIB_FLAG TK_LIB_SPEC TK_BUILD_LIB_SPEC TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_BUILD_STUB_LIB_PATH TK_CC_SEARCH_FLAGS TK_LD_SEARCH_FLAGS RC_OUT RC_TYPE RC_INCLUDE RC_DEFINE RC_DEFINES RES LIBOBJS LTLIBOBJS' +ac_subst_vars='LTLIBOBJS +LIBOBJS +RES +RC_DEFINES +RC_DEFINE +RC_INCLUDE +RC_TYPE +RC_OUT +TK_LD_SEARCH_FLAGS +TK_CC_SEARCH_FLAGS +TK_BUILD_STUB_LIB_PATH +TK_STUB_LIB_PATH +TK_STUB_LIB_SPEC +TK_BUILD_LIB_SPEC +TK_LIB_SPEC +TK_LIB_FLAG +MAKE_EXE +MAKE_DLL +POST_MAKE_LIB +MAKE_STUB_LIB +MAKE_LIB +LIBRARIES +EXESUFFIX +LIBSUFFIX +LIBPREFIX +DLLSUFFIX +LIBS_GUI +TK_SHARED_BUILD +SHLIB_SUFFIX +SHLIB_CFLAGS +SHLIB_LD_LIBS +SHLIB_LD +STLIB_LD +TK_RES +LDFLAGS_WINDOW +LDFLAGS_CONSOLE +LDFLAGS_OPTIMIZE +LDFLAGS_DEBUG +CC_EXENAME +CC_OBJNAME +DEPARG +EXTRA_CFLAGS +CFG_TK_EXPORT_FILE_SUFFIX +CFG_TK_UNSHARED_LIB_SUFFIX +CFG_TK_SHARED_LIB_SUFFIX +TCL_DBGX +TCL_PATCH_LEVEL +TCL_MINOR_VERSION +TCL_MAJOR_VERSION +TK_BIN_DIR +TK_SRC_DIR +TK_BUILD_STUB_LIB_SPEC +TK_STUB_LIB_FLAG +TK_STUB_LIB_FILE +TK_DLL_FILE +TK_LIB_FILE +TK_DBGX +TK_PATCH_LEVEL +TK_MINOR_VERSION +TK_MAJOR_VERSION +TK_VERSION +MACHINE +TK_WIN_VERSION +TCLSH_PROG +BUILD_TCLSH +VC_MANIFEST_EMBED_EXE +VC_MANIFEST_EMBED_DLL +LDFLAGS_DEFAULT +CFLAGS_DEFAULT +MAN2TCLFLAGS +CFLAGS_WARNING +CFLAGS_OPTIMIZE +CFLAGS_DEBUG +DL_LIBS +CELIB_DIR +CYGPATH +TCL_DEFS +TCL_STUB_LIB_SPEC +TCL_STUB_LIB_FLAG +TCL_STUB_LIB_FILE +TCL_LIB_SPEC +TCL_LIB_FLAG +TCL_LIB_FILE +TCL_SRC_DIR +TCL_BIN_DIR +TCL_VERSION +TCL_THREADS +SET_MAKE +RC +RANLIB +AR +EGREP +GREP +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_threads +enable_shared +with_tcl +enable_64bit +enable_wince +with_celib +enable_symbols +enable_embedded_manifest +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -337,34 +808,49 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -386,33 +872,59 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; esac - eval "enable_$ac_feature='$ac_optarg'" ;; + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -439,6 +951,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -463,13 +981,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -534,6 +1055,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -584,26 +1115,36 @@ do ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; esac - eval "with_$ac_package='$ac_optarg'" ;; + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -623,27 +1164,26 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -651,31 +1191,36 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "missing argument to $ac_option" fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac -done +fi -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var + # Remove trailing slashes. case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -689,8 +1234,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -702,74 +1245,72 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -792,20 +1333,17 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -815,18 +1353,25 @@ for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -838,6 +1383,7 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-threads build with threads (default: on) @@ -860,167 +1406,424 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. +Report bugs to the package provider. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF +configure +generated by GNU Autoconf 2.69 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was - $ $0 $@ +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## -_ACEOF +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () { -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` +} # ac_fn_c_try_compile -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -_ASUNAME + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done +} # ac_fn_c_try_cpp -} >&5 +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -cat >&5 <<_ACEOF + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval +} # ac_fn_c_try_run -## ----------- ## -## Core tests. ## -## ----------- ## +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## _ACEOF @@ -1033,7 +1836,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1044,13 +1846,13 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" + as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else @@ -1066,104 +1868,115 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. @@ -1171,112 +1984,137 @@ cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -1287,32 +2125,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - # The following define is needed when building with Cygwin since newer # versions of autoconf incorrectly set SHELL to /bin/bash instead of # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh -TK_VERSION=8.6 +TK_VERSION=8.7 TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=6 -TK_PATCH_LEVEL=".5" +TK_MINOR_VERSION=7 +TK_PATCH_LEVEL="a0" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ @@ -1346,10 +2167,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1359,35 +2180,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -1397,39 +2220,50 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1439,77 +2273,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1520,18 +2314,19 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -1549,24 +2344,25 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -1576,39 +2372,41 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -1618,66 +2416,78 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -1689,112 +2499,108 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else - echo "$as_me: failed program was:" >&5 + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (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 - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -1802,88 +2608,141 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+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 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +#include int main () { +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF -rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi - rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -1897,55 +2756,34 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -1956,39 +2794,49 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -ac_cv_prog_cc_g=no +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -2004,23 +2852,18 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -2043,12 +2886,17 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2063,205 +2911,37 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - 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_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg fi -rm -f conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac +if test "x$ac_cv_prog_cc_c89" != xno; then : -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_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 - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_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 - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_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 - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2269,18 +2949,14 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for inline" >&5 -echo $ECHO_N "checking for inline... $ECHO_C" >&6 -if test "${ac_cv_c_inline+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; @@ -2289,41 +2965,16 @@ $ac_kw foo_t foo () {return 0; } #endif _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_c_inline=$ac_kw; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break done fi -echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -echo "${ECHO_T}$ac_cv_c_inline" >&6 - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; @@ -2345,15 +2996,15 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -2367,11 +3018,7 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -2380,78 +3027,34 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : break fi @@ -2463,8 +3066,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -2474,11 +3077,7 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -2487,85 +3086,40 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -2575,31 +3129,142 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -2614,51 +3279,23 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : + $EGREP "memchr" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -2668,18 +3305,14 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : + $EGREP "free" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -2689,16 +3322,13 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : : else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -2718,41 +3348,26 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./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 - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_run "$LINENO"; then : -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +else + ac_cv_header_stdc=no fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF +$as_echo "#define STDC_HEADERS 1" >>confdefs.h fi @@ -2760,10 +3375,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. @@ -2773,35 +3388,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. @@ -2811,27 +3428,38 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - AR=$ac_ct_AR + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi else AR="$ac_cv_prog_AR" fi @@ -2839,10 +3467,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -2852,35 +3480,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. @@ -2890,27 +3520,38 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - RANLIB=$ac_ct_RANLIB + if test "x$ac_ct_RANLIB" = x; then + RANLIB="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else RANLIB="$ac_cv_prog_RANLIB" fi @@ -2918,10 +3559,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$RC"; then ac_cv_prog_RC="$RC" # Let the user override the test. @@ -2931,35 +3572,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RC="${ac_tool_prefix}windres" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi RC=$ac_cv_prog_RC if test -n "$RC"; then - echo "$as_me:$LINENO: result: $RC" >&5 -echo "${ECHO_T}$RC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RC" >&5 +$as_echo "$RC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$ac_cv_prog_RC"; then ac_ct_RC=$RC # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RC+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RC"; then ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test. @@ -2969,27 +3612,38 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RC="windres" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi ac_ct_RC=$ac_cv_prog_ac_ct_RC if test -n "$ac_ct_RC"; then - echo "$as_me:$LINENO: result: $ac_ct_RC" >&5 -echo "${ECHO_T}$ac_ct_RC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RC" >&5 +$as_echo "$ac_ct_RC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - RC=$ac_ct_RC + if test "x$ac_ct_RC" = x; then + RC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RC=$ac_ct_RC + fi else RC="$ac_cv_prog_RC" fi @@ -2999,32 +3653,34 @@ fi # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -3041,34 +3697,30 @@ fi #-------------------------------------------------------------------- - echo "$as_me:$LINENO: checking for building with threads" >&5 -echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 - # Check whether --enable-threads or --disable-threads was given. -if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - tcl_ok=$enableval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for building with threads" >&5 +$as_echo_n "checking for building with threads... " >&6; } + # Check whether --enable-threads was given. +if test "${enable_threads+set}" = set; then : + enableval=$enable_threads; tcl_ok=$enableval else tcl_ok=yes -fi; +fi + if test "$tcl_ok" = "yes"; then - echo "$as_me:$LINENO: result: yes (default)" >&5 -echo "${ECHO_T}yes (default)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 +$as_echo "yes (default)" >&6; } TCL_THREADS=1 - cat >>confdefs.h <<\_ACEOF -#define TCL_THREADS 1 -_ACEOF + $as_echo "#define TCL_THREADS 1" >>confdefs.h # USE_THREAD_ALLOC tells us to try the special thread-based # allocator that significantly reduces lock contention - cat >>confdefs.h <<\_ACEOF -#define USE_THREAD_ALLOC 1 -_ACEOF + $as_echo "#define USE_THREAD_ALLOC 1" >>confdefs.h else TCL_THREADS=0 - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3079,15 +3731,15 @@ echo "${ECHO_T}no" >&6 #-------------------------------------------------------------------- - echo "$as_me:$LINENO: checking how to build libraries" >&5 -echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 - # Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - tcl_ok=$enableval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5 +$as_echo_n "checking how to build libraries... " >&6; } + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; tcl_ok=$enableval else tcl_ok=yes -fi; +fi + if test "${enable_shared+set}" = set; then enableval="$enable_shared" @@ -3097,17 +3749,15 @@ fi; fi if test "$tcl_ok" = "yes" ; then - echo "$as_me:$LINENO: result: shared" >&5 -echo "${ECHO_T}shared" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5 +$as_echo "shared" >&6; } SHARED_BUILD=1 else - echo "$as_me:$LINENO: result: static" >&5 -echo "${ECHO_T}static" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5 +$as_echo "static" >&6; } SHARED_BUILD=0 -cat >>confdefs.h <<\_ACEOF -#define STATIC_BUILD 1 -_ACEOF +$as_echo "#define STATIC_BUILD 1" >>confdefs.h fi @@ -3127,15 +3777,15 @@ _ACEOF # 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" - with_tclconfig="${withval}" -fi; - 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 +# Check whether --with-tcl was given. +if test "${with_tcl+set}" = set; then : + withval=$with_tcl; with_tclconfig="${withval}" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5 +$as_echo_n "checking for Tcl configuration... " >&6; } + if ${ac_cv_c_tclconfig+:} false; then : + $as_echo_n "(cached) " >&6 else @@ -3144,17 +3794,15 @@ else 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;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 +$as_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; }; } + as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5 fi fi @@ -3218,28 +3866,26 @@ 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; }; } + as_fn_error $? "Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" "$LINENO" 5 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 +$as_echo "found ${TCL_BIN_DIR}/tclConfig.sh" >&6; } fi fi - echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 +$as_echo_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... " >&6; } if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - echo "$as_me:$LINENO: result: loading" >&5 -echo "${ECHO_T}loading" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 +$as_echo "loading" >&6; } . "${TCL_BIN_DIR}/tclConfig.sh" else - echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 -echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 +$as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } fi # @@ -3285,22 +3931,14 @@ echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then - { { echo "$as_me:$LINENO: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." >&5 -echo "$as_me: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." >&2;} - { (exit 1); exit 1; }; } -fi -if test "${TCL_MINOR_VERSION}" -lt "${TK_MINOR_VERSION}"; then - { { echo "$as_me:$LINENO: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." >&5 -echo "$as_me: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better." "$LINENO" 5 +fi +if test "${TCL_MINOR_VERSION}" -lt 6; then + as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better." "$LINENO" 5 fi #-------------------------------------------------------------------- @@ -3310,70 +3948,15 @@ fi #-------------------------------------------------------------------- # On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+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. */ -$ac_includes_default - -#include <$ac_header> -_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 - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -3385,59 +3968,57 @@ done # Step 0: Enable 64 bit support? - echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 -echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6 - # Check whether --enable-64bit or --disable-64bit was given. -if test "${enable_64bit+set}" = set; then - enableval="$enable_64bit" - do64bit=$enableval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5 +$as_echo_n "checking if 64bit support is requested... " >&6; } + # Check whether --enable-64bit was given. +if test "${enable_64bit+set}" = set; then : + enableval=$enable_64bit; do64bit=$enableval else do64bit=no -fi; - echo "$as_me:$LINENO: result: $do64bit" >&5 -echo "${ECHO_T}$do64bit" >&6 +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 +$as_echo "$do64bit" >&6; } # Cross-compiling options for Windows/CE builds - echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 -echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6 - # Check whether --enable-wince or --disable-wince was given. -if test "${enable_wince+set}" = set; then - enableval="$enable_wince" - doWince=$enableval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Windows/CE build is requested" >&5 +$as_echo_n "checking if Windows/CE build is requested... " >&6; } + # Check whether --enable-wince was given. +if test "${enable_wince+set}" = set; then : + enableval=$enable_wince; doWince=$enableval else doWince=no -fi; - echo "$as_me:$LINENO: result: $doWince" >&5 -echo "${ECHO_T}$doWince" >&6 +fi - echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 -echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doWince" >&5 +$as_echo "$doWince" >&6; } -# Check whether --with-celib or --without-celib was given. -if test "${with_celib+set}" = set; then - withval="$with_celib" - CELIB_DIR=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Windows/CE celib directory" >&5 +$as_echo_n "checking for Windows/CE celib directory... " >&6; } + +# Check whether --with-celib was given. +if test "${with_celib+set}" = set; then : + withval=$with_celib; CELIB_DIR=$withval else CELIB_DIR=NO_CELIB -fi; - echo "$as_me:$LINENO: result: $CELIB_DIR" >&5 -echo "${ECHO_T}$CELIB_DIR" >&6 +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CELIB_DIR" >&5 +$as_echo "$CELIB_DIR" >&6; } # Set some defaults (may get changed below) EXTRA_CFLAGS="" -cat >>confdefs.h <<\_ACEOF -#define MODULE_SCOPE extern -_ACEOF +$as_echo "#define MODULE_SCOPE extern" >>confdefs.h # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CYGPATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CYGPATH+:} false; then : + $as_echo_n "(cached) " >&6 else if test -n "$CYGPATH"; then ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. @@ -3447,28 +4028,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath -m" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then - echo "$as_me:$LINENO: result: $CYGPATH" >&5 -echo "${ECHO_T}$CYGPATH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 +$as_echo "$CYGPATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + SHLIB_SUFFIX=".dll" # MACHINE is IX86 for LINK, but this is used by the manifest, @@ -3477,16 +4060,12 @@ fi if test "$GCC" = "yes"; then - echo "$as_me:$LINENO: checking for cross-compile version of gcc" >&5 -echo $ECHO_N "checking for cross-compile version of gcc... $ECHO_C" >&6 -if test "${ac_cv_cross+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cross-compile version of gcc" >&5 +$as_echo_n "checking for cross-compile version of gcc... " >&6; } +if ${ac_cv_cross+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef _WIN32 @@ -3501,40 +4080,16 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_cross=no else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_cross=yes + ac_cv_cross=yes fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_cross" >&5 -echo "${ECHO_T}$ac_cv_cross" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cross" >&5 +$as_echo "$ac_cv_cross" >&6; } if test "$ac_cv_cross" = "yes"; then case "$do64bit" in @@ -3569,20 +4124,20 @@ echo "${ECHO_T}$ac_cv_cross" >&6 echo "101 \"name\"" >> $conftest echo "END" >> $conftest - echo "$as_me:$LINENO: checking for Windows native path bug in windres" >&5 -echo $ECHO_N "checking for Windows native path bug in windres... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Windows native path bug in windres" >&5 +$as_echo_n "checking for Windows native path bug in windres... " >&6; } cyg_conftest=`$CYGPATH $conftest` if { ac_try='$RC -o conftest.res.o $cyg_conftest' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } ; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } CYGPATH=echo fi conftest= @@ -3600,16 +4155,12 @@ echo "${ECHO_T}yes" >&6 if test "${GCC}" = "yes" ; then extra_cflags="-pipe" extra_ldflags="-pipe -static-libgcc" - echo "$as_me:$LINENO: checking for mingw32 version of gcc" >&5 -echo $ECHO_N "checking for mingw32 version of gcc... $ECHO_C" >&6 -if test "${ac_cv_win32+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mingw32 version of gcc" >&5 +$as_echo_n "checking for mingw32 version of gcc... " >&6; } +if ${ac_cv_win32+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _WIN32 @@ -3624,57 +4175,73 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_win32=no else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_win32=yes + ac_cv_win32=yes fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_win32" >&5 -echo "${ECHO_T}$ac_cv_win32" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_win32" >&5 +$as_echo "$ac_cv_win32" >&6; } if test "$ac_cv_win32" != "yes"; then - { { echo "$as_me:$LINENO: error: ${CC} cannot produce win32 executables." >&5 -echo "$as_me: error: ${CC} cannot produce win32 executables." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "${CC} cannot produce win32 executables." "$LINENO" 5 fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain" - echo "$as_me:$LINENO: checking for working -municode linker flag" >&5 -echo $ECHO_N "checking for working -municode linker flag... $ECHO_C" >&6 -if test "${ac_cv_municode+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working -municode linker flag" >&5 +$as_echo_n "checking for working -municode linker flag... " >&6; } +if ${ac_cv_municode+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -3688,41 +4255,17 @@ main () 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 +if ac_fn_c_try_link "$LINENO"; then : ac_cv_municode=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_municode=no + ac_cv_municode=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_municode" >&5 -echo "${ECHO_T}$ac_cv_municode" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_municode" >&5 +$as_echo "$ac_cv_municode" >&6; } CFLAGS=$hold_cflags if test "$ac_cv_municode" = "yes" ; then extra_ldflags="$extra_ldflags -municode" @@ -3731,8 +4274,8 @@ echo "${ECHO_T}$ac_cv_municode" >&6 fi fi - echo "$as_me:$LINENO: checking compiler flags" >&5 -echo $ECHO_N "checking compiler flags... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler flags" >&5 +$as_echo_n "checking compiler flags... " >&6; } if test "${GCC}" = "yes" ; then SHLIB_LD="" SHLIB_LD_LIBS='${LIBS}' @@ -3753,23 +4296,20 @@ echo $ECHO_N "checking compiler flags... $ECHO_C" >&6 if test "${SHARED_BUILD}" = "0" ; then # static - echo "$as_me:$LINENO: result: using static flags" >&5 -echo "${ECHO_T}using static flags" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: using static flags" >&5 +$as_echo "using static flags" >&6; } runtime= LIBRARIES="\${STATIC_LIBRARIES}" EXESUFFIX="s\${DBGX}.exe" else # dynamic - echo "$as_me:$LINENO: result: using shared flags" >&5 -echo "${ECHO_T}using shared flags" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: using shared flags" >&5 +$as_echo "using shared flags" >&6; } # ad-hoc check to see if CC supports -shared. if "${CC}" -shared 2>&1 | egrep ': -shared not supported' >/dev/null; then - { { echo "$as_me:$LINENO: error: ${CC} does not support the -shared option. - You will need to upgrade to a newer version of the toolchain." >&5 -echo "$as_me: error: ${CC} does not support the -shared option. - You will need to upgrade to a newer version of the toolchain." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "${CC} does not support the -shared option. + You will need to upgrade to a newer version of the toolchain." "$LINENO" 5 fi runtime= @@ -3823,20 +4363,16 @@ echo "$as_me: error: ${CC} does not support the -shared option. case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # assume AMD64 as default 64-bit build - echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 -echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5 +$as_echo " Using 64-bit $MACHINE mode" >&6; } ;; ia64) MACHINE="IA64" - echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 -echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5 +$as_echo " Using 64-bit $MACHINE mode" >&6; } ;; *) - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef _WIN64 @@ -3851,57 +4387,33 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_win_64bit=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_win_64bit=no + tcl_win_64bit=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$tcl_win_64bit" = "yes" ; then do64bit=amd64 MACHINE="AMD64" - echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 -echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5 +$as_echo " Using 64-bit $MACHINE mode" >&6; } fi ;; esac else if test "${SHARED_BUILD}" = "0" ; then # static - echo "$as_me:$LINENO: result: using static flags" >&5 -echo "${ECHO_T}using static flags" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: using static flags" >&5 +$as_echo "using static flags" >&6; } runtime=-MT LIBRARIES="\${STATIC_LIBRARIES}" EXESUFFIX="s\${DBGX}.exe" else # dynamic - echo "$as_me:$LINENO: result: using shared flags" >&5 -echo "${ECHO_T}using shared flags" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: using shared flags" >&5 +$as_echo "using shared flags" >&6; } runtime=-MD # Add SHLIB_LD_LIBS to the Make rule, not here. LIBRARIES="\${SHARED_LIBRARIES}" @@ -3941,11 +4453,11 @@ echo "${ECHO_T}using shared flags" >&6 ;; esac if test ! -d "${PATH64}" ; then - { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK" >&5 -echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find 64-bit $MACHINE SDK" >&5 +$as_echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK" >&2;} fi - echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 -echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5 +$as_echo " Using 64-bit $MACHINE mode" >&6; } fi LIBS="netapi32.lib kernel32.lib user32.lib advapi32.lib userenv.lib ws2_32.lib" @@ -3964,64 +4476,9 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 # TEA_PATH_NOSPACE to avoid this issue. # Check if _WIN64 is already recognized, and if so we don't # need to modify CC. - echo "$as_me:$LINENO: checking whether _WIN64 is declared" >&5 -echo $ECHO_N "checking whether _WIN64 is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl__WIN64+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. */ -$ac_includes_default -int -main () -{ -#ifndef _WIN64 - char *p = (char *) _WIN64; -#endif - - ; - return 0; -} -_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_have_decl__WIN64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_fn_c_check_decl "$LINENO" "_WIN64" "ac_cv_have_decl__WIN64" "$ac_includes_default" +if test "x$ac_cv_have_decl__WIN64" = xyes; then : -ac_cv_have_decl__WIN64=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl__WIN64" >&5 -echo "${ECHO_T}$ac_cv_have_decl__WIN64" >&6 -if test $ac_cv_have_decl__WIN64 = yes; then - : else CC="\"${PATH64}/cl.exe\" -I\"${MSSDK}/Include\" \ -I\"${MSSDK}/Include/crt\" \ @@ -4089,15 +4546,11 @@ fi SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` if test ! -d "${CELIB_DIR}/inc"; then - { { echo "$as_me:$LINENO: error: Invalid celib directory \"${CELIB_DIR}\"" >&5 -echo "$as_me: error: Invalid celib directory \"${CELIB_DIR}\"" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "Invalid celib directory \"${CELIB_DIR}\"" "$LINENO" 5 fi if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"\ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then - { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 -echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" "$LINENO" 5 else CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" if test -d "${CEINCLUDE}/${TARGETCPU}" ; then @@ -4193,26 +4646,20 @@ _ACEOF fi if test "$do64bit" != "no" ; then - cat >>confdefs.h <<\_ACEOF -#define TCL_CFG_DO64BIT 1 -_ACEOF + $as_echo "#define TCL_CFG_DO64BIT 1" >>confdefs.h fi if test "${GCC}" = "yes" ; then - echo "$as_me:$LINENO: checking for SEH support in compiler" >&5 -echo $ECHO_N "checking for SEH support in compiler... $ECHO_C" >&6 -if test "${tcl_cv_seh+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SEH support in compiler" >&5 +$as_echo_n "checking for SEH support in compiler... " >&6; } +if ${tcl_cv_seh+:} false; then : + $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : tcl_cv_seh=no else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define WIN32_LEAN_AND_MEAN @@ -4231,37 +4678,22 @@ cat >>conftest.$ac_ext <<_ACEOF } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./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 +if ac_fn_c_try_run "$LINENO"; then : tcl_cv_seh=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -tcl_cv_seh=no + tcl_cv_seh=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi -echo "$as_me:$LINENO: result: $tcl_cv_seh" >&5 -echo "${ECHO_T}$tcl_cv_seh" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_seh" >&5 +$as_echo "$tcl_cv_seh" >&6; } if test "$tcl_cv_seh" = "no" ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_NO_SEH 1 -_ACEOF +$as_echo "#define HAVE_NO_SEH 1" >>confdefs.h fi @@ -4271,16 +4703,12 @@ _ACEOF # with Cygwin's version as of 2002-04-10, define it to be int, # sufficient for getting the current code to work. # - echo "$as_me:$LINENO: checking for EXCEPTION_DISPOSITION support in include files" >&5 -echo $ECHO_N "checking for EXCEPTION_DISPOSITION support in include files... $ECHO_C" >&6 -if test "${tcl_cv_eh_disposition+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EXCEPTION_DISPOSITION support in include files" >&5 +$as_echo_n "checking for EXCEPTION_DISPOSITION support in include files... " >&6; } +if ${tcl_cv_eh_disposition+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define WIN32_LEAN_AND_MEAN @@ -4297,45 +4725,19 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_eh_disposition=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_eh_disposition=no + tcl_cv_eh_disposition=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $tcl_cv_eh_disposition" >&5 -echo "${ECHO_T}$tcl_cv_eh_disposition" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_eh_disposition" >&5 +$as_echo "$tcl_cv_eh_disposition" >&6; } if test "$tcl_cv_eh_disposition" = "no" ; then -cat >>confdefs.h <<\_ACEOF -#define EXCEPTION_DISPOSITION int -_ACEOF +$as_echo "#define EXCEPTION_DISPOSITION int" >>confdefs.h fi @@ -4343,16 +4745,12 @@ _ACEOF # even if VOID has already been #defined. The win32api # used by mingw and cygwin is known to do this. - echo "$as_me:$LINENO: checking for winnt.h that ignores VOID define" >&5 -echo $ECHO_N "checking for winnt.h that ignores VOID define... $ECHO_C" >&6 -if test "${tcl_cv_winnt_ignore_void+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winnt.h that ignores VOID define" >&5 +$as_echo_n "checking for winnt.h that ignores VOID define... " >&6; } +if ${tcl_cv_winnt_ignore_void+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define VOID void @@ -4372,45 +4770,19 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_winnt_ignore_void=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_winnt_ignore_void=no + tcl_cv_winnt_ignore_void=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $tcl_cv_winnt_ignore_void" >&5 -echo "${ECHO_T}$tcl_cv_winnt_ignore_void" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_winnt_ignore_void" >&5 +$as_echo "$tcl_cv_winnt_ignore_void" >&6; } if test "$tcl_cv_winnt_ignore_void" = "yes" ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_WINNT_IGNORE_VOID 1 -_ACEOF +$as_echo "#define HAVE_WINNT_IGNORE_VOID 1" >>confdefs.h fi @@ -4418,16 +4790,12 @@ _ACEOF # This is used to stop gcc from printing a compiler # warning when initializing a union member. - echo "$as_me:$LINENO: checking for cast to union support" >&5 -echo $ECHO_N "checking for cast to union support... $ECHO_C" >&6 -if test "${tcl_cv_cast_to_union+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5 +$as_echo_n "checking for cast to union support... " >&6; } +if ${tcl_cv_cast_to_union+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4441,45 +4809,19 @@ main () return 0; } _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 +if ac_fn_c_try_compile "$LINENO"; then : tcl_cv_cast_to_union=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_cast_to_union=no + tcl_cv_cast_to_union=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $tcl_cv_cast_to_union" >&5 -echo "${ECHO_T}$tcl_cv_cast_to_union" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5 +$as_echo "$tcl_cv_cast_to_union" >&6; } if test "$tcl_cv_cast_to_union" = "yes"; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_CAST_TO_UNION 1 -_ACEOF +$as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h fi fi @@ -4495,145 +4837,9 @@ _ACEOF # man2tcl needs this so that it can use errno.h #-------------------------------------------------------------------- -if test "${ac_cv_header_errno_h+set}" = set; then - echo "$as_me:$LINENO: checking for errno.h" >&5 -echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_errno_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking errno.h usability" >&5 -echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#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_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking errno.h presence" >&5 -echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for errno.h" >&5 -echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 -if test "${ac_cv_header_errno_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_errno_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 -echo "${ECHO_T}$ac_cv_header_errno_h" >&6 +ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = xyes; then : -fi -if test $ac_cv_header_errno_h = yes; then - : else MAN2TCLFLAGS="-DNO_ERRNO_H" fi @@ -4645,17 +4851,13 @@ fi # Check for _strtoi64 #------------------------------------------- -echo "$as_me:$LINENO: checking availability of _strtoi64" >&5 -echo $ECHO_N "checking availability of _strtoi64... $ECHO_C" >&6 -if test "${tcl_cv_strtoi64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking availability of _strtoi64" >&5 +$as_echo_n "checking availability of _strtoi64... " >&6; } +if ${tcl_cv_strtoi64+:} false; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -4666,45 +4868,19 @@ _strtoi64(0,0,0) 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 +if ac_fn_c_try_link "$LINENO"; then : tcl_cv_strtoi64=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -tcl_cv_strtoi64=no + tcl_cv_strtoi64=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $tcl_cv_strtoi64" >&5 -echo "${ECHO_T}$tcl_cv_strtoi64" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_strtoi64" >&5 +$as_echo "$tcl_cv_strtoi64" >&6; } if test $tcl_cv_strtoi64 = no; then -cat >>confdefs.h <<\_ACEOF -#define NO_STRTOI64 1 -_ACEOF +$as_echo "#define NO_STRTOI64 1" >>confdefs.h fi @@ -4712,163 +4888,63 @@ fi # Windows XP theme engine header for Ttk #-------------------------------------------------------------------- -echo "$as_me:$LINENO: checking for uxtheme.h" >&5 -echo $ECHO_N "checking for uxtheme.h... $ECHO_C" >&6 -if test "${ac_cv_header_uxtheme_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +ac_fn_c_check_header_compile "$LINENO" "uxtheme.h" "ac_cv_header_uxtheme_h" "#include +" +if test "x$ac_cv_header_uxtheme_h" = xyes; then : + $as_echo "#define HAVE_UXTHEME_H 1" >>confdefs.h + else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include + { $as_echo "$as_me:${as_lineno-$LINENO}: xpnative theme will be unavailable" >&5 +$as_echo "$as_me: xpnative theme will be unavailable" >&6;} +fi + +ac_fn_c_check_header_compile "$LINENO" "vssym32.h" "ac_cv_header_vssym32_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_uxtheme_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +" +if test "x$ac_cv_header_vssym32_h" = xyes; then : + $as_echo "#define HAVE_VSSYM32_H 1" >>confdefs.h -ac_cv_header_uxtheme_h=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_uxtheme_h" >&5 -echo "${ECHO_T}$ac_cv_header_uxtheme_h" >&6 -if test $ac_cv_header_uxtheme_h = yes; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_UXTHEME_H 1 -_ACEOF -else - { echo "$as_me:$LINENO: xpnative theme will be unavailable" >&5 -echo "$as_me: xpnative theme will be unavailable" >&6;} -fi -echo "$as_me:$LINENO: checking for vssym32.h" >&5 -echo $ECHO_N "checking for vssym32.h... $ECHO_C" >&6 -if test "${ac_cv_header_vssym32_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +#-------------------------------------------------------------------- +# Set the default compiler switches based on the --enable-symbols +# option. This macro depends on C flags, and should be called +# after SC_CONFIG_CFLAGS macro is called. +#-------------------------------------------------------------------- + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5 +$as_echo_n "checking for build with symbols... " >&6; } + # Check whether --enable-symbols was given. +if test "${enable_symbols+set}" = set; then : + enableval=$enable_symbols; tcl_ok=$enableval 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 - -#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_vssym32_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_vssym32_h=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_header_vssym32_h" >&5 -echo "${ECHO_T}$ac_cv_header_vssym32_h" >&6 -if test $ac_cv_header_vssym32_h = yes; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_VSSYM32_H 1 -_ACEOF - + tcl_ok=no fi - - -#-------------------------------------------------------------------- -# Set the default compiler switches based on the --enable-symbols -# option. This macro depends on C flags, and should be called -# after SC_CONFIG_CFLAGS macro is called. -#-------------------------------------------------------------------- - - - echo "$as_me:$LINENO: checking for build with symbols" >&5 -echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 - # Check whether --enable-symbols or --disable-symbols was given. -if test "${enable_symbols+set}" = set; then - enableval="$enable_symbols" - tcl_ok=$enableval -else - tcl_ok=no -fi; # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' DBGX="" -cat >>confdefs.h <<\_ACEOF -#define NDEBUG 1 -_ACEOF +$as_echo "#define NDEBUG 1" >>confdefs.h - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } - cat >>confdefs.h <<\_ACEOF -#define TCL_CFG_OPTIMIZED 1 -_ACEOF + $as_echo "#define TCL_CFG_OPTIMIZED 1" >>confdefs.h else CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' DBGX=g if test "$tcl_ok" = "yes"; then - echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 -echo "${ECHO_T}yes (standard debugging)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5 +$as_echo "yes (standard debugging)" >&6; } fi fi @@ -4876,32 +4952,26 @@ echo "${ECHO_T}yes (standard debugging)" >&6 if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then -cat >>confdefs.h <<\_ACEOF -#define TCL_MEM_DEBUG 1 -_ACEOF +$as_echo "#define TCL_MEM_DEBUG 1" >>confdefs.h fi if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then -cat >>confdefs.h <<\_ACEOF -#define TCL_COMPILE_DEBUG 1 -_ACEOF +$as_echo "#define TCL_COMPILE_DEBUG 1" >>confdefs.h -cat >>confdefs.h <<\_ACEOF -#define TCL_COMPILE_STATS 1 -_ACEOF +$as_echo "#define TCL_COMPILE_STATS 1" >>confdefs.h fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then - echo "$as_me:$LINENO: result: enabled symbols mem compile debugging" >&5 -echo "${ECHO_T}enabled symbols mem compile debugging" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem compile debugging" >&5 +$as_echo "enabled symbols mem compile debugging" >&6; } else - echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 -echo "${ECHO_T}enabled $tcl_ok debugging" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5 +$as_echo "enabled $tcl_ok debugging" >&6; } fi fi @@ -4913,15 +4983,15 @@ TK_DBGX=${DBGX} #-------------------------------------------------------------------- - echo "$as_me:$LINENO: checking whether to embed manifest" >&5 -echo $ECHO_N "checking whether to embed manifest... $ECHO_C" >&6 - # Check whether --enable-embedded-manifest or --disable-embedded-manifest was given. -if test "${enable_embedded_manifest+set}" = set; then - enableval="$enable_embedded_manifest" - embed_ok=$enableval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to embed manifest" >&5 +$as_echo_n "checking whether to embed manifest... " >&6; } + # Check whether --enable-embedded-manifest was given. +if test "${enable_embedded_manifest+set}" = set; then : + enableval=$enable_embedded_manifest; embed_ok=$enableval else embed_ok=yes -fi; +fi + VC_MANIFEST_EMBED_DLL= VC_MANIFEST_EMBED_EXE= @@ -4929,11 +4999,7 @@ fi; if test "$embed_ok" = "yes" -a "${SHARED_BUILD}" = "1" \ -a "$GCC" != "yes" ; then # Add the magic to embed the manifest into the dll/exe - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined(_MSC_VER) && _MSC_VER >= 1400 @@ -4942,7 +5008,7 @@ print("manifest needed") _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "manifest needed" >/dev/null 2>&1; then + $EGREP "manifest needed" >/dev/null 2>&1; then : # Could do a CHECK_PROG for mt, but should always be with MSVC8+ # Could add 'if test -f' check, but manifest should be created @@ -4961,26 +5027,26 @@ fi rm -f conftest* fi - echo "$as_me:$LINENO: result: $result" >&5 -echo "${ECHO_T}$result" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 +$as_echo "$result" >&6; } - echo "$as_me:$LINENO: checking for tclsh in Tcl build directory" >&5 -echo $ECHO_N "checking for tclsh in Tcl build directory... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclsh in Tcl build directory" >&5 +$as_echo_n "checking for tclsh in Tcl build directory... " >&6; } BUILD_TCLSH=${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT} - echo "$as_me:$LINENO: result: $BUILD_TCLSH" >&5 -echo "${ECHO_T}$BUILD_TCLSH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_TCLSH" >&5 +$as_echo "$BUILD_TCLSH" >&6; } - echo "$as_me:$LINENO: checking for tclsh" >&5 -echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 +$as_echo_n "checking for tclsh... " >&6; } - if test "${ac_cv_path_tclsh+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if ${ac_cv_path_tclsh+:} false; then : + $as_echo_n "(cached) " >&6 else search_path=`echo ${PATH} | sed -e 's/:/ /g'` @@ -5001,13 +5067,13 @@ fi if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG="$ac_cv_path_tclsh" - echo "$as_me:$LINENO: result: $TCLSH_PROG" >&5 -echo "${ECHO_T}$TCLSH_PROG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLSH_PROG" >&5 +$as_echo "$TCLSH_PROG" >&6; } else # It is not an error if an installed version of Tcl can't be located. TCLSH_PROG="" - echo "$as_me:$LINENO: result: No tclsh found on PATH" >&5 -echo "${ECHO_T}No tclsh found on PATH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: No tclsh found on PATH" >&5 +$as_echo "No tclsh found on PATH" >&6; } fi @@ -5170,7 +5236,8 @@ TK_WIN_VERSION="$TK_VERSION.$TK_RELEASE_LEVEL.`echo $TK_PATCH_LEVEL | tr -d ab.` - ac_config_files="$ac_config_files Makefile tkConfig.sh wish.exe.manifest" +ac_config_files="$ac_config_files Makefile tkConfig.sh wish.exe.manifest" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -5189,39 +5256,70 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else - echo "not updating unwritable cache $cache_file" + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -5230,63 +5328,55 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, +# take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -5294,12 +5384,14 @@ LTLIBOBJS=$ac_ltlibobjs -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -5309,81 +5401,253 @@ cat >$CONFIG_STATUS <<_ACEOF debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi -DUALCASE=1; export DUALCASE # for MKS sh -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' fi +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi -done + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` -# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -5391,148 +5655,111 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file else - as_expr=false + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -5541,31 +5768,20 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -5573,124 +5789,116 @@ generated by GNU Autoconf 2.59. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" -cat >>$CONFIG_STATUS <<\_ACEOF +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE Configuration files: $config_files -Report bugs to ." -_ACEOF +Report bugs to the package provider." -cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; esac shift @@ -5704,32 +5912,46 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - - -cat >>$CONFIG_STATUS <<\_ACEOF +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "tkConfig.sh" ) CONFIG_FILES="$CONFIG_FILES tkConfig.sh" ;; - "wish.exe.manifest" ) CONFIG_FILES="$CONFIG_FILES wish.exe.manifest" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "tkConfig.sh") CONFIG_FILES="$CONFIG_FILES tkConfig.sh" ;; + "wish.exe.manifest") CONFIG_FILES="$CONFIG_FILES wish.exe.manifest" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -5739,418 +5961,414 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} { - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi -# -# CONFIG_FILES section. -# +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@AR@,$AR,;t t -s,@ac_ct_AR@,$ac_ct_AR,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@RC@,$RC,;t t -s,@ac_ct_RC@,$ac_ct_RC,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@TCL_THREADS@,$TCL_THREADS,;t t -s,@TCL_VERSION@,$TCL_VERSION,;t t -s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t -s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t -s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t -s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t -s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t -s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t -s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t -s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t -s,@TCL_DEFS@,$TCL_DEFS,;t t -s,@CYGPATH@,$CYGPATH,;t t -s,@CELIB_DIR@,$CELIB_DIR,;t t -s,@DL_LIBS@,$DL_LIBS,;t t -s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t -s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t -s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t -s,@MAN2TCLFLAGS@,$MAN2TCLFLAGS,;t t -s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t -s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t -s,@VC_MANIFEST_EMBED_DLL@,$VC_MANIFEST_EMBED_DLL,;t t -s,@VC_MANIFEST_EMBED_EXE@,$VC_MANIFEST_EMBED_EXE,;t t -s,@BUILD_TCLSH@,$BUILD_TCLSH,;t t -s,@TCLSH_PROG@,$TCLSH_PROG,;t t -s,@TK_WIN_VERSION@,$TK_WIN_VERSION,;t t -s,@MACHINE@,$MACHINE,;t t -s,@TK_VERSION@,$TK_VERSION,;t t -s,@TK_MAJOR_VERSION@,$TK_MAJOR_VERSION,;t t -s,@TK_MINOR_VERSION@,$TK_MINOR_VERSION,;t t -s,@TK_PATCH_LEVEL@,$TK_PATCH_LEVEL,;t t -s,@TK_DBGX@,$TK_DBGX,;t t -s,@TK_LIB_FILE@,$TK_LIB_FILE,;t t -s,@TK_DLL_FILE@,$TK_DLL_FILE,;t t -s,@TK_STUB_LIB_FILE@,$TK_STUB_LIB_FILE,;t t -s,@TK_STUB_LIB_FLAG@,$TK_STUB_LIB_FLAG,;t t -s,@TK_BUILD_STUB_LIB_SPEC@,$TK_BUILD_STUB_LIB_SPEC,;t t -s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t -s,@TK_BIN_DIR@,$TK_BIN_DIR,;t t -s,@TCL_MAJOR_VERSION@,$TCL_MAJOR_VERSION,;t t -s,@TCL_MINOR_VERSION@,$TCL_MINOR_VERSION,;t t -s,@TCL_PATCH_LEVEL@,$TCL_PATCH_LEVEL,;t t -s,@TCL_DBGX@,$TCL_DBGX,;t t -s,@CFG_TK_SHARED_LIB_SUFFIX@,$CFG_TK_SHARED_LIB_SUFFIX,;t t -s,@CFG_TK_UNSHARED_LIB_SUFFIX@,$CFG_TK_UNSHARED_LIB_SUFFIX,;t t -s,@CFG_TK_EXPORT_FILE_SUFFIX@,$CFG_TK_EXPORT_FILE_SUFFIX,;t t -s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t -s,@DEPARG@,$DEPARG,;t t -s,@CC_OBJNAME@,$CC_OBJNAME,;t t -s,@CC_EXENAME@,$CC_EXENAME,;t t -s,@LDFLAGS_DEBUG@,$LDFLAGS_DEBUG,;t t -s,@LDFLAGS_OPTIMIZE@,$LDFLAGS_OPTIMIZE,;t t -s,@LDFLAGS_CONSOLE@,$LDFLAGS_CONSOLE,;t t -s,@LDFLAGS_WINDOW@,$LDFLAGS_WINDOW,;t t -s,@TK_RES@,$TK_RES,;t t -s,@STLIB_LD@,$STLIB_LD,;t t -s,@SHLIB_LD@,$SHLIB_LD,;t t -s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t -s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t -s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t -s,@TK_SHARED_BUILD@,$TK_SHARED_BUILD,;t t -s,@LIBS_GUI@,$LIBS_GUI,;t t -s,@DLLSUFFIX@,$DLLSUFFIX,;t t -s,@LIBPREFIX@,$LIBPREFIX,;t t -s,@LIBSUFFIX@,$LIBSUFFIX,;t t -s,@EXESUFFIX@,$EXESUFFIX,;t t -s,@LIBRARIES@,$LIBRARIES,;t t -s,@MAKE_LIB@,$MAKE_LIB,;t t -s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t -s,@POST_MAKE_LIB@,$POST_MAKE_LIB,;t t -s,@MAKE_DLL@,$MAKE_DLL,;t t -s,@MAKE_EXE@,$MAKE_EXE,;t t -s,@TK_LIB_FLAG@,$TK_LIB_FLAG,;t t -s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t -s,@TK_BUILD_LIB_SPEC@,$TK_BUILD_LIB_SPEC,;t t -s,@TK_STUB_LIB_SPEC@,$TK_STUB_LIB_SPEC,;t t -s,@TK_STUB_LIB_PATH@,$TK_STUB_LIB_PATH,;t t -s,@TK_BUILD_STUB_LIB_PATH@,$TK_BUILD_STUB_LIB_PATH,;t t -s,@TK_CC_SEARCH_FLAGS@,$TK_CC_SEARCH_FLAGS,;t t -s,@TK_LD_SEARCH_FLAGS@,$TK_LD_SEARCH_FLAGS,;t t -s,@RC_OUT@,$RC_OUT,;t t -s,@RC_TYPE@,$RC_TYPE,;t t -s,@RC_INCLUDE@,$RC_INCLUDE,;t t -s,@RC_DEFINE@,$RC_DEFINE,;t t -s,@RC_DEFINES@,$RC_DEFINES,;t t -s,@RES@,$RES,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF -_ACEOF +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + case $ac_mode in + :F) + # + # CONFIG_FILE + # +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF + esac + +done # for ac_tag + -{ (exit 0); exit 0; } +as_fn_exit 0 _ACEOF -chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -6170,7 +6388,11 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi diff --git a/win/configure.in b/win/configure.in index 0ff9304..cdef517 100644 --- a/win/configure.in +++ b/win/configure.in @@ -4,17 +4,17 @@ # to configure the system for the local environment. AC_INIT(../generic/tk.h) -AC_PREREQ(2.59) +AC_PREREQ(2.69) # The following define is needed when building with Cygwin since newer # versions of autoconf incorrectly set SHELL to /bin/bash instead of # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh -TK_VERSION=8.6 +TK_VERSION=8.7 TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=6 -TK_PATCH_LEVEL=".5" +TK_MINOR_VERSION=7 +TK_PATCH_LEVEL="a0" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ @@ -83,13 +83,13 @@ SC_LOAD_TCLCONFIG if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}.]) +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.]) fi -if test "${TCL_MINOR_VERSION}" -lt "${TK_MINOR_VERSION}"; then +if test "${TCL_MINOR_VERSION}" -lt 6; then AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}.]) +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.]) fi #-------------------------------------------------------------------- diff --git a/win/tcl.m4 b/win/tcl.m4 index 84f0dff..c95d61f 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -1126,13 +1126,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ #------------------------------------------------------------------------ AC_DEFUN([SC_WITH_TCL], [ - if test -d ../../tcl8.6$1/win; then - TCL_BIN_DEFAULT=../../tcl8.6$1/win + if test -d ../../tcl8.7$1/win; then + TCL_BIN_DEFAULT=../../tcl8.7$1/win else - TCL_BIN_DEFAULT=../../tcl8.6/win + TCL_BIN_DEFAULT=../../tcl8.7/win fi - AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.6 binaries from DIR], + AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.6+ binaries from DIR], TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`) if test ! -d $TCL_BIN_DIR; then AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist) -- cgit v0.12 From 3c8ec9fb51362438b77878fdd3bf159444907b6b Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 7 Mar 2016 07:25:34 +0000 Subject: Fixed bug [3137232] - spinbox error after destroying toplevel from widget (cherrypicked [e6d91ca077] --- library/spinbox.tcl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/spinbox.tcl b/library/spinbox.tcl index 02584f4..fecf7d6 100644 --- a/library/spinbox.tcl +++ b/library/spinbox.tcl @@ -299,6 +299,10 @@ bind Spinbox { proc ::tk::spinbox::Invoke {w elem} { variable ::tk::Priv + if {![winfo exists $w]} { + return + } + if {![info exists Priv(outsideElement)]} { $w invoke $elem incr Priv(repeated) -- cgit v0.12 From 05064c00fd8467b71a5d8016d466c0e63ed25f85 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 7 Mar 2016 08:45:47 +0000 Subject: Fix version number in .project file --- .project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.project b/.project index 1a176fb..cc5f605 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - tk8.6 + tk8.7 -- cgit v0.12 From c7d53262ae761b4bffa6be4626431ec3e58bf394 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 7 Mar 2016 20:54:20 +0000 Subject: Fixed bug [2981253] - spinbox button frozen in case of repeated depressions (cherrypicked [5fe2f5839e]) --- library/spinbox.tcl | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/library/spinbox.tcl b/library/spinbox.tcl index fecf7d6..1965ed8 100644 --- a/library/spinbox.tcl +++ b/library/spinbox.tcl @@ -86,10 +86,12 @@ bind Spinbox { ::tk::spinbox::Motion %W %x %y } bind Spinbox { + ::tk::spinbox::ArrowPress %W %x %y set tk::Priv(selectMode) word ::tk::spinbox::MouseSelect %W %x sel.first } bind Spinbox { + ::tk::spinbox::ArrowPress %W %x %y set tk::Priv(selectMode) line ::tk::spinbox::MouseSelect %W %x 0 } @@ -332,6 +334,35 @@ proc ::tk::spinbox::ClosestGap {w x} { incr pos } +# ::tk::spinbox::ArrowPress -- +# This procedure is invoked to handle button-1 presses in buttonup +# or buttondown elements of spinbox widgets. +# +# Arguments: +# w - The spinbox window in which the button was pressed. +# x - The x-coordinate of the button press. +# y - The y-coordinate of the button press. + +proc ::tk::spinbox::ArrowPress {w x y} { + variable ::tk::Priv + + if {[$w cget -state] ne "disabled" && \ + [string match "button*" $Priv(element)]} { + $w selection element $Priv(element) + set Priv(repeated) 0 + set Priv(relief) [$w cget -$Priv(element)relief] + catch {after cancel $Priv(afterId)} + set delay [$w cget -repeatdelay] + if {$delay > 0} { + set Priv(afterId) [after $delay \ + [list ::tk::spinbox::Invoke $w $Priv(element)]] + } + if {[info exists Priv(outsideElement)]} { + unset Priv(outsideElement) + } + } +} + # ::tk::spinbox::ButtonDown -- # This procedure is invoked to handle button-1 presses in spinbox # widgets. It moves the insertion cursor, sets the selection anchor, @@ -355,20 +386,7 @@ proc ::tk::spinbox::ButtonDown {w x y} { switch -exact $Priv(element) { "buttonup" - "buttondown" { - if {"disabled" ne [$w cget -state]} { - $w selection element $Priv(element) - set Priv(repeated) 0 - set Priv(relief) [$w cget -$Priv(element)relief] - catch {after cancel $Priv(afterId)} - set delay [$w cget -repeatdelay] - if {$delay > 0} { - set Priv(afterId) [after $delay \ - [list ::tk::spinbox::Invoke $w $Priv(element)]] - } - if {[info exists Priv(outsideElement)]} { - unset Priv(outsideElement) - } - } + ::tk::spinbox::ArrowPress $w $x $y } "entry" { set Priv(selectMode) char -- cgit v0.12 From 1e12a7a6bfefbc1315f92dfb45a245d831328e4e Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 7 Mar 2016 21:01:49 +0000 Subject: Fixed bug [2262543] - Scale widget unexpectedly fires command callback (cherrypicked [3c1a8559dd]) --- generic/tkScale.c | 15 +++++++- tests/scale.test | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+), 1 deletion(-) diff --git a/generic/tkScale.c b/generic/tkScale.c index cc7c294..cbc5202 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -303,6 +303,12 @@ Tk_ScaleObjCmd( return TCL_ERROR; } + /* + * The widget was just created, no command callback must be invoked. + */ + + scalePtr->flags &= ~INVOKE_COMMAND; + Tcl_SetObjResult(interp, TkNewWindowObj(scalePtr->tkwin)); return TCL_OK; } @@ -1268,7 +1274,14 @@ TkScaleSetValue( return; } scalePtr->value = value; - if (invokeCommand) { + + /* + * Schedule command callback invocation only if there is such a command + * already registered, otherwise the callback would trigger later when + * configuring the widget -command option even if the value did not change. + */ + + if ((invokeCommand) && (scalePtr->command != NULL)) { scalePtr->flags |= INVOKE_COMMAND; } TkEventuallyRedrawScale(scalePtr, REDRAW_SLIDER); diff --git a/tests/scale.test b/tests/scale.test index a8d08a8..8c14ed4 100644 --- a/tests/scale.test +++ b/tests/scale.test @@ -1396,6 +1396,114 @@ test scale-19 {Bug [3529885fff] - Click in through goes in wrong direction} \ } \ -result {1.0 1.0 1.0 1.0} +test scale-20.1 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 1} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 +} -body { + scale .s -from 1 -to 50 -command {set commandedVar} + pack .s + update ; # -command callback shall NOT fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {1 -1} +test scale-20.2 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 2} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 + set scaleVar 7 +} -body { + scale .s -from 1 -to 50 -variable scaleVar -command {set commandedVar} + pack .s + update ; # -command callback shall NOT fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {7 -1} +test scale-20.3 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 3} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 +} -body { + scale .s -from 1 -to 50 + .s set 10 + .s configure -command {set commandedVar} + pack .s + update ; # -command callback shall NOT fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {10 -1} +test scale-20.4 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 4} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 +} -body { + scale .s -from 1 -to 50 -command {set commandedVar} + .s set 10 + pack .s + update ; # -command callback shall fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {10 10} +test scale-20.5 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 5} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 +} -body { + scale .s -from 1 -to 50 + pack .s + .s set 10 + .s configure -command {set commandedVar} + update ; # -command callback shall NOT fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {10 -1} +test scale-20.6 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 6} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 +} -body { + scale .s -from 1 -to 50 + pack .s + .s configure -command {set commandedVar} + .s set 10 + update ; # -command callback shall fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {10 10} +test scale-20.7 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 7} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 +} -body { + scale .s -from 1 -to 50 -command {set commandedVar} + pack .s + .s set 10 + update ; # -command callback shall fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {10 10} +test scale-20.8 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 8} -setup { + catch {destroy .s} + set res {} + set commandedVar -1 + set scaleVar 7 +} -body { + scale .s -from 1 -to 50 -variable scaleVar -command {set commandedVar} + pack .s + .s set 10 + update ; # -command callback shall fire + set res [list [.s get] $commandedVar] +} -cleanup { + destroy .s +} -result {10 10} + option clear # cleanup -- cgit v0.12 From 23afeb02af6706ac255b77e35f2cc644d2c4e524 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 7 Mar 2016 21:07:31 +0000 Subject: Added test case wm-forget-2 related to test the fix for bug [e9112ef96e] (cherrypicked [a6c6d3bd08]) --- tests/wm.test | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/wm.test b/tests/wm.test index 1aa0779..afcc2cd 100644 --- a/tests/wm.test +++ b/tests/wm.test @@ -2276,6 +2276,32 @@ test wm-forget-1.4 "pack into unmapped toplevel causes crash" -body { deleteWindows } -result {} +test wm-forget-2 {bug [e9112ef96e] - [wm forget] doesn't completely} -setup { + catch {destroy .l .f.b .f} + set res {} +} -body { + label .l -text "Top Dot" + frame .f + button .f.b -text Hello -command "puts Hello!" + pack .l -side top + pack .f.b + pack .f -side bottom + update + set res [winfo manager .f] + pack forget .f + update + lappend res [winfo manager .f] + wm manage .f + update + lappend res [winfo manager .f] + wm forget .f + update + lappend res [winfo manager .f] +} -cleanup { + destroy .l .f.b .f + unset res +} -result {pack {} wm {}} + # FIXME: # Test delivery of virtual events to the WM. We could check to see if the -- cgit v0.12 From 0d7ff0ffdee0b75ceac241d90f8700f3b0a3053f Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 8 Mar 2016 15:59:26 +0000 Subject: Revise trunk to an explicit requirement on Tcl 8.6.0 so that Tcl 8.6 interps can make use of Tk 8.7 until such time as it stops supporting them. --- win/makefile.vc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/makefile.vc b/win/makefile.vc index ae43eb6..6f61327 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -961,7 +961,7 @@ install-binaries: !if !$(STATIC_BUILD) @echo creating package index @type << > $(OUT_DIR)\pkgIndex.tcl -if {[catch {package present Tcl $(TCL_PATCH_LEVEL)}]} { return } +if {[catch {package present Tcl 8.6.0}]} { return } if {($$::tcl_platform(platform) eq "unix") && ([info exists ::env(DISPLAY)] || ([info exists ::argv] && ("-display" in $$::argv)))} { package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin libtk$(TK_DOTVERSION).dll] Tk] -- cgit v0.12 From d4e3294d3a4adb1370d84500401b26f7279119cc Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 8 Mar 2016 21:55:45 +0000 Subject: Backed out anything dealing with stippling, in accordance with discussion about TIP #443 --- doc/text.n | 16 ---------------- generic/tkText.c | 2 -- generic/tkText.h | 5 ----- generic/tkTextDisp.c | 20 ++++---------------- generic/tkTextTag.c | 8 -------- tests/textTag.test | 24 +----------------------- 6 files changed, 5 insertions(+), 70 deletions(-) diff --git a/doc/text.n b/doc/text.n index 84ad710..5d6ac19 100644 --- a/doc/text.n +++ b/doc/text.n @@ -548,22 +548,6 @@ items. It may have any of the forms accepted by \fBTk_GetColor\fR. If string, then the color specified by the \fB\-background\fR tag option is used. .TP -\fB\-selectbgstipple \fIbitmap\fR -. -\fIBitmap\fR specifies a bitmap that is used as a stipple pattern for the -selected background. It may have any of the forms accepted by -\fBTk_GetBitmap\fR. If \fIbitmap\fR has not been specified, or if it is -specified as an empty string, then the bitmap specified by -\fB\-bgstipple\fR will be used for the background. -.TP -\fB\-selectfgstipple \fIbitmap\fR -. -\fIBitmap\fR specifies a bitmap that is used as a stipple pattern when drawing -selected text and other foreground information such as underlines. It may have any of -the forms accepted by \fBTk_GetBitmap\fR. If \fIbitmap\fR has not been -specified, or if it is specified as an empty string, then the bitmap specified by -\fB\-fgstipple\fR will be used. -.TP \fB\-selectforeground \fIcolor\fR \fIColor\fR specifies the foreground color to use when displaying selected items. It may have any of the forms accepted by \fBTk_GetColor\fR. If diff --git a/generic/tkText.c b/generic/tkText.c index 0de648a..88fe19a 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -2288,11 +2288,9 @@ ConfigureText( || (textPtr->selTagPtr->selBorder != NULL) || (textPtr->selTagPtr->reliefString != NULL) || (textPtr->selTagPtr->bgStipple != None) - || (textPtr->selTagPtr->selBgStipple != None) || (textPtr->selTagPtr->fgColor != NULL) || (textPtr->selTagPtr->selFgColor != NULL) || (textPtr->selTagPtr->fgStipple != None) - || (textPtr->selTagPtr->selFgStipple != None) || (textPtr->selTagPtr->overstrikeString != NULL) || (textPtr->selTagPtr->overstrikeColor != NULL) || (textPtr->selTagPtr->underlineString != NULL) diff --git a/generic/tkText.h b/generic/tkText.h index f37e01a..5d88784 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -371,13 +371,8 @@ typedef struct TkTextTag { * NULL means no value specified here. */ Tk_3DBorder selBorder; /* Used for drawing background for selected text. * NULL means no value specified here. */ - Pixmap selBgStipple; /* Stipple bitmap for background of selected text. - * None means no value specified here. */ XColor *selFgColor; /* Foreground color for selected text. NULL means * no value specified here. */ - Pixmap selFgStipple; /* Stipple bitmap for text and other - * foreground stuff when selected. None means - * no value specified here.*/ char *spacing1String; /* -spacing1 option string (malloc-ed). NULL * means option not specified. */ int spacing1; /* Extra spacing above first display line for diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index d22bcb3..0849307 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -818,15 +818,11 @@ GetStyle( for (i = 0 ; i < numTags; i++) { Tk_3DBorder border; - Pixmap bgStipple; XColor *fgColor; - Pixmap fgStipple; tagPtr = tagPtrs[i]; border = tagPtr->border; - bgStipple = tagPtr->bgStipple; fgColor = tagPtr->fgColor; - fgStipple = tagPtr->fgStipple; /* * If this is the selection tag, and inactiveSelBorder is NULL (the @@ -850,18 +846,10 @@ GetStyle( border = tagPtr->selBorder; } - if ((tagPtr->selBgStipple != None) && (isSelected)) { - bgStipple = tagPtr->selBgStipple; - } - if ((tagPtr->selFgColor != None) && (isSelected)) { fgColor = tagPtr->selFgColor; } - if ((tagPtr->selFgStipple != None) && (isSelected)) { - bgStipple = tagPtr->selFgStipple; - } - if ((border != NULL) && (tagPtr->priority > borderPrio)) { styleValues.border = border; borderPrio = tagPtr->priority; @@ -880,9 +868,9 @@ GetStyle( styleValues.relief = tagPtr->relief; reliefPrio = tagPtr->priority; } - if ((bgStipple != None) + if ((tagPtr->bgStipple != None) && (tagPtr->priority > bgStipplePrio)) { - styleValues.bgStipple = bgStipple; + styleValues.bgStipple = tagPtr->bgStipple; bgStipplePrio = tagPtr->priority; } if ((fgColor != None) && (tagPtr->priority > fgPrio)) { @@ -893,9 +881,9 @@ GetStyle( styleValues.tkfont = tagPtr->tkfont; fontPrio = tagPtr->priority; } - if ((fgStipple != None) + if ((tagPtr->fgStipple != None) && (tagPtr->priority > fgStipplePrio)) { - styleValues.fgStipple = fgStipple; + styleValues.fgStipple = tagPtr->fgStipple; fgStipplePrio = tagPtr->priority; } if ((tagPtr->justifyString != NULL) diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index 49d6a50..a212615 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -79,10 +79,6 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, -1, Tk_Offset(TkTextTag, rMarginColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_BITMAP, "-selectbgstipple", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, selBgStipple), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_BITMAP, "-selectfgstipple", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, selFgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-selectforeground", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, selFgColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-spacing1", NULL, NULL, @@ -538,11 +534,9 @@ TkTextTagCmd( || (tagPtr->selBorder != NULL) || (tagPtr->reliefString != NULL) || (tagPtr->bgStipple != None) - || (tagPtr->selBgStipple != None) || (tagPtr->fgColor != NULL) || (tagPtr->selFgColor != NULL) || (tagPtr->fgStipple != None) - || (tagPtr->selFgStipple != None) || (tagPtr->overstrikeString != NULL) || (tagPtr->overstrikeColor != NULL) || (tagPtr->underlineString != NULL) @@ -1055,9 +1049,7 @@ TkTextCreateTag( tagPtr->rMargin = 0; tagPtr->rMarginColor = NULL; tagPtr->selBorder = NULL; - tagPtr->selBgStipple = None; tagPtr->selFgColor = NULL; - tagPtr->selFgStipple = None; tagPtr->spacing1String = NULL; tagPtr->spacing1 = 0; tagPtr->spacing2String = NULL; diff --git a/tests/textTag.test b/tests/textTag.test index f8d7033..88081d0 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -273,34 +273,12 @@ test textTag-1.25d {configuration options} -body { .t tag configure x -selectbackground [lindex [.t tag configure x -selectbackground] 3] } -returnCodes error -result {unknown color name "non-existent"} test textTag-1.25e {tag configuration options} -body { - .t tag configure x -selectbgstipple gray50 - .t tag cget x -selectbgstipple -} -cleanup { - .t tag configure x -selectbgstipple [lindex [.t tag configure x -selectbgstipple] 3] -} -result {gray50} -test textTag-1.25f {configuration options} -body { - .t tag configure x -selectbgstipple badStipple -} -cleanup { - .t tag configure x -selectbgstipple [lindex [.t tag configure x -selectbgstipple] 3] -} -returnCodes error -result {bitmap "badStipple" not defined} -test textTag-1.25g {tag configuration options} -body { - .t tag configure x -selectfgstipple gray50 - .t tag cget x -selectfgstipple -} -cleanup { - .t tag configure x -selectfgstipple [lindex [.t tag configure x -selectfgstipple] 3] -} -result {gray50} -test textTag-1.25h {configuration options} -body { - .t tag configure x -selectfgstipple badStipple -} -cleanup { - .t tag configure x -selectfgstipple [lindex [.t tag configure x -selectfgstipple] 3] -} -returnCodes error -result {bitmap "badStipple" not defined} -test textTag-1.25i {tag configuration options} -body { .t tag configure x -selectforeground #012345 .t tag cget x -selectforeground } -cleanup { .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3] } -result {#012345} -test textTag-1.25j {configuration options} -body { +test textTag-1.25f {configuration options} -body { .t tag configure x -selectforeground non-existent } -cleanup { .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3] -- cgit v0.12 From cabdab6542ae2c49f932009ed1643db724857401 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 9 Mar 2016 14:29:30 +0000 Subject: (cherry-pick) Explicit require Tcl 8.6.0, no matter if Tk is compiled against a later Tcl patchlevel. --- win/makefile.vc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/makefile.vc b/win/makefile.vc index ae43eb6..6f61327 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -961,7 +961,7 @@ install-binaries: !if !$(STATIC_BUILD) @echo creating package index @type << > $(OUT_DIR)\pkgIndex.tcl -if {[catch {package present Tcl $(TCL_PATCH_LEVEL)}]} { return } +if {[catch {package present Tcl 8.6.0}]} { return } if {($$::tcl_platform(platform) eq "unix") && ([info exists ::env(DISPLAY)] || ([info exists ::argv] && ("-display" in $$::argv)))} { package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin libtk$(TK_DOTVERSION).dll] Tk] -- cgit v0.12 From 02bbc0235b0a2c024ec363c9133baf0a77a752b5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 10 Mar 2016 07:22:18 +0000 Subject: Fixed bug [d95e5d8f16] - Hidden panes in panedwindow incorrectly trigger events, patch from Brian Griffin --- generic/tkPanedWindow.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 2451647..f350d0a 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -1370,11 +1370,15 @@ PanedWindowEventProc( DestroyPanedWindow(pwPtr); } else if (eventPtr->type == UnmapNotify) { for (i = 0; i < pwPtr->numSlaves; i++) { - Tk_UnmapWindow(pwPtr->slaves[i]->tkwin); + if (!pwPtr->slaves[i]->hide) { + Tk_UnmapWindow(pwPtr->slaves[i]->tkwin); + } } } else if (eventPtr->type == MapNotify) { for (i = 0; i < pwPtr->numSlaves; i++) { - Tk_MapWindow(pwPtr->slaves[i]->tkwin); + if (!pwPtr->slaves[i]->hide) { + Tk_MapWindow(pwPtr->slaves[i]->tkwin); + } } } } -- cgit v0.12 From 532ab7d7c67ae98335942d7bf2b169be72949772 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 10 Mar 2016 14:20:42 +0000 Subject: Remove excess spacing in various library files. --- doc/tk4.0.ps | 550 ++++++++++++++++++++++---------------------- library/images/logo.eps | 10 +- library/images/pwrdLogo.eps | 10 +- library/ttk/button.tcl | 2 +- library/ttk/clamTheme.tcl | 2 +- library/ttk/defaults.tcl | 2 +- library/ttk/entry.tcl | 4 +- library/ttk/menubutton.tcl | 14 +- library/ttk/notebook.tcl | 10 +- library/ttk/scrollbar.tcl | 2 +- library/ttk/treeview.tcl | 2 +- library/ttk/ttk.tcl | 2 +- library/ttk/vistaTheme.tcl | 10 +- 13 files changed, 310 insertions(+), 310 deletions(-) diff --git a/doc/tk4.0.ps b/doc/tk4.0.ps index d79642d..5b71d92 100644 --- a/doc/tk4.0.ps +++ b/doc/tk4.0.ps @@ -16,7 +16,7 @@ % % Known Problems: % Due to bugs in Transcript, the 'PS-Adobe-' is omitted from line 1 -/FMversion (3.0) def +/FMversion (3.0) def % Set up Color vs. Black-and-White /FMPrintInColor { % once-thru loop gimmick @@ -38,34 +38,34 @@ exit } loop def % Uncomment the following line to force b&w on color printer % /FMPrintInColor false def -/FrameDict 195 dict def +/FrameDict 195 dict def systemdict /errordict known not {/errordict 10 dict def errordict /rangecheck {stop} put} if % The readline in 23.0 doesn't recognize cr's as nl's on AppleTalk -FrameDict /tmprangecheck errordict /rangecheck get put -errordict /rangecheck {FrameDict /bug true put} put -FrameDict /bug false put -mark +FrameDict /tmprangecheck errordict /rangecheck get put +errordict /rangecheck {FrameDict /bug true put} put +FrameDict /bug false put +mark % Some PS machines read past the CR, so keep the following 3 lines together! currentfile 5 string readline 00 0000000000 -cleartomark -errordict /rangecheck FrameDict /tmprangecheck get put -FrameDict /bug get { +cleartomark +errordict /rangecheck FrameDict /tmprangecheck get put +FrameDict /bug get { /readline { /gstring exch def /gfile exch def /gindex 0 def { - gfile read pop - dup 10 eq {exit} if - dup 13 eq {exit} if - gstring exch gindex exch put - /gindex gindex 1 add def + gfile read pop + dup 10 eq {exit} if + dup 13 eq {exit} if + gstring exch gindex exch put + /gindex gindex 1 add def } loop - pop - gstring 0 gindex getinterval true + pop + gstring 0 gindex getinterval true } def } if /FMVERSION { @@ -76,12 +76,12 @@ FrameDict /bug get { dup = show showpage } if - } def + } def /FMLOCAL { FrameDict begin - 0 def - end - } def + 0 def + end + } def /gstring FMLOCAL /gfile FMLOCAL /gindex FMLOCAL @@ -94,8 +94,8 @@ FrameDict /bug get { /manualfeed FMLOCAL /paperheight FMLOCAL /paperwidth FMLOCAL -/FMDOCUMENT { - array /FMfonts exch def +/FMDOCUMENT { + array /FMfonts exch def /#copies exch def FrameDict begin 0 ne dup {setmanualfeed} if @@ -107,62 +107,62 @@ FrameDict /bug get { currenttransfer cvlit /orgxfer exch def currentscreen cvlit /orgproc exch def /organgle exch def /orgfreq exch def - setpapername - manualfeed {true} {papersize} ifelse - {manualpapersize} {false} ifelse + setpapername + manualfeed {true} {papersize} ifelse + {manualpapersize} {false} ifelse {desperatepapersize} if - end - } def + end + } def /pagesave FMLOCAL /orgmatrix FMLOCAL /landscape FMLOCAL -/FMBEGINPAGE { - FrameDict begin +/FMBEGINPAGE { + FrameDict begin /pagesave save def 3.86 setmiterlimit /landscape exch 0 ne def - landscape { - 90 rotate 0 exch neg translate pop + landscape { + 90 rotate 0 exch neg translate pop } {pop pop} ifelse xscale yscale scale /orgmatrix matrix def - gsave - } def + gsave + } def /FMENDPAGE { - grestore + grestore pagesave restore - end + end showpage - } def -/FMFONTDEFINE { + } def +/FMFONTDEFINE { FrameDict begin - findfont - ReEncode - 1 index exch - definefont - FMfonts 3 1 roll + findfont + ReEncode + 1 index exch + definefont + FMfonts 3 1 roll put - end - } def + end + } def /FMFILLS { FrameDict begin array /fillvals exch def - end - } def + end + } def /FMFILL { FrameDict begin fillvals 3 1 roll put - end - } def -/FMNORMALIZEGRAPHICS { + end + } def +/FMNORMALIZEGRAPHICS { newpath 0.0 0.0 moveto 1 setlinewidth 0 setlinecap 0 0 0 sethsbcolor - 0 setgray + 0 setgray } bind def /fx FMLOCAL /fy FMLOCAL @@ -172,22 +172,22 @@ FrameDict /bug get { /lly FMLOCAL /urx FMLOCAL /ury FMLOCAL -/FMBEGINEPSF { - end - /FMEPSF save def - /showpage {} def - FMNORMALIZEGRAPHICS - [/fy /fx /fh /fw /ury /urx /lly /llx] {exch def} forall - fx fy translate +/FMBEGINEPSF { + end + /FMEPSF save def + /showpage {} def + FMNORMALIZEGRAPHICS + [/fy /fx /fh /fw /ury /urx /lly /llx] {exch def} forall + fx fy translate rotate - fw urx llx sub div fh ury lly sub div scale - llx neg lly neg translate + fw urx llx sub div fh ury lly sub div scale + llx neg lly neg translate } bind def /FMENDEPSF { FMEPSF restore - FrameDict begin + FrameDict begin } bind def -FrameDict begin +FrameDict begin /setmanualfeed { %%BeginFeature *ManualFeed True statusdict /manualfeed true put @@ -196,16 +196,16 @@ FrameDict begin /max {2 copy lt {exch} if pop} bind def /min {2 copy gt {exch} if pop} bind def /inch {72 mul} def -/pagedimen { - paperheight sub abs 16 lt exch +/pagedimen { + paperheight sub abs 16 lt exch paperwidth sub abs 16 lt and {/papername exch def} {pop} ifelse } def /papersizedict FMLOCAL -/setpapername { - /papersizedict 14 dict def +/setpapername { + /papersizedict 14 dict def papersizedict begin - /papername /unknown def + /papername /unknown def /Letter 8.5 inch 11.0 inch pagedimen /LetterSmall 7.68 inch 10.16 inch pagedimen /Tabloid 11.0 inch 17.0 inch pagedimen @@ -237,9 +237,9 @@ FrameDict begin /unknown {unknown} def papersizedict dup papername known {papername} {/unknown} ifelse get end - /FMdicttop countdictstack 1 add def - statusdict begin stopped end - countdictstack -1 FMdicttop {pop end} for + /FMdicttop countdictstack 1 add def + statusdict begin stopped end + countdictstack -1 FMdicttop {pop end} for } def /manualpapersize { papersizedict begin @@ -258,14 +258,14 @@ FrameDict begin /unknown {unknown} def papersizedict dup papername known {papername} {/unknown} ifelse get end - stopped + stopped } def /desperatepapersize { statusdict /setpageparams known { - paperwidth paperheight 0 1 + paperwidth paperheight 0 1 statusdict begin - {setpageparams} stopped pop + {setpageparams} stopped pop end } if } def @@ -314,18 +314,18 @@ FrameDict begin /Uacute /Ucircumflex /Ugrave /dotlessi /circumflex /tilde /macron /breve /dotaccent /ring /cedilla /hungarumlaut /ogonek /caron ] def -/ReEncode { - dup - length - dict begin +/ReEncode { + dup + length + dict begin { - 1 index /FID ne - {def} - {pop pop} ifelse - } forall - 0 eq {/Encoding DiacriticEncoding def} if - currentdict - end + 1 index /FID ne + {def} + {pop pop} ifelse + } forall + 0 eq {/Encoding DiacriticEncoding def} if + currentdict + end } bind def /graymode true def /bwidth FMLOCAL @@ -342,7 +342,7 @@ FrameDict begin /bpside exch def /bstring exch def /onbits 0 def /offbits 0 def - freq sangle landscape {90 add} if + freq sangle landscape {90 add} if {/y exch def /x exch def /xindex x 1 add 2 div bpside mul cvi def @@ -370,14 +370,14 @@ FrameDict begin /SAT FMLOCAL /BRIGHT FMLOCAL /Colors FMLOCAL -FMPrintInColor - +FMPrintInColor + { /HUE 0 def /SAT 0 def /BRIGHT 0 def % array of arrays Hue and Sat values for the separations [HUE BRIGHT] - /Colors + /Colors [[0 0 ] % black [0 0 ] % white [0.00 1.0] % red @@ -387,44 +387,44 @@ FMPrintInColor [0.83 1.0] % magenta [0.16 1.0] % comment / yellow ] def - - /BEGINBITMAPCOLOR { + + /BEGINBITMAPCOLOR { BITMAPCOLOR} def - /BEGINBITMAPCOLORc { + /BEGINBITMAPCOLORc { BITMAPCOLORc} def - /BEGINBITMAPTRUECOLOR { + /BEGINBITMAPTRUECOLOR { BITMAPTRUECOLOR } def - /BEGINBITMAPTRUECOLORc { + /BEGINBITMAPTRUECOLORc { BITMAPTRUECOLORc } def - /K { + /K { Colors exch get dup - 0 get /HUE exch store + 0 get /HUE exch store 1 get /BRIGHT exch store HUE 0 eq BRIGHT 0 eq and {1.0 SAT sub setgray} - {HUE SAT BRIGHT sethsbcolor} + {HUE SAT BRIGHT sethsbcolor} ifelse } def - /FMsetgray { - /SAT exch 1.0 exch sub store + /FMsetgray { + /SAT exch 1.0 exch sub store HUE 0 eq BRIGHT 0 eq and {1.0 SAT sub setgray} - {HUE SAT BRIGHT sethsbcolor} + {HUE SAT BRIGHT sethsbcolor} ifelse } bind def } - + { - /BEGINBITMAPCOLOR { + /BEGINBITMAPCOLOR { BITMAPGRAY} def - /BEGINBITMAPCOLORc { + /BEGINBITMAPCOLORc { BITMAPGRAYc} def - /BEGINBITMAPTRUECOLOR { + /BEGINBITMAPTRUECOLOR { BITMAPTRUEGRAY } def - /BEGINBITMAPTRUECOLORc { + /BEGINBITMAPTRUECOLORc { BITMAPTRUEGRAYc } def /FMsetgray {setgray} bind def - /K { + /K { pop } def } @@ -435,27 +435,27 @@ ifelse /dnormalize { dtransform round exch round exch idtransform } bind def -/lnormalize { +/lnormalize { 0 dtransform exch cvi 2 idiv 2 mul 1 add exch idtransform pop } bind def -/H { +/H { lnormalize setlinewidth } bind def /Z { setlinecap } bind def /fillvals FMLOCAL -/X { +/X { fillvals exch get dup type /stringtype eq - {8 1 setpattern} + {8 1 setpattern} {grayness} ifelse } bind def -/V { +/V { gsave eofill grestore } bind def -/N { +/N { stroke } bind def /M {newpath moveto} bind def @@ -463,15 +463,15 @@ ifelse /D {curveto} bind def /O {closepath} bind def /n FMLOCAL -/L { +/L { /n exch def newpath normalize - moveto + moveto 2 1 n {pop normalize lineto} for } bind def -/Y { - L +/Y { + L closepath } bind def /x1 FMLOCAL @@ -479,7 +479,7 @@ ifelse /y1 FMLOCAL /y2 FMLOCAL /rad FMLOCAL -/R { +/R { /y2 exch def /x2 exch def /y1 exch def @@ -488,9 +488,9 @@ ifelse x2 y1 x2 y2 x1 y2 - 4 Y + 4 Y } bind def -/RR { +/RR { /rad exch def normalize /y2 exch def @@ -507,87 +507,87 @@ ifelse closepath 16 {pop} repeat } bind def -/C { +/C { grestore gsave - R + R clip } bind def /FMpointsize FMLOCAL -/F { +/F { FMfonts exch get FMpointsize scalefont setfont } bind def -/Q { +/Q { /FMpointsize exch def - F + F } bind def -/T { +/T { moveto show } bind def -/RF { +/RF { rotate 0 ne {-1 1 scale} if } bind def -/TF { +/TF { gsave - moveto + moveto RF show grestore } bind def -/P { +/P { moveto 0 32 3 2 roll widthshow } bind def -/PF { +/PF { gsave - moveto + moveto RF 0 32 3 2 roll widthshow grestore } bind def -/S { +/S { moveto 0 exch ashow } bind def -/SF { +/SF { gsave moveto RF 0 exch ashow grestore } bind def -/B { +/B { moveto 0 32 4 2 roll 0 exch awidthshow } bind def -/BF { +/BF { gsave moveto RF 0 32 4 2 roll 0 exch awidthshow grestore } bind def -/G { +/G { gsave newpath - normalize translate 0.0 0.0 moveto - dnormalize scale - 0.0 0.0 1.0 5 3 roll arc + normalize translate 0.0 0.0 moveto + dnormalize scale + 0.0 0.0 1.0 5 3 roll arc closepath fill grestore } bind def -/A { +/A { gsave savematrix newpath - 2 index 2 div add exch 3 index 2 div sub exch - normalize 2 index 2 div sub exch 3 index 2 div add exch - translate - scale - 0.0 0.0 1.0 5 3 roll arc + 2 index 2 div add exch 3 index 2 div sub exch + normalize 2 index 2 div sub exch 3 index 2 div add exch + translate + scale + 0.0 0.0 1.0 5 3 roll arc restorematrix stroke grestore @@ -603,37 +603,37 @@ ifelse /FMsaveobject FMLOCAL /FMoptop FMLOCAL /FMdicttop FMLOCAL -/BEGINPRINTCODE { - /FMdicttop countdictstack 1 add def - /FMoptop count 4 sub def +/BEGINPRINTCODE { + /FMdicttop countdictstack 1 add def + /FMoptop count 4 sub def /FMsaveobject save def - userdict begin - /showpage {} def - FMNORMALIZEGRAPHICS + userdict begin + /showpage {} def + FMNORMALIZEGRAPHICS 3 index neg 3 index neg translate } bind def /ENDPRINTCODE { - count -1 FMoptop {pop pop} for - countdictstack -1 FMdicttop {pop end} for - FMsaveobject restore + count -1 FMoptop {pop pop} for + countdictstack -1 FMdicttop {pop end} for + FMsaveobject restore } bind def -/gn { - 0 - { 46 mul - cf read pop - 32 sub - dup 46 lt {exit} if - 46 sub add +/gn { + 0 + { 46 mul + cf read pop + 32 sub + dup 46 lt {exit} if + 46 sub add } loop - add + add } bind def /str FMLOCAL -/cfs { - /str sl string def - 0 1 sl 1 sub {str exch val put} for - str def +/cfs { + /str sl string def + 0 1 sl 1 sub {str exch val put} for + str def } bind def -/ic [ +/ic [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0223 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0223 0 @@ -655,49 +655,49 @@ ifelse /cs FMLOCAL /len FMLOCAL /pos FMLOCAL -/ms { - /sl exch def - /val 255 def - /ws cfs - /im cfs - /val 0 def - /bs cfs - /cs cfs +/ms { + /sl exch def + /val 255 def + /ws cfs + /im cfs + /val 0 def + /bs cfs + /cs cfs } bind def -400 ms -/ip { - is - 0 - cf cs readline pop - { ic exch get exec - add - } forall - pop - +400 ms +/ip { + is + 0 + cf cs readline pop + { ic exch get exec + add + } forall + pop + } bind def -/wh { - /len exch def - /pos exch def +/wh { + /len exch def + /pos exch def ws 0 len getinterval im pos len getinterval copy pop - pos len + pos len } bind def -/bl { - /len exch def - /pos exch def +/bl { + /len exch def + /pos exch def bs 0 len getinterval im pos len getinterval copy pop - pos len + pos len } bind def /s1 1 string def -/fl { - /len exch def - /pos exch def +/fl { + /len exch def + /pos exch def /val cf s1 readhexstring pop 0 get def pos 1 pos len add 1 sub {im exch val put} for - pos len + pos len } bind def -/hx { - 3 copy getinterval - cf exch readhexstring pop pop +/hx { + 3 copy getinterval + cf exch readhexstring pop pop } bind def /h FMLOCAL /w FMLOCAL @@ -706,57 +706,57 @@ ifelse /bitmapsave FMLOCAL /is FMLOCAL /cf FMLOCAL -/wbytes { - dup +/wbytes { + dup 8 eq {pop} {1 eq {7 add 8 idiv} {3 add 4 idiv} ifelse} ifelse } bind def -/BEGINBITMAPBWc { +/BEGINBITMAPBWc { 1 {} COMMONBITMAPc } bind def -/BEGINBITMAPGRAYc { +/BEGINBITMAPGRAYc { 8 {} COMMONBITMAPc } bind def -/BEGINBITMAP2BITc { +/BEGINBITMAP2BITc { 2 {} COMMONBITMAPc } bind def -/COMMONBITMAPc { +/COMMONBITMAPc { /r exch def /d exch def gsave translate rotate scale /h exch def /w exch def - /lb w d wbytes def - sl lb lt {lb ms} if - /bitmapsave save def - r - /is im 0 lb getinterval def - ws 0 lb getinterval is copy pop - /cf currentfile def - w h d [w 0 0 h neg 0 h] - {ip} image - bitmapsave restore + /lb w d wbytes def + sl lb lt {lb ms} if + /bitmapsave save def + r + /is im 0 lb getinterval def + ws 0 lb getinterval is copy pop + /cf currentfile def + w h d [w 0 0 h neg 0 h] + {ip} image + bitmapsave restore grestore } bind def -/BEGINBITMAPBW { +/BEGINBITMAPBW { 1 {} COMMONBITMAP } bind def -/BEGINBITMAPGRAY { +/BEGINBITMAPGRAY { 8 {} COMMONBITMAP } bind def -/BEGINBITMAP2BIT { +/BEGINBITMAP2BIT { 2 {} COMMONBITMAP } bind def -/COMMONBITMAP { +/COMMONBITMAP { /r exch def /d exch def gsave translate rotate scale /h exch def /w exch def - /bitmapsave save def - r + /bitmapsave save def + r /is w d wbytes string def - /cf currentfile def - w h d [w 0 0 h neg 0 h] + /cf currentfile def + w h d [w 0 0 h neg 0 h] {cf is readhexstring pop} image - bitmapsave restore + bitmapsave restore grestore } bind def /proc1 FMLOCAL @@ -813,7 +813,7 @@ ifelse /tran FMLOCAL /fakecolorsetup { /tran 256 string def - 0 1 255 {/indx exch def + 0 1 255 {/indx exch def tran indx red indx get 77 mul green indx get 151 mul @@ -823,77 +823,77 @@ ifelse {255 mul cvi tran exch get 255.0 div} exch Fmcc settransfer } bind def -/BITMAPCOLOR { +/BITMAPCOLOR { /d 8 def gsave translate rotate scale /h exch def /w exch def - /bitmapsave save def + /bitmapsave save def colorsetup /is w d wbytes string def - /cf currentfile def - w h d [w 0 0 h neg 0 h] - {cf is readhexstring pop} {is} {is} true 3 colorimage - bitmapsave restore + /cf currentfile def + w h d [w 0 0 h neg 0 h] + {cf is readhexstring pop} {is} {is} true 3 colorimage + bitmapsave restore grestore } bind def -/BITMAPCOLORc { +/BITMAPCOLORc { /d 8 def gsave translate rotate scale /h exch def /w exch def - /lb w d wbytes def - sl lb lt {lb ms} if - /bitmapsave save def + /lb w d wbytes def + sl lb lt {lb ms} if + /bitmapsave save def colorsetup - /is im 0 lb getinterval def - ws 0 lb getinterval is copy pop - /cf currentfile def - w h d [w 0 0 h neg 0 h] + /is im 0 lb getinterval def + ws 0 lb getinterval is copy pop + /cf currentfile def + w h d [w 0 0 h neg 0 h] {ip} {is} {is} true 3 colorimage - bitmapsave restore + bitmapsave restore grestore } bind def -/BITMAPTRUECOLORc { +/BITMAPTRUECOLORc { gsave translate rotate scale /h exch def /w exch def - /bitmapsave save def - + /bitmapsave save def + /is w string def - - ws 0 w getinterval is copy pop - /cf currentfile def - w h 8 [w 0 0 h neg 0 h] + + ws 0 w getinterval is copy pop + /cf currentfile def + w h 8 [w 0 0 h neg 0 h] {ip} {gip} {bip} true 3 colorimage - bitmapsave restore + bitmapsave restore grestore } bind def -/BITMAPTRUECOLOR { +/BITMAPTRUECOLOR { gsave translate rotate scale /h exch def /w exch def - /bitmapsave save def + /bitmapsave save def /is w string def /gis w string def /bis w string def - /cf currentfile def - w h 8 [w 0 0 h neg 0 h] - { cf is readhexstring pop } - { cf gis readhexstring pop } - { cf bis readhexstring pop } - true 3 colorimage - bitmapsave restore + /cf currentfile def + w h 8 [w 0 0 h neg 0 h] + { cf is readhexstring pop } + { cf gis readhexstring pop } + { cf bis readhexstring pop } + true 3 colorimage + bitmapsave restore grestore } bind def -/BITMAPTRUEGRAYc { +/BITMAPTRUEGRAYc { gsave translate rotate scale /h exch def /w exch def - /bitmapsave save def - + /bitmapsave save def + /is w string def - - ws 0 w getinterval is copy pop - /cf currentfile def - w h 8 [w 0 0 h neg 0 h] + + ws 0 w getinterval is copy pop + /cf currentfile def + w h 8 [w 0 0 h neg 0 h] {ip gip bip w gray} image - bitmapsave restore + bitmapsave restore grestore } bind def /ww FMLOCAL @@ -901,7 +901,7 @@ ifelse /g FMLOCAL /b FMLOCAL /i FMLOCAL -/gray { +/gray { /ww exch def /b exch def /g exch def @@ -910,30 +910,30 @@ ifelse b i get .114 mul add add r i 3 -1 roll floor cvi put } for r } bind def -/BITMAPTRUEGRAY { +/BITMAPTRUEGRAY { gsave translate rotate scale /h exch def /w exch def - /bitmapsave save def + /bitmapsave save def /is w string def /gis w string def /bis w string def - /cf currentfile def - w h 8 [w 0 0 h neg 0 h] - { cf is readhexstring pop - cf gis readhexstring pop + /cf currentfile def + w h 8 [w 0 0 h neg 0 h] + { cf is readhexstring pop + cf gis readhexstring pop cf bis readhexstring pop w gray} image - bitmapsave restore + bitmapsave restore grestore } bind def -/BITMAPGRAY { +/BITMAPGRAY { 8 {fakecolorsetup} COMMONBITMAP } bind def -/BITMAPGRAYc { +/BITMAPGRAYc { 8 {fakecolorsetup} COMMONBITMAPc } bind def /ENDBITMAP { } bind def -end +end /ALDsave FMLOCAL /ALDmatrix matrix def ALDmatrix currentmatrix pop /StartALD { diff --git a/library/images/logo.eps b/library/images/logo.eps index 0d05d34..006e72a 100644 --- a/library/images/logo.eps +++ b/library/images/logo.eps @@ -28,7 +28,7 @@ %%BeginProlog %%BeginResource: procset Adobe_level2_AI5 1.0 0 %%Title: (Adobe Illustrator (R) Version 5.0 Level 2 Emulation) -%%Version: 1.0 +%%Version: 1.0 %%CreationDate: (04/10/93) () %%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved) userdict /Adobe_level2_AI5 21 dict dup begin @@ -77,7 +77,7 @@ userdict /Adobe_level2_AI5 21 dict dup begin } def } if - + /gt38? mark {version cvx exec} stopped {cleartomark true} {38 gt exch pop} ifelse def userdict /deviceDPI 72 0 matrix defaultmatrix dtransform dup mul exch dup mul add sqrt put userdict /level2? @@ -178,7 +178,7 @@ userdict /Adobe_level2_AI5 21 dict dup begin %%EndResource %%BeginResource: procset Adobe_IllustratorA_AI5 1.1 0 %%Title: (Adobe Illustrator (R) Version 5.0 Abbreviated Prolog) -%%Version: 1.1 +%%Version: 1.1 %%CreationDate: (3/7/1994) () %%Copyright: ((C) 1987-1994 Adobe Systems Incorporated All Rights Reserved) currentpacking true setpacking @@ -1062,7 +1062,7 @@ end } { /clipForward? true def - + /Tx /pop load def /Tj /pop load def currentdict end clipRenderOff begin begin @@ -1089,7 +1089,7 @@ end end end begin - + /clipForward? false ddef } if } ifelse diff --git a/library/images/pwrdLogo.eps b/library/images/pwrdLogo.eps index e11d9e9..674250f 100644 --- a/library/images/pwrdLogo.eps +++ b/library/images/pwrdLogo.eps @@ -28,7 +28,7 @@ %%BeginProlog %%BeginResource: procset Adobe_level2_AI5 1.0 0 %%Title: (Adobe Illustrator (R) Version 5.0 Level 2 Emulation) -%%Version: 1.0 +%%Version: 1.0 %%CreationDate: (04/10/93) () %%Copyright: ((C) 1987-1993 Adobe Systems Incorporated All Rights Reserved) userdict /Adobe_level2_AI5 21 dict dup begin @@ -77,7 +77,7 @@ userdict /Adobe_level2_AI5 21 dict dup begin } def } if - + /gt38? mark {version cvx exec} stopped {cleartomark true} {38 gt exch pop} ifelse def userdict /deviceDPI 72 0 matrix defaultmatrix dtransform dup mul exch dup mul add sqrt put userdict /level2? @@ -178,7 +178,7 @@ userdict /Adobe_level2_AI5 21 dict dup begin %%EndResource %%BeginResource: procset Adobe_IllustratorA_AI5 1.1 0 %%Title: (Adobe Illustrator (R) Version 5.0 Abbreviated Prolog) -%%Version: 1.1 +%%Version: 1.1 %%CreationDate: (3/7/1994) () %%Copyright: ((C) 1987-1994 Adobe Systems Incorporated All Rights Reserved) currentpacking true setpacking @@ -1062,7 +1062,7 @@ end } { /clipForward? true def - + /Tx /pop load def /Tj /pop load def currentdict end clipRenderOff begin begin @@ -1089,7 +1089,7 @@ end end end begin - + /clipForward? false ddef } if } ifelse diff --git a/library/ttk/button.tcl b/library/ttk/button.tcl index 9f2cec7..24065c2 100644 --- a/library/ttk/button.tcl +++ b/library/ttk/button.tcl @@ -8,7 +8,7 @@ # (If the button is released off the widget, the grab deactivates and # we get a event then, which turns off the "active" state) # -# Normally, and events are +# Normally, and events are # delivered to the widget which received the initial # event. However, Tk [grab]s (#1223103) and menu interactions # (#1222605) can interfere with this. To guard against spurious diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index f184ea0..1789b8a 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -5,7 +5,7 @@ # namespace eval ttk::theme::clam { - variable colors + variable colors array set colors { -disabledfg "#999999" -frame "#dcdad5" diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl index 05a46bd..4551966 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -40,7 +40,7 @@ namespace eval ttk::theme::default { ttk::style configure TButton \ -anchor center -padding "3 3" -width -9 \ -relief raised -shiftrelief 1 - ttk::style map TButton -relief [list {!disabled pressed} sunken] + ttk::style map TButton -relief [list {!disabled pressed} sunken] ttk::style configure TCheckbutton \ -indicatorcolor "#ffffff" -indicatorrelief sunken -padding 1 diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl index b3ebcbd..647d16e 100644 --- a/library/ttk/entry.tcl +++ b/library/ttk/entry.tcl @@ -418,7 +418,7 @@ proc ttk::entry::DragOut {w mode} { # Suspend autoscroll. # proc ttk::entry::DragIn {w} { - ttk::CancelRepeat + ttk::CancelRepeat } ## binding @@ -432,7 +432,7 @@ proc ttk::entry::Release {w} { ## AutoScroll # Called repeatedly when the mouse is outside an entry window # with Button 1 down. Scroll the window left or right, -# depending on where the mouse left the window, and extend +# depending on where the mouse left the window, and extend # the selection according to the current selection mode. # # TODO: AutoScroll should repeat faster (50ms) than normal autorepeat. diff --git a/library/ttk/menubutton.tcl b/library/ttk/menubutton.tcl index 093bb02..ad57020 100644 --- a/library/ttk/menubutton.tcl +++ b/library/ttk/menubutton.tcl @@ -10,7 +10,7 @@ # (In addition, when menu system is active, "dropdown" -- menu posts # on mouse-over. Ttk menubuttons don't implement this). # -# For keyboard and popdown mode, we hand off to tk_popup and let +# For keyboard and popdown mode, we hand off to tk_popup and let # the built-in Tk bindings handle the rest of the interaction. # # ON X11: @@ -22,13 +22,13 @@ # rely on the passive grab that occurs on events, # and transition to popdown mode when the mouse is released # or dragged outside the menubutton. -# +# # ON WINDOWS: # -# I'm not sure what the hell is going on here. [$menu post] apparently +# I'm not sure what the hell is going on here. [$menu post] apparently # sets up some kind of internal grab for native menus. # On this platform, just use [tk_popup] for all menu actions. -# +# # ON MACOS: # # Same probably applies here. @@ -61,7 +61,7 @@ if {[tk windowingsystem] eq "x11"} { } # PostPosition -- -# Returns the x and y coordinates where the menu +# Returns the x and y coordinates where the menu # should be posted, based on the menubutton and menu size # and -direction option. # @@ -85,7 +85,7 @@ proc ttk::menubutton::PostPosition {mb menu} { below { if {$y <= $sh} { incr y $bh } { incr y -$mh } } left { if {$x >= $mw} { incr x -$mw } { incr x $bw } } right { if {$x <= $sw} { incr x $bw } { incr x -$mw } } - flush { + flush { # post menu atop menubutton. # If there's a menu entry whose label matches the # menubutton -text, assume this is an optionmenu @@ -113,7 +113,7 @@ proc ttk::menubutton::Popdown {mb} { # Pulldown (X11 only) -- # Called when Button1 is pressed on a menubutton. -# Posts the menu; a subsequent ButtonRelease +# Posts the menu; a subsequent ButtonRelease # or Leave event will set a grab on the menu. # proc ttk::menubutton::Pulldown {mb} { diff --git a/library/ttk/notebook.tcl b/library/ttk/notebook.tcl index 72b85e6..92efe40 100644 --- a/library/ttk/notebook.tcl +++ b/library/ttk/notebook.tcl @@ -70,7 +70,7 @@ proc ttk::notebook::CycleTab {w dir} { } # MnemonicTab $nb $key -- -# Scan all tabs in the specified notebook for one with the +# Scan all tabs in the specified notebook for one with the # specified mnemonic. If found, returns path name of tab; # otherwise returns "" # @@ -94,8 +94,8 @@ proc ttk::notebook::MnemonicTab {nb key} { # Enable keyboard traversal for a notebook widget # by adding bindings to the containing toplevel window. # -# TLNotebooks($top) keeps track of the list of all traversal-enabled -# notebooks contained in the toplevel +# TLNotebooks($top) keeps track of the list of all traversal-enabled +# notebooks contained in the toplevel # proc ttk::notebook::enableTraversal {nb} { variable TLNotebooks @@ -145,7 +145,7 @@ proc ttk::notebook::Cleanup {nb} { } } -# EnclosingNotebook $w -- +# EnclosingNotebook $w -- # Return the nearest traversal-enabled notebook widget # that contains $w. # @@ -171,7 +171,7 @@ proc ttk::notebook::EnclosingNotebook {w} { # TLCycleTab -- # toplevel binding procedure for Control-Tab / Control-Shift-Tab -# Select the next/previous tab in the nearest ancestor notebook. +# Select the next/previous tab in the nearest ancestor notebook. # proc ttk::notebook::TLCycleTab {w dir} { set nb [EnclosingNotebook $w] diff --git a/library/ttk/scrollbar.tcl b/library/ttk/scrollbar.tcl index 4bd5107..17d729d 100644 --- a/library/ttk/scrollbar.tcl +++ b/library/ttk/scrollbar.tcl @@ -86,7 +86,7 @@ proc ttk::scrollbar::Press {w x y} { proc ttk::scrollbar::Drag {w x y} { variable State if {![info exists State(first)]} { - # Initial buttonpress was not on the thumb, + # Initial buttonpress was not on the thumb, # or something screwy has happened. In either case, ignore: return; } diff --git a/library/ttk/treeview.tcl b/library/ttk/treeview.tcl index 8772587..c38b5b6 100644 --- a/library/ttk/treeview.tcl +++ b/library/ttk/treeview.tcl @@ -46,7 +46,7 @@ bind Treeview \ bind Treeview <> \ { ttk::treeview::Select %W %x %y toggle } -ttk::copyBindings TtkScrollable Treeview +ttk::copyBindings TtkScrollable Treeview ### Binding procedures. # diff --git a/library/ttk/ttk.tcl b/library/ttk/ttk.tcl index 7bae211..665222d 100644 --- a/library/ttk/ttk.tcl +++ b/library/ttk/ttk.tcl @@ -122,7 +122,7 @@ proc ttk::LoadThemes {} { variable library # "default" always present: - uplevel #0 [list source [file join $library defaults.tcl]] + uplevel #0 [list source [file join $library defaults.tcl]] set builtinThemes [style theme names] foreach {theme scripts} { diff --git a/library/ttk/vistaTheme.tcl b/library/ttk/vistaTheme.tcl index 99410cb..1ec824a 100644 --- a/library/ttk/vistaTheme.tcl +++ b/library/ttk/vistaTheme.tcl @@ -3,7 +3,7 @@ # # The Vista theme can only be defined on Windows Vista and above. The theme -# is created in C due to the need to assign a theme-enabled function for +# is created in C due to the need to assign a theme-enabled function for # detecting when themeing is disabled. On systems that cannot support the # Vista theme, there will be no such theme created and we must not # evaluate this script. @@ -146,7 +146,7 @@ namespace eval ttk::theme::vista { -selectforeground [list !focus SystemWindowText] \ ; - + # SCROLLBAR elements (Vista includes a state for 'hover') ttk::style element create Vertical.Scrollbar.uparrow vsapi \ SCROLLBAR 1 {disabled 4 pressed 3 active 2 hover 17 {} 1} \ @@ -191,7 +191,7 @@ namespace eval ttk::theme::vista { Vertical.Progressbar.pbar -side bottom -sticky we } } - + # Scale ttk::style element create Horizontal.Scale.slider vsapi \ TRACKBAR 3 {disabled 5 focus 4 pressed 3 active 2 {} 1} \ @@ -215,10 +215,10 @@ namespace eval ttk::theme::vista { } } } - + # Treeview ttk::style configure Item -padding {4 0 0 0} - + package provide ttk::theme::vista 1.0 } } -- cgit v0.12 From ecf0f568de78e737daeafcf39494950100e28d6b Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 10 Mar 2016 16:25:35 +0000 Subject: Added non regression test case for bug [d95e5d8f16] --- tests/panedwindow.test | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/panedwindow.test b/tests/panedwindow.test index 666ed9c..ee184ce 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -4955,6 +4955,38 @@ test panedwindow-23.30 {ConfigurePanes, -hide works} -setup { } -cleanup { deleteWindows } -result {1 1 1 0 39 40 40 1 130 1 0 1 1 40 40 40 42 130} +test panedwindow-23.30a {ConfigurePanes, hidden panes are unmapped} -setup { + deleteWindows +} -body { + panedwindow .p1 -sashrelief raised + panedwindow .p2 -sashrelief raised + label .l1 -text Label1 + label .l2 -text Label2 + label .l3 -text Label3 + .p2 add .l2 -sticky nsew + .p2 add .l3 -sticky nsew + .p1 add .p2 -sticky nsew + .p1 add .l1 -sticky nsew + pack .p1 -side top -expand 1 -fill both + update + set result [list] + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + .p2 paneconfigure .l1 -hide 1 + update + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + .p1 paneconfigure .p2 -hide 1 + update + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + .p1 paneconfigure .p2 -hide 0 + update + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] +} -cleanup { + deleteWindows +} -result {{1 1 1 1 1} {1 1 0 1 1} {1 0 0 0 0} {1 1 0 1 1}} test panedwindow-23.31 {ConfigurePanes, -hide works, last pane stretches} -setup { deleteWindows } -body { -- cgit v0.12 From d30f4bda39ecf441026e68b7f58eb642c659230f Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 11 Mar 2016 08:24:23 +0000 Subject: Fixed bug [d95e5d8f16] - Hidden panes in panedwindow incorrectly trigger events (cherrypicked [42c8d8441c]) --- generic/tkPanedWindow.c | 8 ++++++-- tests/panedwindow.test | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 2451647..f350d0a 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -1370,11 +1370,15 @@ PanedWindowEventProc( DestroyPanedWindow(pwPtr); } else if (eventPtr->type == UnmapNotify) { for (i = 0; i < pwPtr->numSlaves; i++) { - Tk_UnmapWindow(pwPtr->slaves[i]->tkwin); + if (!pwPtr->slaves[i]->hide) { + Tk_UnmapWindow(pwPtr->slaves[i]->tkwin); + } } } else if (eventPtr->type == MapNotify) { for (i = 0; i < pwPtr->numSlaves; i++) { - Tk_MapWindow(pwPtr->slaves[i]->tkwin); + if (!pwPtr->slaves[i]->hide) { + Tk_MapWindow(pwPtr->slaves[i]->tkwin); + } } } } diff --git a/tests/panedwindow.test b/tests/panedwindow.test index 666ed9c..ee184ce 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -4955,6 +4955,38 @@ test panedwindow-23.30 {ConfigurePanes, -hide works} -setup { } -cleanup { deleteWindows } -result {1 1 1 0 39 40 40 1 130 1 0 1 1 40 40 40 42 130} +test panedwindow-23.30a {ConfigurePanes, hidden panes are unmapped} -setup { + deleteWindows +} -body { + panedwindow .p1 -sashrelief raised + panedwindow .p2 -sashrelief raised + label .l1 -text Label1 + label .l2 -text Label2 + label .l3 -text Label3 + .p2 add .l2 -sticky nsew + .p2 add .l3 -sticky nsew + .p1 add .p2 -sticky nsew + .p1 add .l1 -sticky nsew + pack .p1 -side top -expand 1 -fill both + update + set result [list] + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + .p2 paneconfigure .l1 -hide 1 + update + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + .p1 paneconfigure .p2 -hide 1 + update + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] + .p1 paneconfigure .p2 -hide 0 + update + lappend result [list [winfo ismapped .p1] [winfo ismapped .p2] \ + [winfo ismapped .l1] [winfo ismapped .l2] [winfo ismapped .l3]] +} -cleanup { + deleteWindows +} -result {{1 1 1 1 1} {1 1 0 1 1} {1 0 0 0 0} {1 1 0 1 1}} test panedwindow-23.31 {ConfigurePanes, -hide works, last pane stretches} -setup { deleteWindows } -body { -- cgit v0.12 From 88c76da7f7b34507aafaf94a6329fb943f881029 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 11 Mar 2016 14:47:03 +0000 Subject: Excess spacing in documentation --- doc/3DBorder.3 | 2 +- doc/BindTable.3 | 2 +- doc/CanvPsY.3 | 2 +- doc/CanvTkwin.3 | 2 +- doc/CanvTxtInfo.3 | 2 +- doc/Clipboard.3 | 2 +- doc/ClrSelect.3 | 2 +- doc/ConfigWind.3 | 2 +- doc/CoordToWin.3 | 2 +- doc/CrtCmHdlr.3 | 2 +- doc/CrtConsoleChan.3 | 2 +- doc/CrtErrHdlr.3 | 2 +- doc/CrtGenHdlr.3 | 2 +- doc/CrtImgType.3 | 2 +- doc/CrtItemType.3 | 2 +- doc/CrtPhImgFmt.3 | 2 +- doc/DeleteImg.3 | 2 +- doc/DrawFocHlt.3 | 2 +- doc/EventHndlr.3 | 2 +- doc/FindPhoto.3 | 2 +- doc/FreeXId.3 | 2 +- doc/GeomReq.3 | 2 +- doc/GetAnchor.3 | 2 +- doc/GetBitmap.3 | 2 +- doc/GetCapStyl.3 | 2 +- doc/GetClrmap.3 | 2 +- doc/GetDash.3 | 2 +- doc/GetGC.3 | 2 +- doc/GetHINSTANCE.3 | 2 +- doc/GetHWND.3 | 2 +- doc/GetImage.3 | 2 +- doc/GetJoinStl.3 | 2 +- doc/GetJustify.3 | 2 +- doc/GetOption.3 | 2 +- doc/GetPixels.3 | 2 +- doc/GetPixmap.3 | 2 +- doc/GetRelief.3 | 2 +- doc/GetRootCrd.3 | 2 +- doc/GetScroll.3 | 2 +- doc/GetSelect.3 | 2 +- doc/GetUid.3 | 2 +- doc/GetVRoot.3 | 2 +- doc/GetVisual.3 | 2 +- doc/Grab.3 | 2 +- doc/HWNDToWindow.3 | 2 +- doc/HandleEvent.3 | 2 +- doc/IdToWindow.3 | 2 +- doc/ImgChanged.3 | 2 +- doc/Inactive.3 | 2 +- doc/InternAtom.3 | 2 +- doc/MainLoop.3 | 2 +- doc/MainWin.3 | 2 +- doc/MaintGeom.3 | 2 +- doc/ManageGeom.3 | 2 +- doc/MoveToplev.3 | 2 +- doc/Name.3 | 2 +- doc/NameOfImg.3 | 2 +- doc/OwnSelect.3 | 2 +- doc/ParseArgv.3 | 2 +- doc/QWinEvent.3 | 2 +- doc/Restack.3 | 2 +- doc/RestrictEv.3 | 2 +- doc/SetAppName.3 | 2 +- doc/SetCaret.3 | 2 +- doc/SetClass.3 | 2 +- doc/SetClassProcs.3 | 2 +- doc/SetGrid.3 | 2 +- doc/SetOptions.3 | 2 +- doc/SetVisual.3 | 2 +- doc/StrictMotif.3 | 2 +- doc/TkInitStubs.3 | 2 +- doc/Tk_Init.3 | 2 +- doc/bell.n | 2 +- doc/bind.n | 2 +- doc/bindtags.n | 2 +- doc/bitmap.n | 2 +- doc/chooseColor.n | 2 +- doc/console.n | 2 +- doc/cursors.n | 4 ++-- doc/destroy.n | 2 +- doc/dialog.n | 2 +- doc/entry.n | 2 +- doc/focus.n | 2 +- doc/focusNext.n | 2 +- doc/fontchooser.n | 2 +- doc/frame.n | 2 +- doc/grab.n | 2 +- doc/grid.n | 2 +- doc/image.n | 2 +- doc/label.n | 2 +- doc/lower.n | 2 +- doc/menubar.n | 2 +- doc/menubutton.n | 2 +- doc/message.n | 2 +- doc/option.n | 2 +- doc/optionMenu.n | 2 +- doc/pack-old.n | 2 +- doc/pack.n | 2 +- doc/palette.n | 2 +- doc/photo.n | 2 +- doc/place.n | 2 +- doc/popup.n | 2 +- doc/raise.n | 2 +- doc/scrollbar.n | 2 +- doc/send.n | 2 +- doc/spinbox.n | 2 +- doc/text.n | 2 +- doc/tk.n | 2 +- doc/tk_mac.n | 2 +- doc/tkvars.n | 2 +- doc/tkwait.n | 2 +- doc/toplevel.n | 2 +- doc/ttk_Theme.3 | 2 +- doc/ttk_sizegrip.n | 2 +- doc/winfo.n | 2 +- doc/wish.1 | 4 ++-- 116 files changed, 118 insertions(+), 118 deletions(-) diff --git a/doc/3DBorder.3 b/doc/3DBorder.3 index f2f0eb8..f589e66 100644 --- a/doc/3DBorder.3 +++ b/doc/3DBorder.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_Alloc3DBorderFromObj 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/BindTable.3 b/doc/BindTable.3 index 5130bfc..772f39f 100644 --- a/doc/BindTable.3 +++ b/doc/BindTable.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_CreateBindingTable 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/CanvPsY.3 b/doc/CanvPsY.3 index 5e104ce..f789d3c 100644 --- a/doc/CanvPsY.3 +++ b/doc/CanvPsY.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_CanvasPs 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/CanvTkwin.3 b/doc/CanvTkwin.3 index d53c5b1..6ae3d97 100644 --- a/doc/CanvTkwin.3 +++ b/doc/CanvTkwin.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_CanvasTkwin 3 4.1 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/CanvTxtInfo.3 b/doc/CanvTxtInfo.3 index 92a2bc3..1dd2354 100644 --- a/doc/CanvTxtInfo.3 +++ b/doc/CanvTxtInfo.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_CanvasTextInfo 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/Clipboard.3 b/doc/Clipboard.3 index 3087777..cc09018 100644 --- a/doc/Clipboard.3 +++ b/doc/Clipboard.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_ClipboardClear 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/ClrSelect.3 b/doc/ClrSelect.3 index c56f63c..1b942b5 100644 --- a/doc/ClrSelect.3 +++ b/doc/ClrSelect.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_ClearSelection 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/ConfigWind.3 b/doc/ConfigWind.3 index 7c7adab..3e83387 100644 --- a/doc/ConfigWind.3 +++ b/doc/ConfigWind.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_ConfigureWindow 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/CoordToWin.3 b/doc/CoordToWin.3 index 5fe96a6..1ebd681 100644 --- a/doc/CoordToWin.3 +++ b/doc/CoordToWin.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_CoordsToWindow 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/CrtCmHdlr.3 b/doc/CrtCmHdlr.3 index 98b93f7..01c3852 100644 --- a/doc/CrtCmHdlr.3 +++ b/doc/CrtCmHdlr.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_CreateClientMessageHandler 3 "8.4" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/CrtConsoleChan.3 b/doc/CrtConsoleChan.3 index 7fd8a6a..d8e0740 100644 --- a/doc/CrtConsoleChan.3 +++ b/doc/CrtConsoleChan.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_InitConsoleChannels 3 8.5 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/CrtErrHdlr.3 b/doc/CrtErrHdlr.3 index e506220..e6ebafe 100644 --- a/doc/CrtErrHdlr.3 +++ b/doc/CrtErrHdlr.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_CreateErrorHandler 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/CrtGenHdlr.3 b/doc/CrtGenHdlr.3 index c2161d1..c2aac03 100644 --- a/doc/CrtGenHdlr.3 +++ b/doc/CrtGenHdlr.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_CreateGenericHandler 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/CrtImgType.3 b/doc/CrtImgType.3 index cbbc11e..4949c50 100644 --- a/doc/CrtImgType.3 +++ b/doc/CrtImgType.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_CreateImageType 3 8.5 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/CrtItemType.3 b/doc/CrtItemType.3 index 005d2e2..f9198f3 100644 --- a/doc/CrtItemType.3 +++ b/doc/CrtItemType.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_CreateItemType 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/CrtPhImgFmt.3 b/doc/CrtPhImgFmt.3 index c7e792a..92f2441 100644 --- a/doc/CrtPhImgFmt.3 +++ b/doc/CrtPhImgFmt.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" '\" Author: Paul Mackerras (paulus@cs.anu.edu.au), '\" Department of Computer Science, '\" Australian National University. diff --git a/doc/DeleteImg.3 b/doc/DeleteImg.3 index 507be72..eb6db1e 100644 --- a/doc/DeleteImg.3 +++ b/doc/DeleteImg.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_DeleteImage 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/DrawFocHlt.3 b/doc/DrawFocHlt.3 index e2d1578..59cd069 100644 --- a/doc/DrawFocHlt.3 +++ b/doc/DrawFocHlt.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_DrawFocusHighlight 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/EventHndlr.3 b/doc/EventHndlr.3 index 97857fb..8c47e78 100644 --- a/doc/EventHndlr.3 +++ b/doc/EventHndlr.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_CreateEventHandler 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/FindPhoto.3 b/doc/FindPhoto.3 index d6ccb5b..3ce3a21 100644 --- a/doc/FindPhoto.3 +++ b/doc/FindPhoto.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" '\" Author: Paul Mackerras (paulus@cs.anu.edu.au), '\" Department of Computer Science, '\" Australian National University. diff --git a/doc/FreeXId.3 b/doc/FreeXId.3 index dd1d141..56c7804 100644 --- a/doc/FreeXId.3 +++ b/doc/FreeXId.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_FreeXId 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GeomReq.3 b/doc/GeomReq.3 index 895f683..7670521 100644 --- a/doc/GeomReq.3 +++ b/doc/GeomReq.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GeometryRequest 3 "8.4" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetAnchor.3 b/doc/GetAnchor.3 index 6526772..5d41ad6 100644 --- a/doc/GetAnchor.3 +++ b/doc/GetAnchor.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetAnchorFromObj 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetBitmap.3 b/doc/GetBitmap.3 index c4ac44e..88418c7 100644 --- a/doc/GetBitmap.3 +++ b/doc/GetBitmap.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_AllocBitmapFromObj 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetCapStyl.3 b/doc/GetCapStyl.3 index 28f1a1c..4e5d1d5 100644 --- a/doc/GetCapStyl.3 +++ b/doc/GetCapStyl.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetCapStyle 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetClrmap.3 b/doc/GetClrmap.3 index 9e6da12..4b72b6c 100644 --- a/doc/GetClrmap.3 +++ b/doc/GetClrmap.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetColormap 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetDash.3 b/doc/GetDash.3 index d1eeb70..2087424 100644 --- a/doc/GetDash.3 +++ b/doc/GetDash.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetDash 3 8.3 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetGC.3 b/doc/GetGC.3 index 44e06fb..6ee63a9 100644 --- a/doc/GetGC.3 +++ b/doc/GetGC.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetGC 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetHINSTANCE.3 b/doc/GetHINSTANCE.3 index de38051..980b374 100644 --- a/doc/GetHINSTANCE.3 +++ b/doc/GetHINSTANCE.3 @@ -1,7 +1,7 @@ '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" .TH Tk_GetHISTANCE 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetHWND.3 b/doc/GetHWND.3 index 1a5ec2d..15d2ff0 100644 --- a/doc/GetHWND.3 +++ b/doc/GetHWND.3 @@ -1,7 +1,7 @@ '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" .TH HWND 3 8.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetImage.3 b/doc/GetImage.3 index f2407bc..744f9ac 100644 --- a/doc/GetImage.3 +++ b/doc/GetImage.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetImage 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetJoinStl.3 b/doc/GetJoinStl.3 index a717b72..616719c 100644 --- a/doc/GetJoinStl.3 +++ b/doc/GetJoinStl.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetJoinStyle 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetJustify.3 b/doc/GetJustify.3 index b51cb8d..2e871cb 100644 --- a/doc/GetJustify.3 +++ b/doc/GetJustify.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetJustifyFromObj 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetOption.3 b/doc/GetOption.3 index 81846ad..799786d 100644 --- a/doc/GetOption.3 +++ b/doc/GetOption.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetOption 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetPixels.3 b/doc/GetPixels.3 index e7a9043..6c31af9 100644 --- a/doc/GetPixels.3 +++ b/doc/GetPixels.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetPixelsFromObj 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetPixmap.3 b/doc/GetPixmap.3 index 927c75c..65fae2d 100644 --- a/doc/GetPixmap.3 +++ b/doc/GetPixmap.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetPixmap 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetRelief.3 b/doc/GetRelief.3 index 6e8681a..5979662 100644 --- a/doc/GetRelief.3 +++ b/doc/GetRelief.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetReliefFromObj 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetRootCrd.3 b/doc/GetRootCrd.3 index a9d2cd9..20520ea 100644 --- a/doc/GetRootCrd.3 +++ b/doc/GetRootCrd.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetRootCoords 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetScroll.3 b/doc/GetScroll.3 index abd0880..70145aa 100644 --- a/doc/GetScroll.3 +++ b/doc/GetScroll.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetScrollInfo 3 8.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetSelect.3 b/doc/GetSelect.3 index 8c30a2b..11e837e 100644 --- a/doc/GetSelect.3 +++ b/doc/GetSelect.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetSelection 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetUid.3 b/doc/GetUid.3 index 06b466a..2cd95ad 100644 --- a/doc/GetUid.3 +++ b/doc/GetUid.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetUid 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetVRoot.3 b/doc/GetVRoot.3 index a65ef78..7e6003a 100644 --- a/doc/GetVRoot.3 +++ b/doc/GetVRoot.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetVRootGeometry 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/GetVisual.3 b/doc/GetVisual.3 index fe3d50c..fc6b6f8 100644 --- a/doc/GetVisual.3 +++ b/doc/GetVisual.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_GetVisual 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/Grab.3 b/doc/Grab.3 index 1dba2df..2741220 100644 --- a/doc/Grab.3 +++ b/doc/Grab.3 @@ -1,7 +1,7 @@ '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" .TH Tk_Grab 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/HWNDToWindow.3 b/doc/HWNDToWindow.3 index 9795099..a2e5a6c 100644 --- a/doc/HWNDToWindow.3 +++ b/doc/HWNDToWindow.3 @@ -1,7 +1,7 @@ '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" .TH Tk_HWNDToWindow 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/HandleEvent.3 b/doc/HandleEvent.3 index bc293b6..f3072de 100644 --- a/doc/HandleEvent.3 +++ b/doc/HandleEvent.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_HandleEvent 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/IdToWindow.3 b/doc/IdToWindow.3 index f6e397d..f8ce1f9 100644 --- a/doc/IdToWindow.3 +++ b/doc/IdToWindow.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_IdToWindow 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/ImgChanged.3 b/doc/ImgChanged.3 index f4d2c04..ccf0c11 100644 --- a/doc/ImgChanged.3 +++ b/doc/ImgChanged.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_ImageChanged 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/Inactive.3 b/doc/Inactive.3 index 5528fa5..d0fccf1 100644 --- a/doc/Inactive.3 +++ b/doc/Inactive.3 @@ -1,7 +1,7 @@ '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" .TH Tk_GetUserInactiveTime 3 8.5 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/InternAtom.3 b/doc/InternAtom.3 index a16eee1..e6756a5 100644 --- a/doc/InternAtom.3 +++ b/doc/InternAtom.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_InternAtom 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/MainLoop.3 b/doc/MainLoop.3 index ed4d0ea..770f254 100644 --- a/doc/MainLoop.3 +++ b/doc/MainLoop.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_MainLoop 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/MainWin.3 b/doc/MainWin.3 index c3af3e7..94bd7e2 100644 --- a/doc/MainWin.3 +++ b/doc/MainWin.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_MainWindow 3 7.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/MaintGeom.3 b/doc/MaintGeom.3 index d1c2d1c..b34e797 100644 --- a/doc/MaintGeom.3 +++ b/doc/MaintGeom.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_MaintainGeometry 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/ManageGeom.3 b/doc/ManageGeom.3 index 520546f..ba12aca 100644 --- a/doc/ManageGeom.3 +++ b/doc/ManageGeom.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_ManageGeometry 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/MoveToplev.3 b/doc/MoveToplev.3 index effed29..20ff120 100644 --- a/doc/MoveToplev.3 +++ b/doc/MoveToplev.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_MoveToplevelWindow 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/Name.3 b/doc/Name.3 index 4b9c5bc..1653cf5 100644 --- a/doc/Name.3 +++ b/doc/Name.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_Name 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/NameOfImg.3 b/doc/NameOfImg.3 index 78332db..38c7ca9 100644 --- a/doc/NameOfImg.3 +++ b/doc/NameOfImg.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_NameOfImage 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/OwnSelect.3 b/doc/OwnSelect.3 index ed9bcab..0e16eac 100644 --- a/doc/OwnSelect.3 +++ b/doc/OwnSelect.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_OwnSelection 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/ParseArgv.3 b/doc/ParseArgv.3 index 3a9bd49..b6362bd 100644 --- a/doc/ParseArgv.3 +++ b/doc/ParseArgv.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_ParseArgv 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/QWinEvent.3 b/doc/QWinEvent.3 index caa5026..9c43ce5 100644 --- a/doc/QWinEvent.3 +++ b/doc/QWinEvent.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_QueueWindowEvent 3 7.5 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/Restack.3 b/doc/Restack.3 index 2b9097f..5cd02eb 100644 --- a/doc/Restack.3 +++ b/doc/Restack.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_RestackWindow 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/RestrictEv.3 b/doc/RestrictEv.3 index eb1f040..103a80b 100644 --- a/doc/RestrictEv.3 +++ b/doc/RestrictEv.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_RestrictEvents 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/SetAppName.3 b/doc/SetAppName.3 index 3978850..91516a0 100644 --- a/doc/SetAppName.3 +++ b/doc/SetAppName.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_SetAppName 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/SetCaret.3 b/doc/SetCaret.3 index fd63f18..24cc18c 100644 --- a/doc/SetCaret.3 +++ b/doc/SetCaret.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_SetCaretPos 3 8.4 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/SetClass.3 b/doc/SetClass.3 index 707975d..0ea81bb 100644 --- a/doc/SetClass.3 +++ b/doc/SetClass.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_SetClass 3 "" Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/SetClassProcs.3 b/doc/SetClassProcs.3 index 58618da..a2af479 100644 --- a/doc/SetClassProcs.3 +++ b/doc/SetClassProcs.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_SetClassProcs 3 8.4 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/SetGrid.3 b/doc/SetGrid.3 index 28e428b..ea32afb 100644 --- a/doc/SetGrid.3 +++ b/doc/SetGrid.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_SetGrid 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/SetOptions.3 b/doc/SetOptions.3 index b5f0782..581b1e6 100644 --- a/doc/SetOptions.3 +++ b/doc/SetOptions.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_SetOptions 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/SetVisual.3 b/doc/SetVisual.3 index 6d3fd83..a5b9efd 100644 --- a/doc/SetVisual.3 +++ b/doc/SetVisual.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_SetWindowVisual 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/StrictMotif.3 b/doc/StrictMotif.3 index 4319d53..ec9319f 100644 --- a/doc/StrictMotif.3 +++ b/doc/StrictMotif.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_StrictMotif 3 4.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/TkInitStubs.3 b/doc/TkInitStubs.3 index 04f5611..57ec9e6 100644 --- a/doc/TkInitStubs.3 +++ b/doc/TkInitStubs.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_InitStubs 3 8.4 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/Tk_Init.3 b/doc/Tk_Init.3 index 7bc46dd..fc29318 100644 --- a/doc/Tk_Init.3 +++ b/doc/Tk_Init.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tk_Init 3 8.0 Tk "Tk Library Procedures" .so man.macros .BS diff --git a/doc/bell.n b/doc/bell.n index 21c4f1b..3e8d112 100644 --- a/doc/bell.n +++ b/doc/bell.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH bell n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/bind.n b/doc/bind.n index d189376..ab02396 100644 --- a/doc/bind.n +++ b/doc/bind.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH bind n 8.0 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/bindtags.n b/doc/bindtags.n index dc3973b..51c2ca9 100644 --- a/doc/bindtags.n +++ b/doc/bindtags.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH bindtags n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/bitmap.n b/doc/bitmap.n index ead3311..1751913 100644 --- a/doc/bitmap.n +++ b/doc/bitmap.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH bitmap n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/chooseColor.n b/doc/chooseColor.n index 015b17d..3fa6de3 100644 --- a/doc/chooseColor.n +++ b/doc/chooseColor.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tk_chooseColor n 4.2 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/console.n b/doc/console.n index 1313d3a..d4d8a74 100644 --- a/doc/console.n +++ b/doc/console.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH console n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/cursors.n b/doc/cursors.n index 1662de4..a728755 100644 --- a/doc/cursors.n +++ b/doc/cursors.n @@ -1,9 +1,9 @@ '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" '\" Copyright (c) 2006-2007 Daniel A. Steffen -'\" +'\" .TH cursors n 8.3 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/destroy.n b/doc/destroy.n index 3d4743a..b10c679 100644 --- a/doc/destroy.n +++ b/doc/destroy.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH destroy n "" Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/dialog.n b/doc/dialog.n index d2031d3..e4938d2 100644 --- a/doc/dialog.n +++ b/doc/dialog.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tk_dialog n 4.1 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/entry.n b/doc/entry.n index ccfcd24..40b45c7 100644 --- a/doc/entry.n +++ b/doc/entry.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH entry n 8.3 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/focus.n b/doc/focus.n index 4b8bb2a..e3efcd3 100644 --- a/doc/focus.n +++ b/doc/focus.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH focus n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/focusNext.n b/doc/focusNext.n index ffcf971..3283d4b 100644 --- a/doc/focusNext.n +++ b/doc/focusNext.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tk_focusNext n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/fontchooser.n b/doc/fontchooser.n index bdd51c7..65aa8e7 100644 --- a/doc/fontchooser.n +++ b/doc/fontchooser.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH fontchooser n "" Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/frame.n b/doc/frame.n index 72a22db..6aa412e 100644 --- a/doc/frame.n +++ b/doc/frame.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH frame n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/grab.n b/doc/grab.n index a6d0d19..9288e90 100644 --- a/doc/grab.n +++ b/doc/grab.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH grab n "" Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/grid.n b/doc/grid.n index 9ac84d9..07d07aa 100644 --- a/doc/grid.n +++ b/doc/grid.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH grid n 8.5 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/image.n b/doc/image.n index fd51cc0..70f5acf 100644 --- a/doc/image.n +++ b/doc/image.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH image n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/label.n b/doc/label.n index f2ba88c..107175e 100644 --- a/doc/label.n +++ b/doc/label.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH label n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/lower.n b/doc/lower.n index 8159a8b..d0b0551 100644 --- a/doc/lower.n +++ b/doc/lower.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH lower n 3.3 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/menubar.n b/doc/menubar.n index 023bf37..c3be85d 100644 --- a/doc/menubar.n +++ b/doc/menubar.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tk_menuBar n "" Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/menubutton.n b/doc/menubutton.n index 08b52a0..1f596ce 100644 --- a/doc/menubutton.n +++ b/doc/menubutton.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH menubutton n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/message.n b/doc/message.n index bd635ac..280c072 100644 --- a/doc/message.n +++ b/doc/message.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH message n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/option.n b/doc/option.n index 2763d64..6042010 100644 --- a/doc/option.n +++ b/doc/option.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH option n "" Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/optionMenu.n b/doc/optionMenu.n index 42275ce..eff6e86 100644 --- a/doc/optionMenu.n +++ b/doc/optionMenu.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tk_optionMenu n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/pack-old.n b/doc/pack-old.n index 217dba9..5ef5da1 100644 --- a/doc/pack-old.n +++ b/doc/pack-old.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH pack-old n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/pack.n b/doc/pack.n index 538af62..6b39e1d 100644 --- a/doc/pack.n +++ b/doc/pack.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH pack n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/palette.n b/doc/palette.n index 085c4c6..6a04450 100644 --- a/doc/palette.n +++ b/doc/palette.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tk_setPalette n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/photo.n b/doc/photo.n index 0fe0c61..84cf618 100644 --- a/doc/photo.n +++ b/doc/photo.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" '\" Author: Paul Mackerras (paulus@cs.anu.edu.au), '\" Department of Computer Science, '\" Australian National University. diff --git a/doc/place.n b/doc/place.n index 3a092c2..3ebaf20 100644 --- a/doc/place.n +++ b/doc/place.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH place n "" Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/popup.n b/doc/popup.n index 0d32362..6e6fd95 100644 --- a/doc/popup.n +++ b/doc/popup.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tk_popup n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/raise.n b/doc/raise.n index be20c74..0983ed2 100644 --- a/doc/raise.n +++ b/doc/raise.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH raise n 3.3 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/scrollbar.n b/doc/scrollbar.n index 4d148af..4b1d4ba 100644 --- a/doc/scrollbar.n +++ b/doc/scrollbar.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH scrollbar n 4.1 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/send.n b/doc/send.n index 2a683d5..e33a504 100644 --- a/doc/send.n +++ b/doc/send.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH send n 4.0 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/spinbox.n b/doc/spinbox.n index e030aa3..2f7e6bd 100644 --- a/doc/spinbox.n +++ b/doc/spinbox.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH spinbox n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/text.n b/doc/text.n index ac7803c..6266a04 100644 --- a/doc/text.n +++ b/doc/text.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH text n 8.5 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/tk.n b/doc/tk.n index 1165b67..43ce64d 100644 --- a/doc/tk.n +++ b/doc/tk.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tk n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/tk_mac.n b/doc/tk_mac.n index f29ef2f..a1ad758 100644 --- a/doc/tk_mac.n +++ b/doc/tk_mac.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tk::mac n 8.6 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/tkvars.n b/doc/tkvars.n index a80fd54..f872d1f 100644 --- a/doc/tkvars.n +++ b/doc/tkvars.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tkvars n 4.1 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/tkwait.n b/doc/tkwait.n index a31aee7..82d51ba 100644 --- a/doc/tkwait.n +++ b/doc/tkwait.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tkwait n "" Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/toplevel.n b/doc/toplevel.n index 271d9f1..31f241c 100644 --- a/doc/toplevel.n +++ b/doc/toplevel.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH toplevel n 8.4 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/ttk_Theme.3 b/doc/ttk_Theme.3 index 8031b8a..a42dd38 100644 --- a/doc/ttk_Theme.3 +++ b/doc/ttk_Theme.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Ttk_CreateTheme 3 8.5 Tk "Tk Themed Widget" .so man.macros .BS diff --git a/doc/ttk_sizegrip.n b/doc/ttk_sizegrip.n index 8b3429e..64d3ef6 100644 --- a/doc/ttk_sizegrip.n +++ b/doc/ttk_sizegrip.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH ttk::sizegrip n 8.5 Tk "Tk Themed Widget" .so man.macros .BS diff --git a/doc/winfo.n b/doc/winfo.n index 5008448..bff4973 100644 --- a/doc/winfo.n +++ b/doc/winfo.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH winfo n 4.3 Tk "Tk Built-In Commands" .so man.macros .BS diff --git a/doc/wish.1 b/doc/wish.1 index 93ade0d..f7d97d9 100644 --- a/doc/wish.1 +++ b/doc/wish.1 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH wish 1 8.0 Tk "Tk Applications" .so man.macros .BS @@ -77,7 +77,7 @@ If there exists a file in the home directory of the user, \fBwish\fR evaluates the file as a Tcl script just before reading the first command from standard input. .PP -If arguments to \fBwish\fR do specify a \fIfileName\fR, then +If arguments to \fBwish\fR do specify a \fIfileName\fR, then \fIfileName\fR is treated as the name of a script file. \fBWish\fR will evaluate the script in \fIfileName\fR (which presumably creates a user interface), then it will respond to events -- cgit v0.12 From 1602f4eea94987af0c6a3bb0c68f62b9967acf1b Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 13 Mar 2016 21:55:59 +0000 Subject: Fixed bug [487861ffff] - cascade with -accelerator looks wrong --- win/tkWinMenu.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 4593928..8eede75 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -155,7 +155,7 @@ static void DrawWindowsSystemBitmap(Display *display, Drawable drawable, GC gc, const RECT *rectPtr, int bitmapID, int alignFlags); static void FreeID(WORD commandID); -static char * GetEntryText(TkMenuEntry *mePtr); +static char * GetEntryText(TkMenu *menuPtr, TkMenuEntry *mePtr); static void GetMenuAccelGeometry(TkMenu *menuPtr, TkMenuEntry *mePtr, Tk_Font tkfont, const Tk_FontMetrics *fmPtr, int *widthPtr, @@ -486,6 +486,7 @@ TkpDestroyMenuEntry( static char * GetEntryText( + TkMenu *menuPtr, /* The menu considered. */ TkMenuEntry *mePtr) /* A pointer to the menu entry. */ { char *itemText; @@ -506,7 +507,7 @@ GetEntryText( int i; const char *label = (mePtr->labelPtr == NULL) ? "" : Tcl_GetString(mePtr->labelPtr); - const char *accel = (mePtr->accelPtr == NULL) ? "" + const char *accel = ((menuPtr->menuType == MENUBAR) || (mePtr->accelPtr == NULL)) ? "" : Tcl_GetString(mePtr->accelPtr); const char *p, *next; Tcl_DString itemString; @@ -605,7 +606,7 @@ ReconfigureWindowsMenu( continue; } - itemText = GetEntryText(mePtr); + itemText = GetEntryText(menuPtr, mePtr); if ((menuPtr->menuType == MENUBAR) || (menuPtr->menuFlags & MENU_SYSTEM_MENU)) { Tcl_WinUtfToTChar(itemText, -1, &translatedText); @@ -1502,12 +1503,12 @@ GetMenuAccelGeometry( *heightPtr = fmPtr->linespace; if (mePtr->type == CASCADE_ENTRY) { *widthPtr = 0; - } else if (mePtr->accelPtr == NULL) { - *widthPtr = 0; - } else { + } else if ((menuPtr->menuType != MENUBAR) && (mePtr->accelPtr != NULL)) { const char *accel = Tcl_GetString(mePtr->accelPtr); *widthPtr = Tk_TextWidth(tkfont, accel, mePtr->accelLength); + } else { + *widthPtr = 0; } } @@ -1763,6 +1764,10 @@ DrawMenuEntryAccelerator( int leftEdge = x + mePtr->indicatorSpace + mePtr->labelWidth; const char *accel; + if (menuPtr->menuType == MENUBAR) { + return; + } + if (mePtr->accelPtr != NULL) { accel = Tcl_GetString(mePtr->accelPtr); } else { -- cgit v0.12 From 6669e94c070680392a0e8c77203e45084d9c09d0 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 Mar 2016 13:31:25 +0000 Subject: Excess spacing in test-suite --- tests/bell.test | 2 +- tests/bind.test | 312 ++++++++++++++++++++++----------------------- tests/bitmap.test | 6 +- tests/border.test | 22 ++-- tests/button.test | 182 +++++++++++++------------- tests/canvImg.test | 10 +- tests/canvMoveto.test | 2 +- tests/canvRect.test | 12 +- tests/canvas.test | 12 +- tests/clipboard.test | 2 +- tests/clrpick.test | 2 +- tests/cmds.test | 2 +- tests/color.test | 2 +- tests/config.test | 34 ++--- tests/cursor.test | 2 +- tests/entry.test | 304 +++++++++++++++++++++---------------------- tests/event.test | 8 +- tests/filebox.test | 2 +- tests/focus.test | 22 ++-- tests/font.test | 172 ++++++++++++------------- tests/frame.test | 8 +- tests/geometry.test | 2 +- tests/image.test | 40 +++--- tests/imgPhoto.test | 42 +++--- tests/listbox.test | 8 +- tests/main.test | 2 +- tests/menu.test | 72 +++++------ tests/menuDraw.test | 12 +- tests/menubut.test | 18 +-- tests/message.test | 106 +++++++-------- tests/msgbox.test | 90 ++++++------- tests/option.file1 | 2 +- tests/option.file3 | 2 +- tests/option.test | 2 +- tests/pack.test | 2 +- tests/panedwindow.test | 116 ++++++++--------- tests/place.test | 2 +- tests/raise.test | 6 +- tests/safe.test | 6 +- tests/scale.test | 2 +- tests/scrollbar.test | 20 +-- tests/select.test | 8 +- tests/send.test | 4 +- tests/spinbox.test | 306 ++++++++++++++++++++++---------------------- tests/text.test | 52 ++++---- tests/textDisp.test | 14 +- tests/textImage.test | 14 +- tests/textIndex.test | 20 +-- tests/textMark.test | 2 +- tests/textTag.test | 228 ++++++++++++++++----------------- tests/textWind.test | 2 +- tests/ttk/combobox.test | 2 +- tests/ttk/image.test | 2 +- tests/ttk/labelframe.test | 2 +- tests/ttk/panedwindow.test | 6 +- tests/ttk/scrollbar.test | 8 +- tests/ttk/spinbox.test | 4 +- tests/ttk/treetags.test | 6 +- tests/ttk/ttk.test | 2 +- tests/ttk/validate.test | 2 +- tests/unixButton.test | 14 +- tests/unixEmbed.test | 38 +++--- tests/unixFont.test | 6 +- tests/unixMenu.test | 156 +++++++++++------------ tests/unixWm.test | 8 +- tests/visual_bb.test | 12 +- tests/winDialog.test | 12 +- tests/winFont.test | 22 ++-- tests/winMenu.test | 6 +- tests/winWm.test | 6 +- 70 files changed, 1318 insertions(+), 1318 deletions(-) diff --git a/tests/bell.test b/tests/bell.test index 4f7df97..bbafeac 100644 --- a/tests/bell.test +++ b/tests/bell.test @@ -15,7 +15,7 @@ test bell-1.1 {bell command} -body { } -returnCodes {error} -result {bad option "a": must be -displayof or -nice} test bell-1.2 {bell command} -body { - bell a b + bell a b } -returnCodes {error} -result {bad option "a": must be -displayof or -nice} test bell-1.3 {bell command} -body { diff --git a/tests/bind.test b/tests/bind.test index 474771d..f38f03c 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -69,10 +69,10 @@ test bind-1.7 {bind command} -body { } -result {test script more text} test bind-1.8 {bind command} -body { - bind .t {test script} + bind .t {test script} } -returnCodes error -result {bad event type or keysym "gorp"} test bind-1.9 {bind command} -body { - catch {bind .t {test script}} + catch {bind .t {test script}} bind .t } -result {} test bind-1.10 {bind command} -body { @@ -133,10 +133,10 @@ test bind-2.8 {bindtags command} -body { test bind-2.9 {bindtags command} -body { frame .t.f bindtags .t.f {a b c} - bindtags .t.f "\{" + bindtags .t.f "\{" } -cleanup { destroy .t.f -} -returnCodes error -result {unmatched open brace in list} +} -returnCodes error -result {unmatched open brace in list} test bind-2.10 {bindtags command} -body { frame .t.f bindtags .t.f {a b c} @@ -148,10 +148,10 @@ test bind-2.10 {bindtags command} -body { test bind-2.11 {bindtags command} -body { frame .t.f bindtags .t.f {a b c} - bindtags .t.f "a .gorp b" + bindtags .t.f "a .gorp b" } -cleanup { destroy .t.f -} -returnCodes ok +} -returnCodes ok test bind-2.12 {bindtags command} -body { frame .t.f bindtags .t.f {a b c} @@ -191,7 +191,7 @@ test bind-4.1 {TkBindEventProc procedure} -setup { bind {a b} {lappend x "%W enter {a b}"} bind .t {lappend x "%W enter .t"} bind .t.f {lappend x "%W enter .t.f"} - + event generate .t.f return $x } -cleanup { @@ -211,9 +211,9 @@ test bind-4.2 {TkBindEventProc procedure} -setup { bind {a b} {lappend x "%W enter {a b}"} bind .t {lappend x "%W enter .t"} bind .t.f {lappend x "%W enter .t.f"} - + bindtags .t.f {.t.f {a b} xyz} - event generate .t.f + event generate .t.f return $x } -cleanup { destroy .t.f @@ -227,7 +227,7 @@ test bind-4.3 {TkBindEventProc procedure} -body { bind xyz {lappend x "%W enter xyz"} bind {a b} {lappend x "%W enter {a b}"} bind .t {lappend x "%W enter .t"} - + event generate .t return $x } -cleanup { @@ -247,7 +247,7 @@ test bind-4.4 {TkBindEventProc procedure} -setup { bind xyz {lappend x "%W enter xyz"} bind {a b} {lappend x "%W enter {a b}"} bind .t {lappend x "%W enter .t"} - + bindtags .t.f {.t.f .t.f2 .t.f3} bind .t.f {lappend x "%W enter .t.f"} bind .t.f3 {lappend x "%W enter .t.f3"} @@ -271,7 +271,7 @@ test bind-4.5 {TkBindEventProc procedure} -setup { bind {a b} {lappend x "%W enter {a b}"} bind .t {lappend x "%W enter .t"} bindtags .t.f {a b c d e f g h i j k l m n o p q r s t u v w x y z} - + event generate .t.f } -cleanup { destroy .t.f @@ -375,7 +375,7 @@ test bind-10.2 {Tk_GetBinding procedure} -body { } -result {Test} test bind-11.1 {Tk_GetAllBindings procedure} -body { - frame .t.f + frame .t.f foreach i "! a \\\{ ~ <> " { bind .t.f $i Test } @@ -384,7 +384,7 @@ test bind-11.1 {Tk_GetAllBindings procedure} -body { destroy .t.f } -result {! <> a \{ ~} test bind-11.2 {Tk_GetAllBindings procedure} -body { - frame .t.f + frame .t.f foreach i " <1>" { bind .t.f $i Test } @@ -393,7 +393,7 @@ test bind-11.2 {Tk_GetAllBindings procedure} -body { destroy .t.f } -result { } test bind-11.3 {Tk_GetAllBindings procedure} -body { - frame .t.f + frame .t.f foreach i " abcd ab" { bind .t.f $i Test } @@ -427,7 +427,7 @@ test bind-13.1 {Tk_BindEvent procedure} -setup { bind Test : {lappend x "%W %K Test :"} bind all _ {lappend x "%W %K all _"} bind .t.f : {lappend x "%W %K .t.f :"} - + event generate .t.f event generate .t.f event generate .t.f @@ -450,7 +450,7 @@ test bind-13.2 {Tk_BindEvent procedure} -setup { bind Test {lappend x "%W %K Test press any"; break} bind all {continue; lappend x "%W %K all press any"} bind .t.f : {lappend x "%W %K .t.f pressed colon"} - + event generate .t.f return $x } -cleanup { @@ -506,11 +506,11 @@ test bind-13.5 {Tk_BindEvent procedure} -body { frame .t.g -gorp foo } -cleanup { bind all {} -} -returnCodes error -result {unknown option "-gorp"} +} -returnCodes error -result {unknown option "-gorp"} test bind-13.6 {Tk_BindEvent procedure} -body { bind all {lappend x "%W destroyed"} set x {} - catch {frame .t.g -gorp foo} + catch {frame .t.g -gorp foo} return $x } -cleanup { bind all {} @@ -591,10 +591,10 @@ test bind-13.11 {Tk_BindEvent procedure: collapse Motions} -setup { set x {} } -body { bind .t.f "lappend x Motion%#(%x,%y)" - event generate .t.f -serial 100 -x 100 -y 200 -when tail + event generate .t.f -serial 100 -x 100 -y 200 -when tail update event generate .t.f -serial 101 -x 200 -y 300 -when tail - event generate .t.f -serial 102 -x 300 -y 400 -when tail + event generate .t.f -serial 102 -x 300 -y 400 -when tail update return $x } -cleanup { @@ -608,10 +608,10 @@ test bind-13.12 {Tk_BindEvent procedure: collapse repeating modifiers} -setup { } -body { bind .t.f "lappend x %K%#" bind .t.f "lappend x %K%#" - event generate .t.f -serial 100 -when tail - event generate .t.f -serial 101 -when tail - event generate .t.f -serial 102 -when tail - event generate .t.f -serial 103 -when tail + event generate .t.f -serial 100 -when tail + event generate .t.f -serial 101 -when tail + event generate .t.f -serial 102 -when tail + event generate .t.f -serial 103 -when tail update } -cleanup { destroy .t.f @@ -847,7 +847,7 @@ test bind-13.27 {Tk_BindEvent procedure: no detail virtual pattern list} -setup set x {} } -body { bind .t.f {set x Button-2} - event generate .t.f + event generate .t.f return $x } -cleanup { destroy .t.f @@ -1011,7 +1011,7 @@ test bind-13.43 {Tk_BindEvent procedure: break in script} -setup { } -result {b1} test bind-13.45 {Tk_BindEvent procedure: error in script} -setup { proc bgerror msg { - global x + global x lappend x $msg } frame .t.f -class Test -width 150 -height 100 @@ -1200,7 +1200,7 @@ test bind-15.11 {MatchPatterns procedure, modifier checks} -setup { } -cleanup { destroy .t.f } -result {0} -test bind-15.12 {MatchPatterns procedure, ignore modifier presses and releases} -constraints { +test bind-15.12 {MatchPatterns procedure, ignore modifier presses and releases} -constraints { nonPortable } -setup { frame .t.f -class Test -width 150 -height 100 @@ -1241,7 +1241,7 @@ test bind-15.14 {MatchPatterns procedure, checking "nearby"} -setup { } -body { bind .t.f {set x 1} set x 0 - event generate .t.f + event generate .t.f event generate .t.f event generate .t.f -x 30 -y 40 event generate .t.f -x 31 -y 39 @@ -1258,7 +1258,7 @@ test bind-15.15 {MatchPatterns procedure, checking "nearby"} -setup { } -body { bind .t.f {set x 1} set x 0 - event generate .t.f + event generate .t.f event generate .t.f event generate .t.f -x 30 -y 40 event generate .t.f -x 29 -y 41 @@ -1275,7 +1275,7 @@ test bind-15.16 {MatchPatterns procedure, checking "nearby"} -setup { } -body { bind .t.f {set x 1} set x 0 - event generate .t.f + event generate .t.f event generate .t.f event generate .t.f -x 30 -y 40 event generate .t.f -x 40 -y 40 @@ -1292,7 +1292,7 @@ test bind-15.17 {MatchPatterns procedure, checking "nearby"} -setup { } -body { bind .t.f {set x 1} set x 0 - event generate .t.f + event generate .t.f event generate .t.f event generate .t.f -x 30 -y 40 event generate .t.f -x 20 -y 40 @@ -1309,7 +1309,7 @@ test bind-15.18 {MatchPatterns procedure, checking "nearby"} -setup { } -body { bind .t.f {set x 1} set x 0 - event generate .t.f + event generate .t.f event generate .t.f event generate .t.f -x 30 -y 40 event generate .t.f -x 30 -y 30 @@ -1326,7 +1326,7 @@ test bind-15.19 {MatchPatterns procedure, checking "nearby"} -setup { } -body { bind .t.f {set x 1} set x 0 - event generate .t.f + event generate .t.f event generate .t.f event generate .t.f -x 30 -y 40 event generate .t.f -x 30 -y 50 @@ -1343,7 +1343,7 @@ test bind-15.20 {MatchPatterns procedure, checking "nearby"} -setup { } -body { bind .t.f {set x 1} set x 0 - event generate .t.f + event generate .t.f event generate .t.f event generate .t.f -time 300 event generate .t.f -time 700 @@ -1360,7 +1360,7 @@ test bind-15.21 {MatchPatterns procedure, checking "nearby"} -setup { } -body { bind .t.f {set x 1} set x 0 - event generate .t.f + event generate .t.f event generate .t.f event generate .t.f -time 300 event generate .t.f -time 900 @@ -2017,7 +2017,7 @@ test bind-16.34 {ExpandPercents procedure} -setup { destroy .t.f } -result {781 632} test bind-16.35 {ExpandPercents procedure} -constraints { - nonPortable + nonPortable } -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f @@ -2242,7 +2242,7 @@ test bind-17.6 {event command: add with error} -body { event add <> abc <1> } -cleanup { event delete <> -} -returnCodes error -result {bad event type or keysym "xyz"} +} -returnCodes error -result {bad event type or keysym "xyz"} test bind-17.7 {event command: add with error} -body { event delete <> catch {event add <> abc <1>} @@ -2335,7 +2335,7 @@ test bind-18.1 {CreateVirtualEvent procedure: GetVirtualEventUid} -body { test bind-18.2 {CreateVirtualEvent procedure: FindSequence} -body { event add <> } -returnCodes error -result {bad event type or keysym "Ctrl"} -test bind-18.3 {CreateVirtualEvent procedure: new physical} -body { +test bind-18.3 {CreateVirtualEvent procedure: new physical} -body { event delete <> event add <> event info <> @@ -2344,7 +2344,7 @@ test bind-18.3 {CreateVirtualEvent procedure: new physical} -body { } -result {} test bind-18.4 {CreateVirtualEvent procedure: duplicate physical} -body { event delete <> - event add <> + event add <> event add <> event info <> } -cleanup { @@ -2415,13 +2415,13 @@ test bind-19.7 {DeleteVirtualEvent procedure: owns 1, delete all} -body { foreach p [event info] {event delete $p} event add <> event delete <> - event info + event info } -result {} test bind-19.8 {DeleteVirtualEvent procedure: owns 1, delete 1} -body { foreach p [event info] {event delete $p} event add <> event delete <> - event info + event info } -result {} test bind-19.9 {DeleteVirtualEvent procedure: owns many, delete all} -body { foreach p [event info] {event delete $p} @@ -2473,7 +2473,7 @@ test bind-19.12 {DeleteVirtualEvent procedure: owned by 1, first in chain} -setu event generate .t.f event generate .t.f event generate .t.f - event delete <> + event delete <> event generate .t.f event generate .t.f event generate .t.f @@ -2540,7 +2540,7 @@ test bind-19.14 {DeleteVirtualEvent procedure: owned by 1, last in chain} -setup event generate .t.f event generate .t.f event generate .t.f - event delete <> + event delete <> event generate .t.f event generate .t.f event generate .t.f @@ -2576,7 +2576,7 @@ test bind-19.15 {DeleteVirtualEvent procedure: owned by many, first} -setup { event generate .t.g event generate .t.h event generate .t.h - event delete <> + event delete <> event generate .t.f event generate .t.f event generate .t.g @@ -2648,7 +2648,7 @@ test bind-19.17 {DeleteVirtualEvent procedure: owned by many, last} -setup { event generate .t.g event generate .t.h event generate .t.h - event delete <> + event delete <> event generate .t.f event generate .t.f event generate .t.g @@ -3385,7 +3385,7 @@ test bind-22.55 {HandleEventGenerate: options -override xyz} -setup { set x {} } -body { bind .t.f "lappend x %o" - event generate .t.f -override xyz + event generate .t.f -override xyz } -cleanup { destroy .t.f } -returnCodes error -result {expected boolean value but got "xyz"} @@ -3398,7 +3398,7 @@ test bind-22.56 {HandleEventGenerate: options -override 1} -setup { set x {} } -body { bind .t.f "lappend x %o" - event generate .t.f -override 1 + event generate .t.f -override 1 return $x } -cleanup { destroy .t.f @@ -3412,7 +3412,7 @@ test bind-22.57 {HandleEventGenerate: options -override 1} -setup { set x {} } -body { bind .t.f "lappend x %o" - event generate .t.f -override 1 + event generate .t.f -override 1 return $x } -cleanup { destroy .t.f @@ -3426,7 +3426,7 @@ test bind-22.58 {HandleEventGenerate: options -override 1} -setup { set x {} } -body { bind .t.f "lappend x %o" - event generate .t.f -override 1 + event generate .t.f -override 1 return $x } -cleanup { destroy .t.f @@ -3440,7 +3440,7 @@ test bind-22.59 {HandleEventGenerate: options -override 1} -setup { set x {} } -body { bind .t.f "lappend x %k" - event generate .t.f -override 1 + event generate .t.f -override 1 } -cleanup { destroy .t.f } -returnCodes error -result { event doesn't accept "-override" option} @@ -3453,7 +3453,7 @@ test bind-22.60 {HandleEventGenerate: options -place xyz} -setup { set x {} } -body { bind .t.f "lappend x %p" - event generate .t.f -place xyz + event generate .t.f -place xyz } -cleanup { destroy .t.f } -returnCodes error -result {bad -place value "xyz": must be PlaceOnTop, or PlaceOnBottom} @@ -3466,7 +3466,7 @@ test bind-22.61 {HandleEventGenerate: options -place PlaceOnTop} -se set x {} } -body { bind .t.f "lappend x %p" - event generate .t.f -place PlaceOnTop + event generate .t.f -place PlaceOnTop return $x } -cleanup { destroy .t.f @@ -3480,7 +3480,7 @@ test bind-22.62 {HandleEventGenerate: options -place PlaceOnTop} -setup { set x {} } -body { bind .t.f "lappend x %k" - event generate .t.f -place PlaceOnTop + event generate .t.f -place PlaceOnTop } -cleanup { destroy .t.f } -returnCodes error -result { event doesn't accept "-place" option} @@ -3493,7 +3493,7 @@ test bind-22.63 {HandleEventGenerate: options -root .xyz} -setup { set x {} } -body { bind .t.f "lappend x %R" - event generate .t.f -root .xyz + event generate .t.f -root .xyz } -cleanup { destroy .t.f } -returnCodes error -result {bad window path name ".xyz"} @@ -3506,7 +3506,7 @@ test bind-22.64 {HandleEventGenerate: options -root .t} -setup { set x {} } -body { bind .t.f "lappend x %R" - event generate .t.f -root .t + event generate .t.f -root .t expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f @@ -3520,7 +3520,7 @@ test bind-22.65 {HandleEventGenerate: options -root xyz} -setup { set x {} } -body { bind .t.f "lappend x %R" - event generate .t.f -root xyz + event generate .t.f -root xyz } -cleanup { destroy .t.f } -returnCodes error -result {bad window name/identifier "xyz"} @@ -3533,7 +3533,7 @@ test bind-22.66 {HandleEventGenerate: options -root [winfo id .t]} -setup set x {} } -body { bind .t.f "lappend x %R" - event generate .t.f -root [winfo id .t] + event generate .t.f -root [winfo id .t] expr {[winfo id .t] eq $x} } -cleanup { destroy .t.f @@ -3547,7 +3547,7 @@ test bind-22.67 {HandleEventGenerate: options