diff -c -P -r orig/tk8.4a4/doc/text.n patch3/tk8.4a4/doc/text.n *** orig/tk8.4a4/doc/text.n Thu Nov 15 22:27:54 2001 --- patch3/tk8.4a4/doc/text.n Fri Jun 21 20:33:46 2002 *************** *** 32,38 **** \-highlightcolor \-pady \-yscrollcommand .SE .SH "WIDGET-SPECIFIC OPTIONS" ! .OP \-autoseparators autoSseparators AutoSeparators .VS 8.4 Specifies a boolean that says whether separators are automatically inserted in the undo stack. Only meaningful when the \fB\-undo\fR --- 32,38 ---- \-highlightcolor \-pady \-yscrollcommand .SE .SH "WIDGET-SPECIFIC OPTIONS" ! .OP \-autoseparators autoSeparators AutoSeparators .VS 8.4 Specifies a boolean that says whether separators are automatically inserted in the undo stack. Only meaningful when the \fB\-undo\fR *************** *** 42,47 **** --- 42,50 ---- Specifies the desired height for the window, in units of characters in the font given by the \fB\-font\fR option. Must be at least one. + .OP \-maxundo maxUndo MaxUndo + Specifies the maximum number of compound undo actions on the undo + stack. A zero or a negative value imply an unlimited undo stack. .OP \-spacing1 spacing1 Spacing1 Requests additional space above each text line in the widget, using any of the standard forms for screen distances. *************** *** 732,738 **** .VS 8.4 The text widget has an unlimited undo and redo mechanism (when the \fB-undo\fR widget option is true) which records every insert and ! delete action is recorded on a stack. .PP Boundaries (called "separators") are inserted between edit actions. The purpose of these separators is to group inserts and deletes into --- 735,741 ---- .VS 8.4 The text widget has an unlimited undo and redo mechanism (when the \fB-undo\fR widget option is true) which records every insert and ! delete action on a stack. .PP Boundaries (called "separators") are inserted between edit actions. The purpose of these separators is to group inserts and deletes into *************** *** 746,758 **** Separators are inserted automatically when the \fB-autoseparators\fR widget option is true. You can insert separators programatically as well. If a separator is already present at the top of the undo stack ! no other will inserted. That means that two separators on the undo stack are always separated by at least one insert or delete action. .PP The undo mechanism is also linked to the modified flag. This means that undoing or redoing changes can take a modified text widget back to the unmodified state or vice versa. The modified flag will be set ! to automatically to the appropriate state. This automatic coupling does not work when the modified flag has been set by the user, until the flag has been reset again. .PP --- 749,761 ---- Separators are inserted automatically when the \fB-autoseparators\fR widget option is true. You can insert separators programatically as well. If a separator is already present at the top of the undo stack ! no other will be inserted. That means that two separators on the undo stack are always separated by at least one insert or delete action. .PP The undo mechanism is also linked to the modified flag. This means that undoing or redoing changes can take a modified text widget back to the unmodified state or vice versa. The modified flag will be set ! automatically to the appropriate state. This automatic coupling does not work when the modified flag has been set by the user, until the flag has been reset again. .PP diff -c -P -r orig/tk8.4a4/generic/tkText.c patch3/tk8.4a4/generic/tkText.c *** orig/tk8.4a4/generic/tkText.c Tue Feb 26 02:58:25 2002 --- patch3/tk8.4a4/generic/tkText.c Fri Jun 21 19:54:39 2002 *************** *** 20,25 **** --- 20,26 ---- #include "default.h" #include "tkPort.h" #include "tkInt.h" + #include "tkUndo.h" #ifdef MAC_TCL #define Style TkStyle *************** *** 90,95 **** --- 91,98 ---- DEF_TEXT_INSERT_ON_TIME, Tk_Offset(TkText, insertOnTime), 0}, {TK_CONFIG_PIXELS, "-insertwidth", "insertWidth", "InsertWidth", DEF_TEXT_INSERT_WIDTH, Tk_Offset(TkText, insertWidth), 0}, + {TK_CONFIG_INT, "-maxundo", "maxUndo", "MaxUndo", + DEF_TEXT_MAX_UNDO, Tk_Offset(TkText, maxUndo), 0}, {TK_CONFIG_PIXELS, "-padx", "padX", "Pad", DEF_TEXT_PADX, Tk_Offset(TkText, padX), 0}, {TK_CONFIG_PIXELS, "-pady", "padY", "Pad", *************** *** 311,328 **** static int DumpSegment _ANSI_ARGS_((Tcl_Interp *interp, char *key, char *value, char * command, TkTextIndex *index, int what)); ! static int TextEditUndo _ANSI_ARGS_((Tcl_Interp * interp, ! TkText *textPtr)); ! static int TextEditRedo _ANSI_ARGS_((Tcl_Interp * interp, ! TkText *textPtr)); static void TextGetText _ANSI_ARGS_((TkTextIndex * index1, TkTextIndex * index2, Tcl_DString *dsPtr)); - static void pushStack _ANSI_ARGS_(( TkTextEditAtom ** stack, - TkTextEditAtom * elem )); - - static TkTextEditAtom * popStack _ANSI_ARGS_((TkTextEditAtom ** stack)); - static void clearStack _ANSI_ARGS_((TkTextEditAtom ** stack)); - static void insertSeparator _ANSI_ARGS_((TkTextEditAtom ** stack)); static void updateDirtyFlag _ANSI_ARGS_((TkText *textPtr)); /* --- 314,323 ---- static int DumpSegment _ANSI_ARGS_((Tcl_Interp *interp, char *key, char *value, char * command, TkTextIndex *index, int what)); ! static int TextEditUndo _ANSI_ARGS_((TkText *textPtr)); ! static int TextEditRedo _ANSI_ARGS_((TkText *textPtr)); static void TextGetText _ANSI_ARGS_((TkTextIndex * index1, TkTextIndex * index2, Tcl_DString *dsPtr)); static void updateDirtyFlag _ANSI_ARGS_((TkText *textPtr)); /* *************** *** 412,420 **** --- 407,417 ---- TkTextSetYView(textPtr, &startIndex, 0); textPtr->exportSelection = 1; textPtr->pickEvent.type = LeaveNotify; + textPtr->undoStack = TkUndoInitStack(interp,0); textPtr->undo = 1; textPtr->isDirtyIncrement = 1; textPtr->autoSeparators = 1; + textPtr->lastEditMode = TK_TEXT_EDIT_OTHER; /* * Create the "sel" tag and the "current" and "insert" marks. *************** *** 811,818 **** if (textPtr->bindingTable != NULL) { Tk_DeleteBindingTable(textPtr->bindingTable); } ! clearStack(&(textPtr->undoStack)); ! clearStack(&(textPtr->redoStack)); /* * NOTE: do NOT free up selBorder, selBdString, or selFgColorPtr: --- 808,814 ---- if (textPtr->bindingTable != NULL) { Tk_DeleteBindingTable(textPtr->bindingTable); } ! TkUndoFreeStack(textPtr->undoStack); /* * NOTE: do NOT free up selBorder, selBdString, or selFgColorPtr: *************** *** 864,869 **** --- 860,867 ---- return TCL_ERROR; } + TkUndoSetDepth(textPtr->undoStack, textPtr->maxUndo); + /* * A few other options also need special processing, such as parsing * the geometry and setting the background from a 3-D border. *************** *** 1193,1199 **** { int lineIndex, resetView, offset; TkTextIndex newTop; - TkTextEditAtom * insertion; char indexBuffer[TK_POS_CHARS]; /* --- 1191,1196 ---- *************** *** 1229,1251 **** */ if ( textPtr->undo ) { ! if (textPtr->autoSeparators && textPtr->undoStack && ! textPtr->undoStack->type != TK_EDIT_INSERT) { ! insertSeparator(&(textPtr->undoStack)); } ! insertion = (TkTextEditAtom *) ckalloc(sizeof(TkTextEditAtom)); ! insertion->type = TK_EDIT_INSERT; TkTextPrintIndex(indexPtr,indexBuffer); ! insertion->index = (char *) ckalloc(strlen(indexBuffer) + 1); ! strcpy(insertion->index,indexBuffer); ! insertion->string = (char *) ckalloc(strlen(string) + 1); ! strcpy(insertion->string,string); - pushStack(&(textPtr->undoStack),insertion); - clearStack(&(textPtr->redoStack)); } updateDirtyFlag(textPtr); --- 1226,1284 ---- */ if ( textPtr->undo ) { ! TkTextIndex toIndex; ! ! Tcl_DString actionCommand; ! Tcl_DString revertCommand; ! ! if (textPtr->autoSeparators && ! textPtr->lastEditMode != TK_TEXT_EDIT_INSERT) { ! TkUndoInsertUndoSeparator(textPtr->undoStack); } ! textPtr->lastEditMode = TK_TEXT_EDIT_INSERT; ! ! Tcl_DStringInit(&actionCommand); ! Tcl_DStringInit(&revertCommand); ! ! Tcl_DStringAppend(&actionCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1); ! Tcl_DStringAppend(&actionCommand," insert ",-1); ! TkTextPrintIndex(indexPtr,indexBuffer); ! Tcl_DStringAppend(&actionCommand,indexBuffer,-1); ! Tcl_DStringAppend(&actionCommand," ",-1); ! Tcl_DStringAppendElement(&actionCommand,string); ! Tcl_DStringAppend(&actionCommand,";",-1); ! Tcl_DStringAppend(&actionCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1); ! Tcl_DStringAppend(&actionCommand," mark set insert ",-1); ! TkTextIndexForwBytes(indexPtr, (int) strlen(string), ! &toIndex); ! TkTextPrintIndex(&toIndex, indexBuffer); ! Tcl_DStringAppend(&actionCommand,indexBuffer,-1); ! Tcl_DStringAppend(&actionCommand,"; ",-1); ! Tcl_DStringAppend(&actionCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1); ! Tcl_DStringAppend(&actionCommand," see insert",-1); + Tcl_DStringAppend(&revertCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1); + Tcl_DStringAppend(&revertCommand," delete ",-1); + TkTextPrintIndex(indexPtr,indexBuffer); + Tcl_DStringAppend(&revertCommand,indexBuffer,-1); + Tcl_DStringAppend(&revertCommand," ",-1); + TkTextPrintIndex(&toIndex, indexBuffer); + Tcl_DStringAppend(&revertCommand,indexBuffer,-1); + Tcl_DStringAppend(&revertCommand," ;",-1); + Tcl_DStringAppend(&revertCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1); + Tcl_DStringAppend(&revertCommand," mark set insert ",-1); TkTextPrintIndex(indexPtr,indexBuffer); ! Tcl_DStringAppend(&revertCommand,indexBuffer,-1); ! Tcl_DStringAppend(&revertCommand,"; ",-1); ! Tcl_DStringAppend(&revertCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1); ! Tcl_DStringAppend(&revertCommand," see insert",-1); ! TkUndoPushAction(textPtr->undoStack,&actionCommand, &revertCommand); ! ! Tcl_DStringFree(&actionCommand); ! Tcl_DStringFree(&revertCommand); } updateDirtyFlag(textPtr); *************** *** 1292,1298 **** { int line1, line2, line, byteIndex, resetView; TkTextIndex index1, index2; - TkTextEditAtom * deletion; char indexBuffer[TK_POS_CHARS]; /* --- 1325,1330 ---- *************** *** 1412,1438 **** if (textPtr->undo) { Tcl_DString ds; ! if (textPtr->autoSeparators && (textPtr->undoStack != NULL) ! && (textPtr->undoStack->type != TK_EDIT_DELETE)) { ! insertSeparator(&(textPtr->undoStack)); ! } ! deletion = (TkTextEditAtom *) ckalloc(sizeof(TkTextEditAtom)); ! deletion->type = TK_EDIT_DELETE; ! TkTextPrintIndex(&index1, indexBuffer); ! deletion->index = (char *) ckalloc(strlen(indexBuffer) + 1); ! strcpy(deletion->index, indexBuffer); ! TextGetText(&index1, &index2, &ds); ! deletion->string = ! (char *) ckalloc((unsigned int) Tcl_DStringLength(&ds) + 1); ! strcpy(deletion->string, Tcl_DStringValue(&ds)); ! Tcl_DStringFree(&ds); - pushStack(&(textPtr->undoStack), deletion); - clearStack(&(textPtr->redoStack)); } updateDirtyFlag(textPtr); --- 1444,1501 ---- if (textPtr->undo) { Tcl_DString ds; + Tcl_DString actionCommand; + Tcl_DString revertCommand; + + if (textPtr->autoSeparators + && (textPtr->lastEditMode != TK_TEXT_EDIT_DELETE)) { + TkUndoInsertUndoSeparator(textPtr->undoStack); + } + + textPtr->lastEditMode = TK_TEXT_EDIT_DELETE; + + Tcl_DStringInit(&actionCommand); + Tcl_DStringInit(&revertCommand); + + Tcl_DStringAppend(&actionCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1); + Tcl_DStringAppend(&actionCommand," delete ",-1); + TkTextPrintIndex(&index1,indexBuffer); + Tcl_DStringAppend(&actionCommand,indexBuffer,-1); + Tcl_DStringAppend(&actionCommand," ",-1); + TkTextPrintIndex(&index2, indexBuffer); + Tcl_DStringAppend(&actionCommand,indexBuffer,-1); + Tcl_DStringAppend(&actionCommand,"; ",-1); + Tcl_DStringAppend(&actionCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1); + Tcl_DStringAppend(&actionCommand," mark set insert ",-1); + TkTextPrintIndex(&index1,indexBuffer); + Tcl_DStringAppend(&actionCommand,indexBuffer,-1); + + Tcl_DStringAppend(&actionCommand,"; ",-1); + Tcl_DStringAppend(&actionCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1); + Tcl_DStringAppend(&actionCommand," see insert",-1); ! TextGetText(&index1, &index2, &ds); ! Tcl_DStringAppend(&revertCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1); ! Tcl_DStringAppend(&revertCommand," insert ",-1); ! TkTextPrintIndex(&index1,indexBuffer); ! Tcl_DStringAppend(&revertCommand,indexBuffer,-1); ! Tcl_DStringAppend(&revertCommand," ",-1); ! Tcl_DStringAppendElement(&revertCommand,Tcl_DStringValue(&ds)); ! Tcl_DStringAppend(&revertCommand,"; ",-1); ! Tcl_DStringAppend(&revertCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1); ! Tcl_DStringAppend(&revertCommand," mark set insert ",-1); ! TkTextPrintIndex(&index2, indexBuffer); ! Tcl_DStringAppend(&revertCommand,indexBuffer,-1); ! Tcl_DStringAppend(&revertCommand,"; ",-1); ! Tcl_DStringAppend(&revertCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1); ! Tcl_DStringAppend(&revertCommand," see insert",-1); ! TkUndoPushAction(textPtr->undoStack,&actionCommand, &revertCommand); ! Tcl_DStringFree(&actionCommand); ! Tcl_DStringFree(&revertCommand); } updateDirtyFlag(textPtr); *************** *** 2483,2580 **** } /* - * pushStack - * Push elem on the stack identified by stack. - * - * Results: - * None - * - * Side effects: - * None. - */ - - static void pushStack ( stack, elem ) - TkTextEditAtom ** stack; - TkTextEditAtom * elem; - { - elem->next = *stack; - *stack = elem; - } - - /* - * popStack -- - * Remove and return the top element from the stack identified by - * stack. - * - * Results: - * None - * - * Side effects: - * None. - */ - - static TkTextEditAtom * popStack ( stack ) - TkTextEditAtom ** stack ; - { - TkTextEditAtom * elem = NULL; - if (*stack != NULL ) { - elem = *stack; - *stack = elem->next; - } - return elem; - } - - /* - * insertSeparator -- - * insert a separator on the stack, indicating a border for - * an undo/redo chunk. - * - * Results: - * None - * - * Side effects: - * None. - */ - - static void insertSeparator ( stack ) - TkTextEditAtom ** stack; - { - TkTextEditAtom * separator; - - if ( *stack != NULL && (*stack)->type != TK_EDIT_SEPARATOR ) { - separator = (TkTextEditAtom *) ckalloc(sizeof(TkTextEditAtom)); - separator->type = TK_EDIT_SEPARATOR; - pushStack(stack,separator); - } - } - - /* - * clearStack -- - * Clear an entire undo or redo stack and destroy all elements in it. - * - * Results: - * None - * - * Side effects: - * None. - */ - - static void clearStack ( stack ) - TkTextEditAtom ** stack; /* An Undo or Redo stack */ - { - TkTextEditAtom * elem; - - while ( (elem = popStack(stack)) ) { - if ( elem->type != TK_EDIT_SEPARATOR ) { - ckfree(elem->index); - ckfree(elem->string); - } - ckfree((char *)elem); - } - *stack = NULL; - } - - /* * TextEditUndo -- * undo the last change. * --- 2546,2551 ---- *************** *** 2585,2598 **** * None. */ ! static int TextEditUndo (interp,textPtr) ! Tcl_Interp * interp; TkText * textPtr; /* Overall information about text widget. */ { ! TkTextEditAtom * elem; ! TkTextIndex fromIndex, toIndex; ! char buffer[TK_POS_CHARS]; ! char viewIndex[TK_POS_CHARS]; if ( ! textPtr->undo ) { return TCL_OK; --- 2556,2565 ---- * None. */ ! static int TextEditUndo (textPtr) TkText * textPtr; /* Overall information about text widget. */ { ! int status; if ( ! textPtr->undo ) { return TCL_OK; *************** *** 2602,2665 **** textPtr->undo = 0; ! /* insert a separator on the redo stack */ ! insertSeparator(&(textPtr->redoStack)); ! ! /* Pop and skip the first separator if there is one*/ ! ! elem = popStack(&(textPtr->undoStack)); ! ! if ( elem == NULL ) { ! textPtr->undo = 1; ! return TCL_ERROR; ! } ! ! if ( ( elem != NULL ) && ( elem->type == TK_EDIT_SEPARATOR ) ) { ! ckfree((char *) elem); ! elem = popStack(&(textPtr->undoStack)); ! } ! ! while ( elem && (elem->type != TK_EDIT_SEPARATOR) ) { ! switch ( elem->type ) { ! case TK_EDIT_INSERT: ! TkTextGetIndex(interp,textPtr,elem->index,&toIndex); ! strcpy(viewIndex,elem->index); ! TkTextIndexForwBytes(&toIndex,(int)strlen(elem->string),&toIndex); ! TkTextPrintIndex(&toIndex,buffer); ! textPtr->isDirtyIncrement = -1; ! DeleteChars(textPtr,elem->index,buffer); ! textPtr->isDirtyIncrement = 1; ! break; ! case TK_EDIT_DELETE: ! TkTextGetIndex(interp,textPtr,elem->index,&fromIndex); ! textPtr->isDirtyIncrement = -1; ! InsertChars(textPtr,&fromIndex,elem->string); ! TkTextIndexForwBytes(&fromIndex,(int)strlen(elem->string),&toIndex); ! TkTextPrintIndex(&toIndex,viewIndex); ! textPtr->isDirtyIncrement = 1; ! break; ! default: ! return TCL_ERROR; ! } ! pushStack(&(textPtr->redoStack),elem); ! elem = popStack(&(textPtr->undoStack)); ! } ! ! /* view the last changed position */ ! ! TkTextGetIndex(interp,textPtr,viewIndex,&toIndex); ! TkTextSetMark(textPtr, "insert", &toIndex); - /* insert a separator on the undo stack */ - - insertSeparator(&(textPtr->undoStack)); - /* Turn back on the undo feature */ textPtr->undo = 1; ! return TCL_OK; } /* --- 2569,2583 ---- textPtr->undo = 0; ! /* revert one compound action */ ! status = TkUndoRevert(textPtr->undoStack); /* Turn back on the undo feature */ textPtr->undo = 1; ! return status; } /* *************** *** 2673,2686 **** * None. */ ! static int TextEditRedo (interp,textPtr) ! Tcl_Interp * interp; TkText * textPtr; /* Overall information about text widget. */ { ! TkTextEditAtom *elem; ! TkTextIndex fromIndex, toIndex; ! char buffer[TK_POS_CHARS]; ! char viewIndex[TK_POS_CHARS]; if (!textPtr->undo) { return TCL_OK; --- 2591,2600 ---- * None. */ ! static int TextEditRedo (textPtr) TkText * textPtr; /* Overall information about text widget. */ { ! int status; if (!textPtr->undo) { return TCL_OK; *************** *** 2690,2751 **** textPtr->undo = 0; ! /* insert a separator on the undo stack */ ! ! insertSeparator(&(textPtr->undoStack)); ! ! /* Pop and skip the first separator if there is one*/ ! ! elem = popStack(&(textPtr->redoStack)); ! ! if ( elem == NULL ) { ! textPtr->undo = 1; ! return TCL_ERROR; ! } ! ! if ( ( elem != NULL ) && ( elem->type == TK_EDIT_SEPARATOR ) ) { ! ckfree((char *) elem); ! elem = popStack(&(textPtr->redoStack)); ! } ! ! while ( elem && (elem->type != TK_EDIT_SEPARATOR) ) { ! switch ( elem->type ) { ! case TK_EDIT_INSERT: ! TkTextGetIndex(interp, textPtr, elem->index, &fromIndex); ! InsertChars(textPtr, &fromIndex, elem->string); ! TkTextIndexForwBytes(&fromIndex, (int) strlen(elem->string), ! &toIndex); ! TkTextPrintIndex(&toIndex, viewIndex); ! break; ! case TK_EDIT_DELETE: ! TkTextGetIndex(interp, textPtr, elem->index, &toIndex); ! strcpy(viewIndex, elem->index); ! TkTextIndexForwBytes(&toIndex, (int) strlen(elem->string), ! &toIndex); ! TkTextPrintIndex(&toIndex, buffer); ! DeleteChars(textPtr, elem->index, buffer); ! break; ! default: ! return TCL_ERROR; ! } ! pushStack(&(textPtr->undoStack), elem); ! elem = popStack(&(textPtr->redoStack)); ! } ! ! /* view the last changed position */ ! TkTextGetIndex(interp, textPtr, viewIndex, &toIndex); ! TkTextSetMark(textPtr, "insert", &toIndex); ! ! /* insert a separator on the undo stack */ ! ! insertSeparator(&(textPtr->undoStack)); /* Turn back on the undo feature */ textPtr->undo = 1; ! return TCL_OK; } /* --- 2604,2618 ---- textPtr->undo = 0; ! /* reapply one compound action */ ! status = TkUndoApply(textPtr->undoStack); /* Turn back on the undo feature */ textPtr->undo = 1; ! return status; } /* *************** *** 2823,2829 **** argv[0], " edit redo\"", (char *) NULL); return TCL_ERROR; } ! if ( TextEditRedo(interp,textPtr) ) { Tcl_AppendResult(interp, "nothing to redo", (char *) NULL); return TCL_ERROR; } --- 2690,2696 ---- argv[0], " edit redo\"", (char *) NULL); return TCL_ERROR; } ! if ( TextEditRedo(textPtr) ) { Tcl_AppendResult(interp, "nothing to redo", (char *) NULL); return TCL_ERROR; } *************** *** 2834,2855 **** argv[0], " edit reset\"", (char *) NULL); return TCL_ERROR; } ! clearStack(&(textPtr->undoStack)); ! clearStack(&(textPtr->redoStack)); } else if ((c == 's') && (strncmp(argv[2], "separator", length) == 0)) { if (argc != 3) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " edit separator\"", (char *) NULL); return TCL_ERROR; } ! insertSeparator(&(textPtr->undoStack)); } else if ((c == 'u') && (strncmp(argv[2], "undo", length) == 0)) { if (argc != 3) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " edit undo\"", (char *) NULL); return TCL_ERROR; } ! if ( TextEditUndo(interp,textPtr) ) { Tcl_AppendResult(interp, "nothing to undo", (char *) NULL); return TCL_ERROR; --- 2701,2721 ---- argv[0], " edit reset\"", (char *) NULL); return TCL_ERROR; } ! TkUndoClearStacks(textPtr->undoStack); } else if ((c == 's') && (strncmp(argv[2], "separator", length) == 0)) { if (argc != 3) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " edit separator\"", (char *) NULL); return TCL_ERROR; } ! TkUndoInsertUndoSeparator(textPtr->undoStack); } else if ((c == 'u') && (strncmp(argv[2], "undo", length) == 0)) { if (argc != 3) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " edit undo\"", (char *) NULL); return TCL_ERROR; } ! if ( TextEditUndo(textPtr) ) { Tcl_AppendResult(interp, "nothing to undo", (char *) NULL); return TCL_ERROR; diff -c -P -r orig/tk8.4a4/generic/tkText.h patch3/tk8.4a4/generic/tkText.h *** orig/tk8.4a4/generic/tkText.h Sat Jan 26 01:41:28 2002 --- patch3/tk8.4a4/generic/tkText.h Fri Jun 21 19:21:19 2002 *************** *** 20,25 **** --- 20,29 ---- #include "tk.h" #endif + #ifndef _TKUNDO + #include "tkUndo.h" + #endif + #ifdef BUILD_tk # undef TCL_STORAGE_CLASS # define TCL_STORAGE_CLASS DLLEXPORT *************** *** 451,474 **** * BE THE LAST IN THE STRUCTURE. */ } TkTextTabArray; ! /* enum definining the types used in an edit stack */ typedef enum { ! TK_EDIT_SEPARATOR, /* Marker */ ! TK_EDIT_INSERT, /* The undo is an insert */ ! TK_EDIT_DELETE /* The undo is a delete */ ! } TkTextEditType; ! ! /* strcut defining the basic undo/redo stack element */ ! ! typedef struct TkTextEditAtom { ! TkTextEditType type; /* The type that will trigger the ! * required action*/ ! char * index; /* The starting index of the range */ ! char * string; /* The text to be inserted / deleted */ ! struct TkTextEditAtom * next; /* Pointer to the next element in the ! * stack */ ! } TkTextEditAtom; /* * A data structure of the following type is kept for each text widget that --- 455,467 ---- * BE THE LAST IN THE STRUCTURE. */ } TkTextTabArray; ! /* enum definining the edit modes of */ typedef enum { ! TK_TEXT_EDIT_INSERT, /* insert mode */ ! TK_TEXT_EDIT_DELETE, /* delete mode */ ! TK_TEXT_EDIT_OTHER /* none of the above */ ! } TkTextEditMode; /* * A data structure of the following type is kept for each text widget that *************** *** 649,661 **** * Information related to the undo/redo functonality */ ! TkTextEditAtom * undoStack; /* The undo stack */ ! ! TkTextEditAtom * redoStack; /* The redo stack */ int undo; /* non zero means the undo/redo behaviour is * enabled */ int autoSeparators; /* non zero means the separatorss will be * inserted automatically */ --- 642,655 ---- * Information related to the undo/redo functonality */ ! TkUndoRedoStack * undoStack; /* The undo/redo stack */ int undo; /* non zero means the undo/redo behaviour is * enabled */ + int maxUndo; /* The maximum depth of the undo stack expressed + * as the maximum number of compound statements */ + int autoSeparators; /* non zero means the separatorss will be * inserted automatically */ *************** *** 672,677 **** --- 666,674 ---- * incremented every edit action */ + TkTextEditMode lastEditMode; /* Keeps track of what the last edit mode was + */ + } TkText; /* diff -c -P -r orig/tk8.4a4/generic/tkUndo.c patch3/tk8.4a4/generic/tkUndo.c *** orig/tk8.4a4/generic/tkUndo.c Thu Jan 1 01:00:00 1970 --- patch3/tk8.4a4/generic/tkUndo.c Fri Jun 21 20:18:32 2002 *************** *** 0 **** --- 1,400 ---- + /* + * tkUndo.c -- + * + * This module provides the implementation of an undo stack. + * + * Copyright (c) 2002 by Ludwig Callewaert. + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + * RCS: @(#) $Id: tkUndo.c,v 1.26 2002/02/26 01:58:25 lgac Exp $ + */ + + #include "tkUndo.h" + + + /* + * TkUndoPushStack + * Push elem on the stack identified by stack. + * + * Results: + * None + * + * Side effects: + * None. + */ + + void TkUndoPushStack ( stack, elem ) + TkUndoAtom ** stack; + TkUndoAtom * elem; + { + elem->next = *stack; + *stack = elem; + } + + /* + * TkUndoPopStack -- + * Remove and return the top element from the stack identified by + * stack. + * + * Results: + * None + * + * Side effects: + * None. + */ + + TkUndoAtom * TkUndoPopStack ( stack ) + TkUndoAtom ** stack ; + { + TkUndoAtom * elem = NULL; + if (*stack != NULL ) { + elem = *stack; + *stack = elem->next; + } + return elem; + } + + /* + * TkUndoInsertSeparator -- + * insert a separator on the stack, indicating a border for + * an undo/redo chunk. + * + * Results: + * None + * + * Side effects: + * None. + */ + + int TkUndoInsertSeparator ( stack ) + TkUndoAtom ** stack; + { + TkUndoAtom * separator; + + if ( *stack != NULL && (*stack)->type != TK_UNDO_SEPARATOR ) { + separator = (TkUndoAtom *) ckalloc(sizeof(TkUndoAtom)); + separator->type = TK_UNDO_SEPARATOR; + TkUndoPushStack(stack,separator); + return 1; + } else { + return 0; + } + } + + /* + * TkUndoClearStack -- + * Clear an entire undo or redo stack and destroy all elements in it. + * + * Results: + * None + * + * Side effects: + * None. + */ + + void TkUndoClearStack ( stack ) + TkUndoAtom ** stack; /* An Undo or Redo stack */ + { + TkUndoAtom * elem; + + while ( (elem = TkUndoPopStack(stack)) ) { + if ( elem->type != TK_UNDO_SEPARATOR ) { + Tcl_DecrRefCount(elem->apply); + Tcl_DecrRefCount(elem->revert); + } + ckfree((char *)elem); + } + *stack = NULL; + } + + /* + * TkUndoPushAction + * Push a new elem on the stack identified by stack. + * action and revert are given through Tcl_DStrings + * + * Results: + * None + * + * Side effects: + * None. + */ + + void TkUndoPushAction ( stack, actionScript, revertScript ) + TkUndoRedoStack * stack; /* An Undo or Redo stack */ + Tcl_DString * actionScript; /* The script to get the action (redo) */ + Tcl_DString * revertScript; /* The script to revert the action (undo) */ + { + TkUndoAtom * atom; + + atom = (TkUndoAtom *) ckalloc(sizeof(TkUndoAtom)); + atom->type = TK_UNDO_ACTION; + + atom->apply = Tcl_NewStringObj(Tcl_DStringValue(actionScript),Tcl_DStringLength(actionScript)); + Tcl_IncrRefCount(atom->apply); + + atom->revert = Tcl_NewStringObj(Tcl_DStringValue(revertScript),Tcl_DStringLength(revertScript)); + Tcl_IncrRefCount(atom->revert); + + TkUndoPushStack(&(stack->undoStack), atom); + TkUndoClearStack(&(stack->redoStack)); + } + + + /* + * TkUndoInitStack + * Initialize a new undo/redo stack + * + * Results: + * un Undo/Redo stack pointer + * + * Side effects: + * None. + */ + + TkUndoRedoStack * TkUndoInitStack ( interp, maxdepth ) + Tcl_Interp * interp; /* The interpreter */ + int maxdepth; /* The maximum stack depth */ + { + TkUndoRedoStack * stack; /* An Undo/Redo stack */ + stack = (TkUndoRedoStack *) ckalloc(sizeof(TkUndoRedoStack)); + stack->undoStack = NULL; + stack->redoStack = NULL; + stack->interp = interp; + stack->maxdepth = maxdepth; + stack->depth = 0; + return stack; + } + + + /* + * TkUndoInitStack + * Initialize a new undo/redo stack + * + * Results: + * un Undo/Redo stack pointer + * + * Side effects: + * None. + */ + + void TkUndoSetDepth ( stack, maxdepth ) + TkUndoRedoStack * stack; /* An Undo/Redo stack */ + int maxdepth; /* The maximum stack depth */ + { + TkUndoAtom * elem; + TkUndoAtom * prevelem; + int sepNumber = 0; + + stack->maxdepth = maxdepth; + + if ((stack->maxdepth > 0) && (stack->depth > stack->maxdepth)) { + /* Maximum stack depth exceeded. We have to remove the last compound + elements on the stack */ + elem = stack->undoStack; + prevelem = NULL; + while ( sepNumber <= stack->maxdepth ) { + if (elem != NULL && (elem->type == TK_UNDO_SEPARATOR) ) { + sepNumber++; + } + prevelem = elem; + elem = elem->next; + } + prevelem->next = NULL; + while ( elem ) { + prevelem = elem; + elem = elem->next; + ckfree((char *) elem); + } + stack->depth = stack->maxdepth; + } + } + + + /* + * TkUndoClearStacks + * Clear both the undo and redo stack + * + * Results: + * None + * + * Side effects: + * None. + */ + + void TkUndoClearStacks ( stack ) + TkUndoRedoStack * stack; /* An Undo/Redo stack */ + { + TkUndoClearStack(&(stack->undoStack)); + TkUndoClearStack(&(stack->redoStack)); + stack->depth = 0; + } + + + /* + * TkUndoFreeStack + * Clear both the undo and redo stack + * also free the memory allocated to the u/r stack pointer + * + * Results: + * None + * + * Side effects: + * None. + */ + + void TkUndoFreeStack ( stack ) + TkUndoRedoStack * stack; /* An Undo/Redo stack */ + { + TkUndoClearStacks(stack); + /* ckfree((TkUndoRedoStack *) stack); */ + ckfree((char *) stack); + } + + + /* + * TkUndoInsertUndoSeparator -- + * insert a separator on the undo stack, indicating a border for + * an undo/redo chunk. + * + * Results: + * None + * + * Side effects: + * None. + */ + + void TkUndoInsertUndoSeparator ( stack ) + TkUndoRedoStack * stack; + { + /* TkUndoAtom * elem; + TkUndoAtom * prevelem; + int sepNumber = 0; + */ + + if ( TkUndoInsertSeparator(&(stack->undoStack)) ) { + ++(stack->depth); + TkUndoSetDepth(stack,stack->maxdepth); + /* if ((stack->maxdepth > 0) && (stack->depth > stack->maxdepth)) { + elem = stack->undoStack; + prevelem = NULL; + while ( sepNumber < stack->depth ) { + if (elem != NULL && (elem->type == TK_UNDO_SEPARATOR) ) { + sepNumber++; + } + prevelem = elem; + elem = elem->next; + } + prevelem->next = NULL; + while ( elem ) { + prevelem = elem; + elem = elem->next; + ckfree((char *) elem); + } + stack->depth; + } */ + } + } + + + /* + * TkUndoRevert -- + * Undo a compound action on the stack. + * + * Results: + * A TCL status code + * + * Side effects: + * None. + */ + + int TkUndoRevert ( stack ) + TkUndoRedoStack * stack; + { + TkUndoAtom * elem; + + /* insert a separator on the undo and the redo stack */ + + TkUndoInsertUndoSeparator(stack); + TkUndoInsertSeparator(&(stack->redoStack)); + + /* Pop and skip the first separator if there is one*/ + + elem = TkUndoPopStack(&(stack->undoStack)); + + if ( elem == NULL ) { + return TCL_ERROR; + } + + if ( ( elem != NULL ) && ( elem->type == TK_UNDO_SEPARATOR ) ) { + ckfree((char *) elem); + elem = TkUndoPopStack(&(stack->undoStack)); + } + + while ( elem && (elem->type != TK_UNDO_SEPARATOR) ) { + Tcl_EvalObjEx(stack->interp,elem->revert,TCL_EVAL_GLOBAL); + + TkUndoPushStack(&(stack->redoStack),elem); + elem = TkUndoPopStack(&(stack->undoStack)); + } + + /* insert a separator on the redo stack */ + + TkUndoInsertSeparator(&(stack->redoStack)); + + --(stack->depth); + + return TCL_OK; + } + + + /* + * TkUndoApply -- + * Redo a compound action on the stack. + * + * Results: + * A TCL status code + * + * Side effects: + * None. + */ + + int TkUndoApply ( stack ) + TkUndoRedoStack * stack; + { + TkUndoAtom *elem; + + /* insert a separator on the undo stack */ + + TkUndoInsertSeparator(&(stack->undoStack)); + + /* Pop and skip the first separator if there is one*/ + + elem = TkUndoPopStack(&(stack->redoStack)); + + if ( elem == NULL ) { + return TCL_ERROR; + } + + if ( ( elem != NULL ) && ( elem->type == TK_UNDO_SEPARATOR ) ) { + ckfree((char *) elem); + elem = TkUndoPopStack(&(stack->redoStack)); + } + + while ( elem && (elem->type != TK_UNDO_SEPARATOR) ) { + Tcl_EvalObjEx(stack->interp,elem->apply,TCL_EVAL_GLOBAL); + + TkUndoPushStack(&(stack->undoStack), elem); + elem = TkUndoPopStack(&(stack->redoStack)); + } + + /* insert a separator on the undo stack */ + + TkUndoInsertSeparator(&(stack->undoStack)); + + ++(stack->depth); + + return TCL_OK; + } + diff -c -P -r orig/tk8.4a4/generic/tkUndo.h patch3/tk8.4a4/generic/tkUndo.h *** orig/tk8.4a4/generic/tkUndo.h Thu Jan 1 01:00:00 1970 --- patch3/tk8.4a4/generic/tkUndo.h Fri Jun 21 19:26:48 2002 *************** *** 0 **** --- 1,82 ---- + /* + * tkUndo.h -- + * + * Declarations shared among the files that implement an undo + * stack. + * + * Copyright (c) 2002 Ludwig Callewaert. + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + * RCS: @(#) $Id: tkUndo.h,v 1.10 2002/01/25 21:09:37 lgac Exp $ + */ + + #ifndef _TKUNDO + #define _TKUNDO + + #ifndef _TK + #include "tk.h" + #endif + + /* enum definining the types used in an undo stack */ + + typedef enum { + TK_UNDO_SEPARATOR, /* Marker */ + TK_UNDO_ACTION /* Command */ + } TkUndoAtomType; + + /* struct defining the basic undo/redo stack element */ + + typedef struct TkUndoAtom { + TkUndoAtomType type; /* The type that will trigger the + * required action*/ + Tcl_Obj * apply; /* Command to apply the action that was taken */ + Tcl_Obj * revert; /* The command to undo the action */ + struct TkUndoAtom * next; /* Pointer to the next element in the + * stack */ + } TkUndoAtom; + + /* struct defining the basic undo/redo stack element */ + + typedef struct TkUndoRedoStack { + TkUndoAtom * undoStack; /* The undo stack */ + TkUndoAtom * redoStack; /* The redo stack */ + Tcl_Interp * interp ; /* The interpreter in which to execute the revert and apply scripts */ + int maxdepth; + int depth; + } TkUndoRedoStack; + + /* basic functions */ + + EXTERN void TkUndoPushStack _ANSI_ARGS_((TkUndoAtom ** stack, + TkUndoAtom * elem)); + + EXTERN TkUndoAtom * TkUndoPopStack _ANSI_ARGS_((TkUndoAtom ** stack)); + + EXTERN int TkUndoInsertSeparator _ANSI_ARGS_((TkUndoAtom ** stack)); + + EXTERN void TkUndoClearStack _ANSI_ARGS_((TkUndoAtom ** stack)); + + /* functions working on an undo/redo stack */ + + EXTERN TkUndoRedoStack * TkUndoInitStack _ANSI_ARGS_((Tcl_Interp * interp, + int maxdepth)); + + EXTERN void TkUndoSetDepth _ANSI_ARGS_((TkUndoRedoStack * stack, + int maxdepth)); + + EXTERN void TkUndoClearStacks _ANSI_ARGS_((TkUndoRedoStack * stack)); + + EXTERN void TkUndoFreeStack _ANSI_ARGS_((TkUndoRedoStack * stack)); + + EXTERN void TkUndoInsertUndoSeparator _ANSI_ARGS_((TkUndoRedoStack * stack)); + + EXTERN void TkUndoPushAction _ANSI_ARGS_((TkUndoRedoStack * stack, + Tcl_DString * actionScript, Tcl_DString * revertScript)); + + EXTERN int TkUndoRevert _ANSI_ARGS_((TkUndoRedoStack * stack)); + + EXTERN int TkUndoApply _ANSI_ARGS_((TkUndoRedoStack * stack)); + + #endif /* _TKUNDO */ diff -c -P -r orig/tk8.4a4/library/text.tcl patch3/tk8.4a4/library/text.tcl *** orig/tk8.4a4/library/text.tcl Tue Feb 19 01:01:35 2002 --- patch3/tk8.4a4/library/text.tcl Fri Jun 21 07:18:36 2002 *************** *** 339,353 **** } bind Text <> { ! if { ! [ catch { %W edit undo } ] } { ! %W see insert ! } } bind Text <> { ! if { ! [ catch { %W edit redo } ] } { ! %W see insert ! } } if {[string compare $tcl_platform(platform) "windows"]} { --- 339,349 ---- } bind Text <> { ! catch { %W edit undo } } bind Text <> { ! catch { %W edit redo } } if {[string compare $tcl_platform(platform) "windows"]} { *************** *** 635,641 **** proc ::tk::TextPaste {w x y} { $w mark set insert [TextClosestGap $w $x $y] - catch {$w insert insert [::tk::GetSelection $w PRIMARY]} catch { set oldSeparator [$w cget -autoseparators] if {$oldSeparator} { --- 631,636 ---- diff -c -P -r orig/tk8.4a4/mac/tkMacDefault.h patch3/tk8.4a4/mac/tkMacDefault.h *** orig/tk8.4a4/mac/tkMacDefault.h Fri Feb 22 22:07:05 2002 --- patch3/tk8.4a4/mac/tkMacDefault.h Fri Jun 21 20:00:38 2002 *************** *** 485,490 **** --- 485,491 ---- #define DEF_TEXT_INSERT_OFF_TIME "300" #define DEF_TEXT_INSERT_ON_TIME "600" #define DEF_TEXT_INSERT_WIDTH "1" + #define DEF_TEXT_MAX_UNDO "0" #define DEF_TEXT_PADX "1" #define DEF_TEXT_PADY "1" #define DEF_TEXT_RELIEF "flat" diff -c -P -r orig/tk8.4a4/tests/text.test patch3/tk8.4a4/tests/text.test *** orig/tk8.4a4/tests/text.test Tue Nov 13 01:19:05 2001 --- patch3/tk8.4a4/tests/text.test Fri Jun 21 20:28:25 2002 *************** *** 70,75 **** --- 70,76 ---- {-insertofftime 100 100 2.4} {-insertontime 47 47 e1} {-insertwidth 2.3 2 47d} + {-maxundo 5 5 noway} {-padx 3.4 3 2.4.} {-pady 82 82 bogus} {-relief raised raised bumpy} *************** *** 113,119 **** lappend result [lindex $i 4] } set result ! } {1 blue {} {} 7 watch 0 {} fixed #012 5 #123 #234 0 green 45 100 47 2 3 82 raised #ffff01234567 21 yellow 0 0 0 0 disabled {1i 2i 3i 4i} {any old thing} 1 73 word {x scroll command} {test command}} test text-2.1 {Tk_TextCmd procedure} { list [catch {text} msg] $msg --- 114,120 ---- lappend result [lindex $i 4] } set result ! } {1 blue {} {} 7 watch 0 {} fixed #012 5 #123 #234 0 green 45 100 47 2 5 3 82 raised #ffff01234567 21 yellow 0 0 0 0 disabled {1i 2i 3i 4i} {any old thing} 1 73 word {x scroll command} {test command}} test text-2.1 {Tk_TextCmd procedure} { list [catch {text} msg] $msg *************** *** 1481,1486 **** --- 1482,1500 ---- set ::retval } {selection_changed} + test text-25.13 {-maxundo configuration option} { + catch {destroy .t} + text .t -undo 1 -autoseparators 1 -maxundo 2 + pack .t + .t insert end "line 1\n" + .t delete 1.4 1.6 + .t insert end "line 2\n" + catch {.t edit undo} + catch {.t edit undo} + catch {.t edit undo} + .t get 1.0 end + } "line 1\n\n" + eval destroy [winfo child .] option clear diff -c -P -r orig/tk8.4a4/unix/Makefile patch3/tk8.4a4/unix/Makefile *** orig/tk8.4a4/unix/Makefile Thu Jan 1 01:00:00 1970 --- patch3/tk8.4a4/unix/Makefile Fri Jun 21 07:33:51 2002 *************** *** 0 **** --- 1,1278 ---- + # Generated automatically from Makefile.in by configure. + # + # This file is a Makefile for Tk. If it has the name "Makefile.in" + # then it is a template for a Makefile; to generate the actual Makefile, + # run "./configure", which is a configuration script generated by the + # "autoconf" program (constructs like "@foo@" will get replaced in the + # actual Makefile. + # + # RCS: @(#) $Id: Makefile.in,v 1.64 2002/03/05 19:44:43 davygrvy Exp $ + + # Current Tk version; used in various names. + + TCLVERSION = 8.4 + VERSION = 8.4 + LOCALES = de en es fr + + #---------------------------------------------------------------- + # Things you can change to personalize the Makefile for your own + # site (you can make these changes in either Makefile.in or + # Makefile, but changes to Makefile will get lost if you re-run + # the configuration script). + #---------------------------------------------------------------- + + # Default top-level directories in which to install architecture- + # specific files (exec_prefix) and machine-independent files such + # as scripts (prefix). The values specified here may be overridden + # at configure-time with the --exec-prefix and --prefix options + # to the "configure" script. + + prefix = /usr/local + exec_prefix = /usr/local + bindir = ${exec_prefix}/bin + libdir = /usr/local/lib + includedir = ${prefix}/include + mandir = ${prefix}/man + + # The following definition can be set to non-null for special systems + # like AFS with replication. It allows the pathnames used for installation + # to be different than those used for actually reference files at + # run-time. INSTALL_ROOT is prepended to $prefix and $exec_prefix + # when installing files. + INSTALL_ROOT = + + # Directory from which applications will reference the library of Tcl + # scripts (note: you can set the TK_LIBRARY environment variable at + # run-time to override the compiled-in location): + TK_LIBRARY = $(prefix)/lib/tk$(VERSION) + + # Path to use at runtime to refer to LIB_INSTALL_DIR: + LIB_RUNTIME_DIR = $(libdir) + + # Directory in which to install the program wish: + BIN_INSTALL_DIR = $(INSTALL_ROOT)$(bindir) + + # Directory in which to install the .a or .so binary for the Tk library: + LIB_INSTALL_DIR = $(INSTALL_ROOT)$(libdir) + + # Path name to use when installing library scripts: + SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TK_LIBRARY) + + # Directory in which to install the include file tk.h: + INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir) + + # Top-level directory for manual entries: + MAN_INSTALL_DIR = $(INSTALL_ROOT)$(mandir) + + # Directory in which to install manual entry for wish: + MAN1_INSTALL_DIR = $(MAN_INSTALL_DIR)/man1 + + # Directory in which to install manual entries for Tk's C library + # procedures: + MAN3_INSTALL_DIR = $(MAN_INSTALL_DIR)/man3 + + # Directory in which to install manual entries for the built-in + # Tcl commands implemented by Tk: + MANN_INSTALL_DIR = $(MAN_INSTALL_DIR)/mann + + # The directory containing the Tcl sources and headers appropriate + # for this version of Tk ("srcdir" will be replaced or has already + # been replaced by the configure script): + TCL_GENERIC_DIR = /home/ludwig/tcltk/patch3/tcl8.4a4/generic + + # The directory containing the Tcl library archive file appropriate + # for this version of Tk: + TCL_BIN_DIR = /home/ludwig/tcltk/patch3/tcl8.4a4/unix + + # The linker flags needed to link in the Tcl library (ex: -ltcl8.2) + TCL_LIB_FLAG = -ltcl8.4 + + # Libraries built with optimization switches have this additional extension + TK_DBGX = + + # warning flags + CFLAGS_WARNING = -Wall -Wconversion -Wno-implicit-int + + # The default switches for optimization or debugging + CFLAGS_DEBUG = -g + CFLAGS_OPTIMIZE = -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES + + # To change the compiler switches, for example to change from optimization to + # debugging symbols, change the following line: + #CFLAGS = $(CFLAGS_DEBUG) + #CFLAGS = $(CFLAGS_OPTIMIZE) + #CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_OPTIMIZE) + CFLAGS = $(CFLAGS_OPTIMIZE) + + # Flags to pass to the linker + LDFLAGS_DEBUG = + LDFLAGS_OPTIMIZE = + LDFLAGS = -rdynamic $(LDFLAGS_OPTIMIZE) + + # A "-I" switch that can be used when compiling to make all of the + # X11 include files accessible (the configure script will try to + # set this value, and will cause it to be an empty string if the + # include files are accessible via /usr/include). + X11_INCLUDES = -I/usr/X11R6/include + + # Linker switch(es) to use to link with the X11 library archive (the + # configure script will try to set this value automatically, but you + # can override it). + X11_LIB_SWITCHES = -L/usr/X11R6/lib -lX11 + + + # To turn off the security checks that disallow incoming sends when + # the X server appears to be insecure, reverse the comments on the + # following lines: + SECURITY_FLAGS = + #SECURITY_FLAGS = -DTK_NO_SECURITY + + # To disable ANSI-C procedure prototypes reverse the comment characters + # on the following lines: + PROTO_FLAGS = + #PROTO_FLAGS = -DNO_PROTOTYPE + + # To enable memory debugging reverse the comment characters on the following + # lines. Warning: if you enable memory debugging, you must do it + # *everywhere*, including all the code that calls Tcl, and you must use + # ckalloc and ckfree everywhere instead of malloc and free. + MEM_DEBUG_FLAGS = + #MEM_DEBUG_FLAGS = -DTCL_MEM_DEBUG + + # If your X server is X11R4 or earlier, then you may wish to reverse + # the comment characters on the following two lines. This will enable + # extra code to speed up XStringToKeysym. In X11R5 and later releases + # XStringToKeysym is plenty fast, so you needn't define REDO_KEYSYM_LOOKUP. + KEYSYM_FLAGS = + #KEYSYM_FLAGS = -DREDO_KEYSYM_LOOKUP + + # Tk does not used deprecated Tcl constructs so it should + # compile fine with -DTCL_NO_DEPRECATED. To remove its own + # set of deprecated code uncomment the second line. + NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED + #NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED -DTK_NO_DEPRECATED + + # Some versions of make, like SGI's, use the following variable to + # determine which shell to use for executing commands: + SHELL = /bin/sh + + # Tk used to let the configure script choose which program to use + # for installing, but there are just too many different versions of + # "install" around; better to use the install-sh script that comes + # with the distribution, which is slower but guaranteed to work. + + INSTALL = /home/ludwig/tcltk/patch3/tk8.4a4/unix/install-sh -c + INSTALL_PROGRAM = ${INSTALL} + INSTALL_DATA = ${INSTALL} -m 644 + + # TCL_EXE is the name of a tclsh executable that is available *BEFORE* + # running make for the first time. Certain build targets (make genstubs) + # need it to be available on the PATH. This executable should *NOT* be + # required just to do a normal build although it can be required to run + # make dist. + TCL_EXE = tclsh + + # The symbols below provide support for dynamic loading and shared + # libraries. The values of the symbols are normally set by the + # configure script. You shouldn't normally need to modify any of + # these definitions by hand. + + SHLIB_CFLAGS = -fPIC + + # To enable support for stubs in Tcl. + STUB_LIB_FILE = libtkstub8.4.a + + TK_STUB_LIB_FILE = libtkstub8.4.a + #TK_STUB_LIB_FILE = libtkstub.a + + TK_STUB_LIB_FLAG = -ltkstub8.4 + #TK_STUB_LIB_FLAG = -ltkstub + + TK_LIB_FILE = libtk8.4.so + #TK_LIB_FILE = libtk.a + + TK_LIB_FLAG = -ltk8.4 + #TK_LIB_FLAG = -ltk + + TCL_LIB_SPEC = -L/home/ludwig/tcltk/patch3/tcl8.4a4/unix -ltcl8.4 + TCL_STUB_LIB_SPEC = -L/home/ludwig/tcltk/patch3/tcl8.4a4/unix -ltclstub8.4 + TCL_STUB_LIB_FLAG = -ltclstub8.4 + TK_EXP_FILE = + TK_BUILD_EXP_FILE = + + TCL_STUB_FLAGS = -DUSE_TCL_STUBS + + # Libraries to use when linking. This definition is determined by the + # configure script. + LIBS = $(X11_LIB_SWITCHES) -ldl -lieee -lm + WISH_LIBS = $(TCL_LIB_SPEC) $(X11_LIB_SWITCHES) -ldl -lieee -lm + + # The symbol below provides support for dynamic loading and shared + # libraries. See configure.in for a description of what it means. + # The values of the symbolis normally set by the configure script. + + STLIB_LD = ${AR} cr + SHLIB_LD = gcc -pipe -shared + SHLIB_LD_LIBS = ${LIBS} + + # Additional search flags needed to find the various shared libraries + # at run-time. The first symbol is for use when creating a binary + # with cc, and the second is for use when running ld directly. + TK_CC_SEARCH_FLAGS = -Wl,-rpath,${LIB_RUNTIME_DIR}:/usr/X11R6/lib + TK_LD_SEARCH_FLAGS = -Wl,-rpath,${LIB_RUNTIME_DIR}:/usr/X11R6/lib + + #---------------------------------------------------------------- + # The information below is modified by the configure script when + # Makefile is generated from Makefile.in. You shouldn't normally + # modify any of this stuff by hand. + #---------------------------------------------------------------- + + AC_FLAGS = -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_PW_GECOS=1 + AR = ar + RANLIB = : + SRC_DIR = /home/ludwig/tcltk/patch3/tk8.4a4/unix/.. + TOP_DIR = /home/ludwig/tcltk/patch3/tk8.4a4/unix/.. + GENERIC_DIR = $(TOP_DIR)/generic + UNIX_DIR = /home/ludwig/tcltk/patch3/tk8.4a4/unix + BMAP_DIR = $(TOP_DIR)/bitmaps + TOOL_DIR = /home/ludwig/tcltk/patch3/tcl8.4a4/tools + + #---------------------------------------------------------------- + # The information below should be usable as is. The configure + # script won't modify it and you shouldn't need to modify it + # either. + #---------------------------------------------------------------- + + CC = gcc -pipe + + CC_SWITCHES_NO_STUBS = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ + -I${UNIX_DIR} -I${GENERIC_DIR} \ + -I${BMAP_DIR} -I${TCL_GENERIC_DIR} ${X11_INCLUDES} \ + ${AC_FLAGS} ${PROTO_FLAGS} \ + ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} ${NO_DEPRECATED_FLAGS} + + CC_SWITCHES = ${CC_SWITCHES_NO_STUBS} ${TCL_STUB_FLAGS} + + DEPEND_SWITCHES = ${CFLAGS} -I${UNIX_DIR} -I${GENERIC_DIR} \ + -I${BMAP_DIR} \ + -I${TCL_GENERIC_DIR} ${X11_INCLUDES} \ + ${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} \ + ${KEYSYM_FLAGS} + + WISH_OBJS = tkAppInit.o + + TCLTEST_OBJS = ${TCL_BIN_DIR}/tclTest.o ${TCL_BIN_DIR}/tclThreadTest.o \ + ${TCL_BIN_DIR}/tclUnixTest.o + TKTEST_OBJS = $(TCLTEST_OBJS) tkTestInit.o tkTest.o tkSquare.o + + WIDGOBJS = tkButton.o tkEntry.o tkFrame.o tkListbox.o \ + tkMenu.o tkMenubutton.o tkMenuDraw.o tkMessage.o \ + tkPanedWindow.o tkScale.o tkScrollbar.o + + CANVOBJS = tkCanvas.o tkCanvArc.o tkCanvBmap.o tkCanvImg.o \ + tkCanvLine.o tkCanvPoly.o tkCanvPs.o tkCanvText.o \ + tkCanvUtil.o tkCanvWind.o tkRectOval.o tkTrig.o + + IMAGEOBJS = tkImage.o tkImgBmap.o tkImgGIF.o tkImgPPM.o tkImgPhoto.o + + TEXTOBJS = tkText.o tkTextBTree.o tkTextDisp.o tkTextImage.o tkTextIndex.o \ + tkTextMark.o tkTextTag.o tkTextWind.o + + UNDOOBJS = tkUndo.o + + UNIXOBJS = tkUnix.o tkUnix3d.o tkUnixButton.o tkUnixColor.o tkUnixConfig.o \ + tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o \ + tkUnixFocus.o tkUnixFont.o tkUnixInit.o tkUnixKey.o tkUnixMenu.o \ + tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o \ + tkUnixSend.o tkUnixWm.o tkUnixXId.o tkStubInit.o tkStubLib.o + + STUB_LIB_OBJS = tkStubLib.o tkStubImg.o + + OBJS = tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkClipboard.o tkCmds.o \ + tkColor.o tkConfig.o tkConsole.o tkCursor.o tkError.o tkEvent.o \ + tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o tkGrid.o \ + tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o tkPlace.o \ + tkSelect.o tkUtil.o tkVisual.o tkWindow.o \ + $(UNIXOBJS) $(WIDGOBJS) $(CANVOBJS) $(IMAGEOBJS) $(TEXTOBJS) $(UNDOOBJS) + + TK_DECLS = \ + $(GENERIC_DIR)/tk.decls \ + $(GENERIC_DIR)/tkInt.decls + + SRCS = \ + $(GENERIC_DIR)/tk3d.c $(GENERIC_DIR)/tkArgv.c \ + $(GENERIC_DIR)/tkAtom.c $(GENERIC_DIR)/tkBind.c \ + $(GENERIC_DIR)/tkBitmap.c $(GENERIC_DIR)/tkClipboard.c \ + $(GENERIC_DIR)/tkCmds.c $(GENERIC_DIR)/tkColor.c \ + $(GENERIC_DIR)/tkConfig.c $(GENERIC_DIR)/tkCursor.c \ + $(GENERIC_DIR)/tkError.c $(GENERIC_DIR)/tkEvent.c \ + $(GENERIC_DIR)/tkFocus.c $(GENERIC_DIR)/tkFont.c \ + $(GENERIC_DIR)/tkGet.c $(GENERIC_DIR)/tkGC.c \ + $(GENERIC_DIR)/tkGeometry.c $(GENERIC_DIR)/tkGrab.c \ + $(GENERIC_DIR)/tkGrid.c $(GENERIC_DIR)/tkConsole.c \ + $(GENERIC_DIR)/tkMain.c $(GENERIC_DIR)/tkOption.c \ + $(GENERIC_DIR)/tkPack.c $(GENERIC_DIR)/tkPlace.c \ + $(GENERIC_DIR)/tkSelect.c $(GENERIC_DIR)/tkUtil.c \ + $(GENERIC_DIR)/tkVisual.c $(GENERIC_DIR)/tkWindow.c \ + $(GENERIC_DIR)/tkButton.c $(GENERIC_DIR)/tkObj.c \ + $(GENERIC_DIR)/tkEntry.c $(GENERIC_DIR)/tkFrame.c \ + $(GENERIC_DIR)/tkListbox.c $(GENERIC_DIR)/tkMenu.c \ + $(GENERIC_DIR)/tkMenubutton.c $(GENERIC_DIR)/tkMenuDraw.c \ + $(GENERIC_DIR)/tkMessage.c \ + $(GENERIC_DIR)/tkPanedWindow.c \ + $(GENERIC_DIR)/tkScale.c $(GENERIC_DIR)/tkScrollbar.c \ + $(GENERIC_DIR)/tkCanvas.c $(GENERIC_DIR)/tkCanvArc.c \ + $(GENERIC_DIR)/tkCanvBmap.c $(GENERIC_DIR)/tkCanvImg.c \ + $(GENERIC_DIR)/tkCanvLine.c $(GENERIC_DIR)/tkCanvPoly.c \ + $(GENERIC_DIR)/tkCanvPs.c $(GENERIC_DIR)/tkCanvText.c \ + $(GENERIC_DIR)/tkCanvUtil.c \ + $(GENERIC_DIR)/tkCanvWind.c $(GENERIC_DIR)/tkRectOval.c \ + $(GENERIC_DIR)/tkTrig.c $(GENERIC_DIR)/tkImage.c \ + $(GENERIC_DIR)/tkImgBmap.c $(GENERIC_DIR)/tkImgGIF.c \ + $(GENERIC_DIR)/tkImgPPM.c \ + $(GENERIC_DIR)/tkImgPhoto.c $(GENERIC_DIR)/tkText.c \ + $(GENERIC_DIR)/tkTextBTree.c $(GENERIC_DIR)/tkTextDisp.c \ + $(GENERIC_DIR)/tkTextImage.c \ + $(GENERIC_DIR)/tkTextIndex.c $(GENERIC_DIR)/tkTextMark.c \ + $(GENERIC_DIR)/tkTextTag.c $(GENERIC_DIR)/tkTextWind.c \ + $(GENERIC_DIR)/tkOldConfig.c \ + $(GENERIC_DIR)/tkSquare.c $(GENERIC_DIR)/tkTest.c \ + $(GENERIC_DIR)/tkStubInit.c $(GENERIC_DIR)/tkStubLib.c \ + $(GENERIC_DIR)/tkUndo.c \ + $(UNIX_DIR)/tkAppInit.c $(UNIX_DIR)/tkUnix.c \ + $(UNIX_DIR)/tkUnix3d.c \ + $(UNIX_DIR)/tkUnixButton.c $(UNIX_DIR)/tkUnixColor.c \ + $(UNIX_DIR)/tkUnixConfig.c \ + $(UNIX_DIR)/tkUnixCursor.c \ + $(UNIX_DIR)/tkUnixDraw.c \ + $(UNIX_DIR)/tkUnixEmbed.c $(UNIX_DIR)/tkUnixEvent.c \ + $(UNIX_DIR)/tkUnixFocus.c \ + $(UNIX_DIR)/tkUnixFont.c $(UNIX_DIR)/tkUnixInit.c \ + $(UNIX_DIR)/tkUnixKey.c \ + $(UNIX_DIR)/tkUnixMenu.c $(UNIX_DIR)/tkUnixMenubu.c \ + $(UNIX_DIR)/tkUnixScale.c $(UNIX_DIR)/tkUnixScrlbr.c \ + $(UNIX_DIR)/tkUnixSelect.c \ + $(UNIX_DIR)/tkUnixSend.c $(UNIX_DIR)/tkUnixWm.c \ + $(UNIX_DIR)/tkUnixXId.c + + + HDRS = bltList.h \ + default.h ks_names.h tkPatch.h tk.h tkButton.h tkCanvas.h tkInt.h \ + tkPort.h tkScrollbar.h tkText.h + + DEMOPROGS = browse hello ixset rmt rolodex square tcolor timer widget + + all: binaries libraries doc + + binaries: ${TK_LIB_FILE} ${STUB_LIB_FILE} wish + + libraries: + + $(SRC_DIR)/doc/man.macros: + chmod +x $(UNIX_DIR)/install-sh + $(INSTALL_DATA) /home/ludwig/tcltk/patch3/tcl8.4a4/doc/man.macros $(SRC_DIR)/doc/man.macros + + doc: $(SRC_DIR)/doc/man.macros + + # The following target is configured by autoconf to generate either + # a shared library or non-shared library for Tk. + ${TK_LIB_FILE}: ${OBJS} + rm -f ${TK_LIB_FILE} + ${SHLIB_LD} -o $@ ${OBJS} $(TK_LD_SEARCH_FLAGS) ${TCL_STUB_LIB_SPEC} ${SHLIB_LD_LIBS} + $(RANLIB) ${TK_LIB_FILE} + + ${STUB_LIB_FILE}: ${STUB_LIB_OBJS} + rm -f ${STUB_LIB_FILE} + ${STLIB_LD} $@ ${STUB_LIB_OBJS} + $(RANLIB) ${STUB_LIB_FILE} + + # Make target which outputs the list of the .o contained in the Tk lib + # usefull to build a single big shared library containing Tcl/Tk and other + # extensions. used for the Tcl Plugin. -- dl + tkLibObjs: + @echo ${OBJS} + + # This targets actually build the objects needed for the lib in the above + # case + objs: ${OBJS} + + + wish: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) + $(CC) $(LDFLAGS) $(WISH_OBJS) \ + -L/home/ludwig/tcltk/patch3/tk8.4a4/unix -ltk8.4 \ + $(WISH_LIBS) $(TK_CC_SEARCH_FLAGS) -o wish + + # This rule is executed if the user tried to run tktest without first + # building tcltest in the Tcl bin directory. Just do it for them. + ${TCL_BIN_DIR}/tcltest: + cd ${TCL_BIN_DIR} ; \ + $(MAKE) tcltest + + # Resetting the LIB_RUNTIME_DIR below is required so that + # the generated tktest executable gets the build directory + # burned into its ld search path. This keeps tktest from + # picking up an already installed version of the Tcl or + # Tk shared libraries. + + tktest: ${TCL_BIN_DIR}/tcltest $(TKTEST_OBJS) $(TK_LIB_FILE) + $(MAKE) tktest-real LIB_RUNTIME_DIR=`pwd`:$(TCL_BIN_DIR) + + tktest-real: + ${CC} $(LDFLAGS) $(TKTEST_OBJS) \ + -L/home/ludwig/tcltk/patch3/tk8.4a4/unix -ltk8.4 \ + $(WISH_LIBS) $(TK_CC_SEARCH_FLAGS) -o tktest + + # FIXME: This xttest rule seems to be broken in a number of ways. + # It should use TK_CC_SEARCH_FLAGS, it does not include the shared + # lib location logic from tktest, and it is not clear where this + # test.o object file comes from. + xttest: test.o tkTest.o tkSquare.o $(TK_LIB_FILE) + ${CC} $(LDFLAGS) test.o tkTest.o tkSquare.o \ + -L/home/ludwig/tcltk/patch3/tk8.4a4/unix -ltk8.4 \ + $(WISH_LIBS) $(TK_LD_SEARCH_FLAGS) -lXt -o xttest + + # Note, in the target below TCL_LIBRARY needs to be set or else + # "make test" won't work in the case where the compilation directory + # isn't the same as the source directory. + # Specifying TESTFLAGS on the command line is the standard way to pass + # args to tcltest, ie: + # % make test TESTFLAGS="-verbose bps -file fileName.test" + + test: tktest + TCL_LIBRARY=/home/ludwig/tcltk/patch3/tcl8.4a4/library; export TCL_LIBRARY; \ + TK_LIBRARY=/home/ludwig/tcltk/patch3/tk8.4a4/library; export TK_LIBRARY; \ + ./tktest $(TOP_DIR)/tests/all.tcl -geometry +0+0 \ + $(TESTFLAGS) $(TCLTESTARGS) + + # Tests with different languages + testlang: tktest + TCL_LIBRARY=/home/ludwig/tcltk/patch3/tcl8.4a4/library; export TCL_LIBRARY; \ + TK_LIBRARY=/home/ludwig/tcltk/patch3/tk8.4a4/library; export TK_LIBRARY; \ + for lang in $(LOCALES) ; \ + do \ + LANG=$(lang); export LANG; \ + ./tktest $(TOP_DIR)/tests/all.tcl -geometry +0+0 \ + $(TESTFLAGS) $(TCLTESTARGS); \ + done + + # Useful target to launch a built tktest with the proper path,... + runtest: tktest + TCL_LIBRARY=/home/ludwig/tcltk/patch3/tcl8.4a4/library; export TCL_LIBRARY; \ + TK_LIBRARY=/home/ludwig/tcltk/patch3/tk8.4a4/library; export TK_LIBRARY; \ + ./tktest + + # This target can be used to run wish from the build directory + # via `make shell` or `make shell SCRIPT=/tmp/foo.tcl` + shell: wish + LD_LIBRARY_PATH=`pwd`:${TCL_BIN_DIR}:${LD_LIBRARY_PATH}; \ + export LD_LIBRARY_PATH; \ + LIBPATH=`pwd`:${TCL_BIN_DIR}:${LIBPATH}; export LIBPATH; \ + SHLIB_PATH=`pwd`:${TCL_BIN_DIR}:${SHLIB_PATH}; \ + export SHLIB_PATH; \ + TCL_LIBRARY=/home/ludwig/tcltk/patch3/tcl8.4a4/library; export TCL_LIBRARY; \ + TK_LIBRARY=/home/ludwig/tcltk/patch3/tk8.4a4/library; export TK_LIBRARY; \ + ./wish $(SCRIPT) + + # This target can be used to run wish inside either gdb or insight + gdb: wish + @echo "set env LD_LIBRARY_PATH=`pwd`:${TCL_BIN_DIR}:${LD_LIBRARY_PATH}" > gdb.run + @echo "set env LIBPATH=`pwd`:${TCL_BIN_DIR}:${LIBPATH}" >> gdb.run + @echo "set env SHLIB_PATH=`pwd`:${TCL_BIN_DIR}:${SHLIB_PATH}" >> gdb.run + @echo "set env TCL_LIBRARY=/home/ludwig/tcltk/patch3/tcl8.4a4/library" >> gdb.run + @echo "set env TK_LIBRARY=/home/ludwig/tcltk/patch3/tk8.4a4/library" >> gdb.run + gdb ./wish --command=gdb.run + rm gdb.run + + install: all install-binaries install-libraries install-demos install-doc + + # 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_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish + @for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \ + do \ + if [ ! -d $$i ] ; then \ + echo "Making directory $$i"; \ + mkdir -p $$i; \ + chmod 755 $$i; \ + else true; \ + fi; \ + done; + @if test ! -x $(UNIX_DIR)/install-sh; then \ + chmod +x $(UNIX_DIR)/install-sh; \ + fi + @if test ! -x $(UNIX_DIR)/mkLinks; then \ + chmod +x $(UNIX_DIR)/mkLinks; \ + fi + @echo "Installing $(TK_LIB_FILE) to $(LIB_INSTALL_DIR)/" + @$(INSTALL_DATA) $(TK_LIB_FILE) $(LIB_INSTALL_DIR)/$(TK_LIB_FILE) + @(cd $(LIB_INSTALL_DIR); $(RANLIB) $(TK_LIB_FILE)) + @chmod 555 $(LIB_INSTALL_DIR)/$(TK_LIB_FILE) + @echo "Installing wish as $(BIN_INSTALL_DIR)/wish$(VERSION)" + @$(INSTALL_PROGRAM) wish $(BIN_INSTALL_DIR)/wish$(VERSION) + @echo "Installing tkConfig.sh to $(LIB_INSTALL_DIR)/" + @$(INSTALL_DATA) tkConfig.sh $(LIB_INSTALL_DIR)/tkConfig.sh + @if test "$(TK_BUILD_EXP_FILE)" != ""; then \ + echo "Installing $(TK_EXP_FILE) to $(LIB_INSTALL_DIR)/"; \ + $(INSTALL_DATA) $(TK_BUILD_EXP_FILE) \ + $(LIB_INSTALL_DIR)/$(TK_EXP_FILE); \ + fi + @if test "$(TK_STUB_LIB_FILE)" != "" ; then \ + echo "Installing $(TK_STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \ + $(INSTALL_DATA) $(STUB_LIB_FILE) \ + $(LIB_INSTALL_DIR)/$(TK_STUB_LIB_FILE); \ + fi + + install-libraries: + @for i in $(INCLUDE_INSTALL_DIR) \ + $(SCRIPT_INSTALL_DIR) $(SCRIPT_INSTALL_DIR)/images \ + $(SCRIPT_INSTALL_DIR)/msgs; \ + do \ + if [ ! -d $$i ] ; then \ + echo "Making directory $$i"; \ + mkdir -p $$i; \ + chmod 755 $$i; \ + else true; \ + fi; \ + done; + @if test ! -x $(UNIX_DIR)/install-sh; then \ + chmod +x $(UNIX_DIR)/install-sh; \ + fi + @echo "Installing header files"; + @for i in $(GENERIC_DIR)/tk.h $(GENERIC_DIR)/tkDecls.h \ + $(GENERIC_DIR)/tkPlatDecls.h ; \ + do \ + $(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR); \ + done; + @echo "Installing library files to $(SCRIPT_INSTALL_DIR)"; + @for i in $(SRC_DIR)/library/*.tcl $(GENERIC_DIR)/prolog.ps \ + $(SRC_DIR)/library/tclIndex $(UNIX_DIR)/tkAppInit.c; \ + do \ + $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \ + done; + @echo "Installing library images directory"; + @for i in $(SRC_DIR)/library/images/*; \ + do \ + if [ -f $$i ] ; then \ + $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/images; \ + fi; \ + done; + @echo "Installing translation directory"; + @for i in $(SRC_DIR)/library/msgs/*.msg; \ + do \ + if [ -f $$i ] ; then \ + $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/msgs; \ + fi; \ + done; + + install-demos: + @for i in $(SCRIPT_INSTALL_DIR) \ + $(SCRIPT_INSTALL_DIR)/demos \ + $(SCRIPT_INSTALL_DIR)/demos/images ; \ + do \ + if [ ! -d $$i ] ; then \ + echo "Making directory $$i"; \ + mkdir -p $$i; \ + chmod 755 $$i; \ + else true; \ + fi; \ + done; + @echo "Installing demos to $(SCRIPT_INSTALL_DIR)/demos/"; + @for i in $(SRC_DIR)/library/demos/*; \ + do \ + if [ -f $$i ] ; then \ + sed -e '3 s|exec wish|exec wish$(VERSION)|' \ + $$i > $(SCRIPT_INSTALL_DIR)/demos/`basename $$i`; \ + fi; \ + done; + @for i in $(DEMOPROGS); \ + do \ + chmod 755 $(SCRIPT_INSTALL_DIR)/demos/$$i; \ + done; + @echo "Installing demo images"; + @for i in $(SRC_DIR)/library/demos/images/*; \ + do \ + if [ -f $$i ] ; then \ + $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/demos/images; \ + fi; \ + done; + + install-doc: + @for i in $(MAN_INSTALL_DIR) $(MAN1_INSTALL_DIR) $(MAN3_INSTALL_DIR) $(MANN_INSTALL_DIR) ; \ + do \ + if [ ! -d $$i ] ; then \ + echo "Making directory $$i"; \ + mkdir -p $$i; \ + chmod 755 $$i; \ + else true; \ + fi; \ + done; + @echo "Installing top-level (.1) docs"; + @cd $(SRC_DIR)/doc; for i in *.1; \ + do \ + rm -f $(MAN1_INSTALL_DIR)/$$i; \ + sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \ + $$i > $(MAN1_INSTALL_DIR)/$$i; \ + chmod 444 $(MAN1_INSTALL_DIR)/$$i; \ + done; + @echo "Cross-linking top-level (.1) docs"; + @$(UNIX_DIR)/mkLinks $(MAN1_INSTALL_DIR) + @echo "Installing C API (.3) docs"; + @cd $(SRC_DIR)/doc; for i in *.3; \ + do \ + rm -f $(MAN3_INSTALL_DIR)/$$i; \ + sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \ + $$i > $(MAN3_INSTALL_DIR)/$$i; \ + chmod 444 $(MAN3_INSTALL_DIR)/$$i; \ + done; + @echo "Cross-linking top-level (.3) docs"; + @$(UNIX_DIR)/mkLinks $(MAN3_INSTALL_DIR) + @echo "Installing command (.n) docs"; + @cd $(SRC_DIR)/doc; for i in *.n; \ + do \ + rm -f $(MANN_INSTALL_DIR)/$$i; \ + sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \ + $$i > $(MANN_INSTALL_DIR)/$$i; \ + chmod 444 $(MANN_INSTALL_DIR)/$$i; \ + done; + @echo "Cross-linking command (.n) docs"; + @$(UNIX_DIR)/mkLinks $(MANN_INSTALL_DIR) + + Makefile: $(UNIX_DIR)/Makefile.in + $(SHELL) config.status + + clean: + rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out errors \ + tktest wish config.info lib.exp + + distclean: clean + rm -f Makefile config.status config.cache config.log tkConfig.sh \ + $(PACKAGE).* prototype + + depend: + makedepend -- $(DEPEND_SWITCHES) -- $(SRCS) + + # Test binaries. The rule for tkTestInit.o is complicated because + # it is is compiled from tkAppInit.c. Can't use the "-o" option + # because this doesn't work on some strange compilers (e.g. UnixWare). + + tkTestInit.o: $(UNIX_DIR)/tkAppInit.c + @if test -f tkAppInit.o ; then \ + rm -f tkAppInit.sav; \ + mv tkAppInit.o tkAppInit.sav; \ + fi; + $(CC) -c $(CC_SWITCHES_NO_STUBS) -DTK_TEST $(UNIX_DIR)/tkAppInit.c + rm -f tkTestInit.o + mv tkAppInit.o tkTestInit.o + @if test -f tkAppInit.sav ; then \ + mv tkAppInit.sav tkAppInit.o; \ + fi; + + tkAppInit.o: $(UNIX_DIR)/tkAppInit.c + $(CC) -c $(CC_SWITCHES_NO_STUBS) $(UNIX_DIR)/tkAppInit.c + + tk3d.o: $(GENERIC_DIR)/tk3d.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tk3d.c + + tkArgv.o: $(GENERIC_DIR)/tkArgv.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkArgv.c + + tkAtom.o: $(GENERIC_DIR)/tkAtom.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkAtom.c + + tkBind.o: $(GENERIC_DIR)/tkBind.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkBind.c + + tkBitmap.o: $(GENERIC_DIR)/tkBitmap.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkBitmap.c + + tkClipboard.o: $(GENERIC_DIR)/tkClipboard.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkClipboard.c + + tkCmds.o: $(GENERIC_DIR)/tkCmds.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkCmds.c + + tkColor.o: $(GENERIC_DIR)/tkColor.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkColor.c + + tkConfig.o: $(GENERIC_DIR)/tkConfig.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkConfig.c + + tkConsole.o: $(GENERIC_DIR)/tkConsole.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkConsole.c + + tkCursor.o: $(GENERIC_DIR)/tkCursor.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkCursor.c + + tkError.o: $(GENERIC_DIR)/tkError.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkError.c + + tkEvent.o: $(GENERIC_DIR)/tkEvent.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkEvent.c + + tkFocus.o: $(GENERIC_DIR)/tkFocus.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkFocus.c + + tkFont.o: $(GENERIC_DIR)/tkFont.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkFont.c + + tkGet.o: $(GENERIC_DIR)/tkGet.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkGet.c + + tkGC.o: $(GENERIC_DIR)/tkGC.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkGC.c + + tkGeometry.o: $(GENERIC_DIR)/tkGeometry.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkGeometry.c + + tkGrab.o: $(GENERIC_DIR)/tkGrab.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkGrab.c + + tkGrid.o: $(GENERIC_DIR)/tkGrid.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkGrid.c + + tkMain.o: $(GENERIC_DIR)/tkMain.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkMain.c + + tkObj.o: $(GENERIC_DIR)/tkObj.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkObj.c + + tkOldConfig.o: $(GENERIC_DIR)/tkOldConfig.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkOldConfig.c + + tkOption.o: $(GENERIC_DIR)/tkOption.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkOption.c + + tkPack.o: $(GENERIC_DIR)/tkPack.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkPack.c + + tkPlace.o: $(GENERIC_DIR)/tkPlace.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkPlace.c + + tkSelect.o: $(GENERIC_DIR)/tkSelect.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkSelect.c + + tkUtil.o: $(GENERIC_DIR)/tkUtil.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkUtil.c + + tkVisual.o: $(GENERIC_DIR)/tkVisual.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkVisual.c + + tkWindow.o: $(GENERIC_DIR)/tkWindow.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkWindow.c + + tkButton.o: $(GENERIC_DIR)/tkButton.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkButton.c + + tkEntry.o: $(GENERIC_DIR)/tkEntry.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkEntry.c + + tkFrame.o: $(GENERIC_DIR)/tkFrame.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkFrame.c + + tkListbox.o: $(GENERIC_DIR)/tkListbox.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkListbox.c + + tkMenu.o: $(GENERIC_DIR)/tkMenu.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkMenu.c + + tkMenubutton.o: $(GENERIC_DIR)/tkMenubutton.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkMenubutton.c + + tkMenuDraw.o: $(GENERIC_DIR)/tkMenuDraw.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkMenuDraw.c + + tkMessage.o: $(GENERIC_DIR)/tkMessage.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkMessage.c + + tkPanedWindow.o: $(GENERIC_DIR)/tkPanedWindow.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkPanedWindow.c + + tkScale.o: $(GENERIC_DIR)/tkScale.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkScale.c + + tkScrollbar.o: $(GENERIC_DIR)/tkScrollbar.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkScrollbar.c + + tkSquare.o: $(GENERIC_DIR)/tkSquare.c + $(CC) -c $(CC_SWITCHES_NO_STUBS) $(GENERIC_DIR)/tkSquare.c + + tkCanvas.o: $(GENERIC_DIR)/tkCanvas.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkCanvas.c + + tkCanvArc.o: $(GENERIC_DIR)/tkCanvArc.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkCanvArc.c + + tkCanvBmap.o: $(GENERIC_DIR)/tkCanvBmap.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkCanvBmap.c + + tkCanvImg.o: $(GENERIC_DIR)/tkCanvImg.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkCanvImg.c + + tkCanvLine.o: $(GENERIC_DIR)/tkCanvLine.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkCanvLine.c + + tkCanvPoly.o: $(GENERIC_DIR)/tkCanvPoly.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkCanvPoly.c + + tkCanvPs.o: $(GENERIC_DIR)/tkCanvPs.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkCanvPs.c + + tkCanvText.o: $(GENERIC_DIR)/tkCanvText.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkCanvText.c + + tkCanvUtil.o: $(GENERIC_DIR)/tkCanvUtil.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkCanvUtil.c + + tkCanvWind.o: $(GENERIC_DIR)/tkCanvWind.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkCanvWind.c + + tkRectOval.o: $(GENERIC_DIR)/tkRectOval.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkRectOval.c + + tkTrig.o: $(GENERIC_DIR)/tkTrig.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkTrig.c + + tkImage.o: $(GENERIC_DIR)/tkImage.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImage.c + + tkImgBmap.o: $(GENERIC_DIR)/tkImgBmap.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgBmap.c + + tkImgGIF.o: $(GENERIC_DIR)/tkImgGIF.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgGIF.c + + tkImgPPM.o: $(GENERIC_DIR)/tkImgPPM.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPPM.c + + tkImgPhoto.o: $(GENERIC_DIR)/tkImgPhoto.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPhoto.c + + tkTest.o: $(GENERIC_DIR)/tkTest.c + $(CC) -c $(CC_SWITCHES_NO_STUBS) $(GENERIC_DIR)/tkTest.c + + tkText.o: $(GENERIC_DIR)/tkText.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkText.c + + tkTextBTree.o: $(GENERIC_DIR)/tkTextBTree.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkTextBTree.c + + tkTextDisp.o: $(GENERIC_DIR)/tkTextDisp.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkTextDisp.c + + tkTextImage.o: $(GENERIC_DIR)/tkTextImage.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkTextImage.c + + tkTextIndex.o: $(GENERIC_DIR)/tkTextIndex.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkTextIndex.c + + tkTextMark.o: $(GENERIC_DIR)/tkTextMark.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkTextMark.c + + tkTextTag.o: $(GENERIC_DIR)/tkTextTag.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkTextTag.c + + tkTextWind.o: $(GENERIC_DIR)/tkTextWind.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkTextWind.c + + tkStubInit.o: $(GENERIC_DIR)/tkStubInit.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkStubInit.c + + # Stub library binaries, these must be compiled for use in a shared library + # even though they will be placed in a static archive + + tkStubLib.o: $(GENERIC_DIR)/tkStubLib.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkStubLib.c + + tkStubImg.o: $(GENERIC_DIR)/tkStubImg.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkStubImg.c + + tkUndo.o: $(GENERIC_DIR)/tkUndo.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkUndo.c + + tkUnix.o: $(UNIX_DIR)/tkUnix.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnix.c + + tkUnix3d.o: $(UNIX_DIR)/tkUnix3d.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnix3d.c + + tkUnixButton.o: $(UNIX_DIR)/tkUnixButton.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixButton.c + + tkUnixColor.o: $(UNIX_DIR)/tkUnixColor.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixColor.c + + tkUnixConfig.o: $(UNIX_DIR)/tkUnixConfig.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixConfig.c + + tkUnixCursor.o: $(UNIX_DIR)/tkUnixCursor.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixCursor.c + + tkUnixDraw.o: $(UNIX_DIR)/tkUnixDraw.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixDraw.c + + tkUnixEmbed.o: $(UNIX_DIR)/tkUnixEmbed.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixEmbed.c + + tkUnixEvent.o: $(UNIX_DIR)/tkUnixEvent.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixEvent.c + + tkUnixFocus.o: $(UNIX_DIR)/tkUnixFocus.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixFocus.c + + tkUnixFont.o: $(UNIX_DIR)/tkUnixFont.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixFont.c + + tkUnixInit.o: $(UNIX_DIR)/tkUnixInit.c $(GENERIC_DIR)/tkInitScript.h tkConfig.sh + $(CC) -c $(CC_SWITCHES) -DTK_LIBRARY=\"${TK_LIBRARY}\" \ + $(UNIX_DIR)/tkUnixInit.c + + tkUnixKey.o: $(UNIX_DIR)/tkUnixKey.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixKey.c + + tkUnixMenu.o: $(UNIX_DIR)/tkUnixMenu.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixMenu.c + + tkUnixMenubu.o: $(UNIX_DIR)/tkUnixMenubu.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixMenubu.c + + tkUnixScale.o: $(UNIX_DIR)/tkUnixScale.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixScale.c + + tkUnixScrlbr.o: $(UNIX_DIR)/tkUnixScrlbr.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixScrlbr.c + + tkUnixSelect.o: $(UNIX_DIR)/tkUnixSelect.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixSelect.c + + tkUnixSend.o: $(UNIX_DIR)/tkUnixSend.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixSend.c + + tkUnixWm.o: $(UNIX_DIR)/tkUnixWm.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixWm.c + + tkUnixXId.o: $(UNIX_DIR)/tkUnixXId.c + $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixXId.c + + .c.o: + $(CC) -c $(CC_SWITCHES) $< + + # + # Target to check for proper usage of UCHAR macro. + # + + checkuchar: + -egrep isalnum\|isalpha\|iscntrl\|isdigit\|islower\|isprint\|ispunct\|isspace\|isupper\|isxdigit\|toupper\|tolower $(SRCS) | grep -v UCHAR + + # + # Target to make sure that only symbols with "Tk" prefixes are + # exported. + # + + checkexports: $(TK_LIB_FILE) + -nm -p $(TK_LIB_FILE) | awk '$$2 ~ /[TDB]/ { print $$3 }' | sort -n | grep -v '^[Tt]k' + + + # + # Regenerate the stubs files. + # + + $(GENERIC_DIR)/tkStubInit.c: $(GENERIC_DIR)/tk.decls \ + $(GENERIC_DIR)/tkInt.decls + @echo "Warning: run \"make genstubs\" to regenerate tkStubInit.c" + + genstubs: + $(TCL_EXE) $(TOOL_DIR)/genStubs.tcl $(GENERIC_DIR) \ + $(GENERIC_DIR)/tk.decls $(GENERIC_DIR)/tkInt.decls + + # + # Target to check that all exported functions have an entry in the stubs + # tables. + # + + checkstubs: + -@for i in `nm -p $(TK_LIB_FILE) | awk '$$2 ~ /T/ { print $$3 }' \ + | sort -n`; do \ + match=0; \ + for j in $(TK_DECLS); do \ + if [ `grep -c $$i $$j` -gt 0 ]; then \ + match=1; \ + fi; \ + done; \ + if [ $$match -eq 0 ]; then echo $$i; fi \ + done + + + # + # Target to create a Tk RPM for Linux. Requires that you be on a Linux + # system. + # + + rpm: all /bin/rpm + rm -f THIS.TCL.SPEC + echo "%define _builddir `pwd`" > THIS.TK.SPEC + echo "%define _rpmdir `pwd`/RPMS" >> THIS.TK.SPEC + cat tk.spec >> THIS.TK.SPEC + mkdir -p RPMS/i386 + rpm -bb THIS.TK.SPEC + mv RPMS/i386/*.rpm . + rm -rf RPMS THIS.TK.SPEC + + # + # Target to create a proper Tk distribution from information in the + # master source directory. DISTDIR must be defined to indicate where + # to put the distribution. DISTDIR must be an absolute path name. + # + + DISTROOT = /tmp/dist + DISTNAME = tk8.4a4 + ZIPNAME = tk84a4.zip + DISTDIR = $(DISTROOT)/$(DISTNAME) + TCLDIR = /home/ludwig/tcltk/patch3/tcl8.4a4 + $(UNIX_DIR)/configure: $(UNIX_DIR)/configure.in + autoconf $(UNIX_DIR)/configure.in > $(UNIX_DIR)/configure + + dist: $(UNIX_DIR)/configure + rm -rf $(DISTDIR) + mkdir -p $(DISTDIR) + mkdir $(DISTDIR)/unix + cp -p $(UNIX_DIR)/*.c $(UNIX_DIR)/*.h $(DISTDIR)/unix + cp $(TOP_DIR)/license.terms $(UNIX_DIR)/Makefile.in $(DISTDIR)/unix + chmod 664 $(DISTDIR)/unix/Makefile.in + cp $(UNIX_DIR)/configure $(UNIX_DIR)/configure.in $(UNIX_DIR)/tk.spec \ + $(UNIX_DIR)/aclocal.m4 $(UNIX_DIR)/tcl.m4 \ + $(UNIX_DIR)/tkConfig.sh.in $(TCLDIR)/unix/install-sh \ + $(UNIX_DIR)/README $(DISTDIR)/unix + chmod 775 $(DISTDIR)/unix/configure $(DISTDIR)/unix/configure.in + chmod +x $(DISTDIR)/unix/install-sh + $(TCL_EXE) $(TCLDIR)/unix/mkLinks.tcl $(TOP_DIR)/doc/*.[13n] \ + > $(DISTDIR)/unix/mkLinks + chmod +x $(DISTDIR)/unix/mkLinks + mkdir $(DISTDIR)/bitmaps + @(cd $(TOP_DIR); for i in bitmaps/* ; do \ + if [ -f $$i ] ; then \ + sed -e 's/static char/static unsigned char/' \ + $$i > $(DISTDIR)/$$i; \ + fi; \ + done;) + mkdir $(DISTDIR)/generic + cp -p $(GENERIC_DIR)/*.c $(GENERIC_DIR)/*.h $(GENERIC_DIR)/prolog.ps \ + $(DISTDIR)/generic + cp -p $(GENERIC_DIR)/*.decls $(DISTDIR)/generic + cp -p $(GENERIC_DIR)/README $(DISTDIR)/generic + cp -p $(TOP_DIR)/changes $(TOP_DIR)/ChangeLog $(TOP_DIR)/README \ + $(TOP_DIR)/license.terms $(DISTDIR) + rm -f $(DISTDIR)/generic/blt*.[ch] + mkdir $(DISTDIR)/win + cp $(TOP_DIR)/win/Makefile.in $(DISTDIR)/win + cp $(TOP_DIR)/win/configure.in \ + $(TOP_DIR)/win/configure \ + $(TOP_DIR)/win/tkConfig.sh.in \ + $(TOP_DIR)/win/aclocal.m4 $(TOP_DIR)/win/tcl.m4 \ + $(DISTDIR)/win + cp -p $(TOP_DIR)/win/*.c $(TOP_DIR)/win/*.h $(DISTDIR)/win + cp -p $(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/rc/*.rc $(TOP_DIR)/win/rc/*.cur \ + $(TOP_DIR)/win/rc/*.ico $(TOP_DIR)/win/rc/*.bmp \ + $(DISTDIR)/win/rc + mkdir $(DISTDIR)/mac + cp -p $(TOP_DIR)/mac/tkMacProjects.sea.hqx $(DISTDIR)/mac + cp -p $(TOP_DIR)/mac/*.c $(TOP_DIR)/mac/*.h $(TOP_DIR)/mac/*.r \ + $(DISTDIR)/mac + cp -p $(TOP_DIR)/mac/README $(DISTDIR)/mac + cp -p $(TOP_DIR)/license.terms $(DISTDIR)/mac + cp -p $(TOP_DIR)/mac/*.pch $(DISTDIR)/mac + cp -p $(TOP_DIR)/mac/*.doc $(DISTDIR)/mac + cp -p $(TOP_DIR)/mac/*.tcl $(DISTDIR)/mac + mkdir $(DISTDIR)/compat + cp -p $(TOP_DIR)/license.terms $(TCLDIR)/compat/unistd.h \ + $(TCLDIR)/compat/stdlib.h $(TCLDIR)/compat/limits.h \ + $(DISTDIR)/compat + mkdir $(DISTDIR)/xlib + cp -p $(TOP_DIR)/xlib/*.h $(TOP_DIR)/xlib/*.c $(DISTDIR)/xlib + cp -p $(TOP_DIR)/license.terms $(DISTDIR)/xlib + mkdir $(DISTDIR)/xlib/X11 + cp -p $(TOP_DIR)/xlib/X11/*.h $(DISTDIR)/xlib/X11 + cp -p $(TOP_DIR)/license.terms $(DISTDIR)/xlib/X11 + mkdir $(DISTDIR)/library + cp -p $(TOP_DIR)/license.terms $(TOP_DIR)/library/*.tcl \ + $(TOP_DIR)/library/tclIndex \ + $(DISTDIR)/library + mkdir $(DISTDIR)/library/images + @(cd $(TOP_DIR); for i in library/images/* ; do \ + if [ -f $$i ] ; then \ + cp $$i $(DISTDIR)/$$i; \ + fi; \ + done;) + mkdir $(DISTDIR)/library/msgs + @(cd $(TOP_DIR); for i in library/msgs/*.msg ; do \ + if [ -f $$i ] ; then \ + cp $$i $(DISTDIR)/$$i; \ + fi; \ + done;) + mkdir $(DISTDIR)/library/demos + cp -pr $(TOP_DIR)/library/demos/*.tcl \ + $(TOP_DIR)/library/demos/tclIndex \ + $(TOP_DIR)/library/demos/browse \ + $(TOP_DIR)/library/demos/hello $(TOP_DIR)/library/demos/ixset \ + $(TOP_DIR)/library/demos/rmt $(TOP_DIR)/library/demos/rolodex \ + $(TOP_DIR)/library/demos/square \ + $(TOP_DIR)/library/demos/tcolor \ + $(TOP_DIR)/library/demos/timer \ + $(TOP_DIR)/library/demos/widget \ + $(TOP_DIR)/library/demos/README \ + $(TOP_DIR)/license.terms $(DISTDIR)/library/demos + mkdir $(DISTDIR)/library/demos/images + @(cd $(TOP_DIR); for i in library/demos/images/* ; do \ + if [ -f $$i ] ; then \ + cp $$i $(DISTDIR)/$$i; \ + fi; \ + done;) + mkdir $(DISTDIR)/doc + cp -p $(TOP_DIR)/license.terms $(TOP_DIR)/doc/*.[13n] \ + $(TCLDIR)/doc/man.macros $(DISTDIR)/doc + mkdir $(DISTDIR)/tests + cp -p $(TOP_DIR)/license.terms $(TOP_DIR)/tests/*.test \ + $(TOP_DIR)/tests/*.tcl $(TOP_DIR)/tests/README \ + $(TOP_DIR)/tests/option.file* $(DISTDIR)/tests + + # + # The following target can only be used for non-patch releases. Use + # the "allpatch" target below for patch releases. + # + + alldist: dist + rm -f $(DISTROOT)/$(DISTNAME).tar.Z \ + $(DISTROOT)/$(DISTNAME).tar.gz \ + $(DISTROOT)/$(ZIPNAME) + cd $(DISTROOT); tar cf $(DISTNAME).tar $(DISTNAME); \ + gzip -9 -c $(DISTNAME).tar > $(DISTNAME).tar.gz; \ + compress $(DISTNAME).tar; zip -qr8 $(ZIPNAME) $(DISTNAME) + + # + # The target below is similar to "alldist" except it works for patch + # releases. It is needed because patch releases are peculiar: the + # patch designation appears in the name of the compressed file + # (e.g. tcl8.0p1.tar.gz) but the extracted source directory doesn't + # include the patch designation (e.g. tcl8.0). + # + + allpatch: dist + rm -f $(DISTROOT)/$(DISTNAME).tar.Z \ + $(DISTROOT)/$(DISTNAME).tar.gz \ + $(DISTROOT)/$(ZIPNAME) + mv $(DISTROOT)/tk${VERSION} $(DISTROOT)/old + mv $(DISTROOT)/$(DISTNAME) $(DISTROOT)/tk${VERSION} + cd $(DISTROOT); tar cf $(DISTNAME).tar tk${VERSION}; \ + gzip -9 -c $(DISTNAME).tar > $(DISTNAME).tar.gz; \ + compress $(DISTNAME).tar; zip -r8 $(ZIPNAME) tk${VERSION} + mv $(DISTROOT)/tk${VERSION} $(DISTROOT)/$(DISTNAME) + mv $(DISTROOT)/old $(DISTROOT)/tk${VERSION} + + # + # Target to create a Macintosh version of the distribution. This will + # do a normal distribution and then massage the output to prepare it + # for moving to the Mac platform. This requires a few scripts and + # programs found only in the Tcl greoup's tool workspace. + # + + macdist: dist + rm -f $(DISTDIR)/mac/tkMacProjects.sea.hqx + $(TCL_EXE) $(TOOL_DIR)/man2html.tcl $(DISTDIR)/tmp ../.. tk$(VERSION) + mv $(DISTDIR)/tmp/tk$(VERSION) $(DISTDIR)/html + rm -rf $(DISTDIR)/doc + rm -rf $(DISTDIR)/tmp + $(TCL_EXE) $(TOOL_DIR)/cvtEOL.tcl $(DISTDIR) + + # + # Targets to build Solaris package of the distribution for the current + # architecture. To build stream packages for both sun4 and i86pc + # architectures: + # + # On the sun4 machine, execute the following: + # make distclean; ./configure + # make DISTDIR= package + # + # Once the build is complete, execute the following on the i86pc + # machine: + # make DISTDIR= package-quick + # + # is the absolute path to a directory where the build should + # take place. These steps will generate the $(PACKAGE).sun4 and + # $(PACKAGE).i86pc stream packages. It is important that the packages be + # built in this fashion in order to ensure that the architecture + # independent files are exactly the same, including timestamps, in + # both packages. + # + + PACKAGE=SCRPtk + + package: dist package-config package-common package-binaries package-generate + package-quick: package-config package-binaries package-generate + + # + # Configure for the current architecture in the dist directory. + # + package-config: + mkdir -p $(DISTDIR)/unix/`arch` + cd $(DISTDIR)/unix/`arch`; \ + ../configure --prefix=/opt/SUNWtcl/$(TCLVERSION) \ + --exec_prefix=/opt/SUNWtcl/$(TCLVERSION)/`arch` \ + --with-tcl=$(DISTDIR)/../tcl$(TCLVERSION)/unix/`arch` \ + --enable-shared + mkdir -p $(DISTDIR)/SUNWtcl/$(TCLVERSION) + mkdir -p $(DISTDIR)/SUNWtcl/$(TCLVERSION)/`arch` + + # + # Build and install the architecture independent files in the dist directory. + # + + package-common: + cd $(DISTDIR)/unix/`arch`;\ + $(MAKE); \ + $(MAKE) install-libraries install-doc \ + prefix=$(DISTDIR)/SUNWtcl/$(TCLVERSION) \ + exec_prefix=$(DISTDIR)/SUNWtcl/$(TCLVERSION)/`arch` + mkdir -p $(DISTDIR)/SUNWtcl/$(TCLVERSION)/bin + sed -e "s/TCLVERSION/$(TCLVERSION)/g" \ + -e "s/TKVERSION/$(VERSION)/g" < $(UNIX_DIR)/wish.sh \ + > $(DISTDIR)/SUNWtcl/$(TCLVERSION)/bin/wish$(VERSION) + chmod 755 $(DISTDIR)/SUNWtcl/$(TCLVERSION)/bin/wish$(VERSION) + + # + # Build and install the architecture specific files in the dist directory. + # + + package-binaries: + cd $(DISTDIR)/unix/`arch`; \ + $(MAKE); \ + $(MAKE) install-binaries prefix=$(DISTDIR)/SUNWtcl/$(TCLVERSION) \ + exec_prefix=$(DISTDIR)/SUNWtcl/$(TCLVERSION)/`arch` + + # + # Generate a package from the installed files in the dist directory for the + # current architecture. + # + + package-generate: + pkgproto $(DISTDIR)/SUNWtcl/$(TCLVERSION)/bin=bin \ + $(DISTDIR)/SUNWtcl/$(TCLVERSION)/include=include \ + $(DISTDIR)/SUNWtcl/$(TCLVERSION)/lib=lib \ + $(DISTDIR)/SUNWtcl/$(TCLVERSION)/man=man \ + $(DISTDIR)/SUNWtcl/$(TCLVERSION)/`arch`=`arch` \ + | $(TCL_EXE) $(TCLDIR)/unix/mkProto.tcl $(TCLVERSION) \ + $(UNIX_DIR) > prototype + pkgmk -o -d . -f prototype -a `arch` + pkgtrans -s . $(PACKAGE).`arch` $(PACKAGE) + rm -rf $(PACKAGE) + + # DO NOT DELETE THIS LINE -- make depend depends on it. diff -c -P -r orig/tk8.4a4/unix/Makefile.in patch3/tk8.4a4/unix/Makefile.in *** orig/tk8.4a4/unix/Makefile.in Wed Mar 6 09:51:50 2002 --- patch3/tk8.4a4/unix/Makefile.in Fri Jun 21 07:18:36 2002 *************** *** 277,282 **** --- 277,284 ---- TEXTOBJS = tkText.o tkTextBTree.o tkTextDisp.o tkTextImage.o tkTextIndex.o \ tkTextMark.o tkTextTag.o tkTextWind.o + UNDOOBJS = tkUndo.o + UNIXOBJS = tkUnix.o tkUnix3d.o tkUnixButton.o tkUnixColor.o tkUnixConfig.o \ tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o \ tkUnixFocus.o tkUnixFont.o tkUnixInit.o tkUnixKey.o tkUnixMenu.o \ *************** *** 290,296 **** tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o tkGrid.o \ tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o tkPlace.o \ tkSelect.o tkUtil.o tkVisual.o tkWindow.o \ ! $(UNIXOBJS) $(WIDGOBJS) $(CANVOBJS) $(IMAGEOBJS) $(TEXTOBJS) TK_DECLS = \ $(GENERIC_DIR)/tk.decls \ --- 292,298 ---- tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o tkGrid.o \ tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o tkPlace.o \ tkSelect.o tkUtil.o tkVisual.o tkWindow.o \ ! $(UNIXOBJS) $(WIDGOBJS) $(CANVOBJS) $(IMAGEOBJS) $(TEXTOBJS) $(UNDOOBJS) TK_DECLS = \ $(GENERIC_DIR)/tk.decls \ *************** *** 335,340 **** --- 337,343 ---- $(GENERIC_DIR)/tkOldConfig.c \ $(GENERIC_DIR)/tkSquare.c $(GENERIC_DIR)/tkTest.c \ $(GENERIC_DIR)/tkStubInit.c $(GENERIC_DIR)/tkStubLib.c \ + $(GENERIC_DIR)/tkUndo.c \ $(UNIX_DIR)/tkAppInit.c $(UNIX_DIR)/tkUnix.c \ $(UNIX_DIR)/tkUnix3d.c \ $(UNIX_DIR)/tkUnixButton.c $(UNIX_DIR)/tkUnixColor.c \ *************** *** 884,889 **** --- 887,895 ---- tkStubImg.o: $(GENERIC_DIR)/tkStubImg.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkStubImg.c + tkUndo.o: $(GENERIC_DIR)/tkUndo.c + $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkUndo.c + tkUnix.o: $(UNIX_DIR)/tkUnix.c $(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnix.c diff -c -P -r orig/tk8.4a4/unix/config.cache patch3/tk8.4a4/unix/config.cache *** orig/tk8.4a4/unix/config.cache Thu Jan 1 01:00:00 1970 --- patch3/tk8.4a4/unix/config.cache Fri Jun 21 07:33:46 2002 *************** *** 0 **** --- 1,47 ---- + # This file is a shell script that caches the results of configure + # tests run on this system so they can be shared between configure + # scripts and configure runs. It is not useful on other systems. + # If it contains results you don't want to keep, you may remove or edit it. + # + # By default, configure uses ./config.cache as the cache file, + # creating it if it does not exist already. You can give configure + # the --cache-file=FILE option to use a different cache file; that is + # what configure does when it calls configure scripts in + # subdirectories, so they share the cache. + # Giving --cache-file=/dev/null disables caching, for debugging configure. + # config.status only pays attention to the cache file if you give it the + # --recheck option to rerun configure. + # + ac_cv_c_char_unsigned=${ac_cv_c_char_unsigned=no} + ac_cv_c_tclconfig=${ac_cv_c_tclconfig=/home/ludwig/tcltk/patch3/tcl8.4a4/unix} + ac_cv_func_connect=${ac_cv_func_connect=yes} + ac_cv_func_gethostbyname=${ac_cv_func_gethostbyname=yes} + ac_cv_func_sin=${ac_cv_func_sin=no} + ac_cv_func_strtod=${ac_cv_func_strtod=yes} + ac_cv_have_x=${ac_cv_have_x=$'have_x=yes \t\tac_x_includes=/usr/X11R6/include ac_x_libraries=/usr/X11R6/lib'} + ac_cv_header_limits_h=${ac_cv_header_limits_h=yes} + ac_cv_header_stdc=${ac_cv_header_stdc=yes} + ac_cv_header_sys_time_h=${ac_cv_header_sys_time_h=yes} + ac_cv_header_time=${ac_cv_header_time=yes} + ac_cv_header_unistd_h=${ac_cv_header_unistd_h=yes} + ac_cv_lib_Xbsd_main=${ac_cv_lib_Xbsd_main=no} + ac_cv_lib_dl_dlopen=${ac_cv_lib_dl_dlopen=yes} + ac_cv_lib_ieee_main=${ac_cv_lib_ieee_main=yes} + ac_cv_prog_AR=${ac_cv_prog_AR=ar} + ac_cv_prog_CC=${ac_cv_prog_CC=gcc} + ac_cv_prog_CPP=${ac_cv_prog_CPP=$'gcc -E'} + ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB=ranlib} + ac_cv_prog_cc_cross=${ac_cv_prog_cc_cross=no} + ac_cv_prog_cc_g=${ac_cv_prog_cc_g=yes} + ac_cv_prog_cc_works=${ac_cv_prog_cc_works=yes} + ac_cv_prog_gcc=${ac_cv_prog_gcc=yes} + ac_cv_type_mode_t=${ac_cv_type_mode_t=yes} + ac_cv_type_pid_t=${ac_cv_type_pid_t=yes} + ac_cv_type_size_t=${ac_cv_type_size_t=yes} + ac_cv_type_uid_t=${ac_cv_type_uid_t=yes} + tcl_cv_flag__isoc99_source=${tcl_cv_flag__isoc99_source=no} + tcl_cv_flag__largefile64_source=${tcl_cv_flag__largefile64_source=yes} + tcl_cv_struct_dirent64=${tcl_cv_struct_dirent64=no} + tcl_cv_struct_stat64=${tcl_cv_struct_stat64=yes} + tcl_cv_type_64bit=${tcl_cv_type_64bit=$'long long'} + tcl_cv_type_off64_t=${tcl_cv_type_off64_t=yes} diff -c -P -r orig/tk8.4a4/unix/config.log patch3/tk8.4a4/unix/config.log *** orig/tk8.4a4/unix/config.log Thu Jan 1 01:00:00 1970 --- patch3/tk8.4a4/unix/config.log Fri Jun 21 07:33:46 2002 *************** *** 0 **** --- 1,145 ---- + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. + + configure:578: checking for gcc + configure:691: checking whether the C compiler (gcc ) works + configure:707: gcc -o conftest conftest.c 1>&5 + configure:733: checking whether the C compiler (gcc ) is a cross-compiler + configure:738: checking whether we are using GNU C + configure:747: gcc -E conftest.c + configure:766: checking whether gcc accepts -g + configure:800: checking for ranlib + configure:833: checking how to run the C preprocessor + configure:854: gcc -E conftest.c >/dev/null 2>conftest.out + configure:916: checking for unistd.h + configure:926: gcc -E conftest.c >/dev/null 2>conftest.out + configure:916: checking for limits.h + configure:926: gcc -E conftest.c >/dev/null 2>conftest.out + configure:959: checking for building with threads + configure:1290: checking if the compiler understands -pipe + configure:1301: gcc -pipe -c conftest.c 1>&5 + configure:1321: checking for required early compiler flags + configure:1335: gcc -pipe -c conftest.c 1>&5 + configure:1384: gcc -pipe -c conftest.c 1>&5 + configure: In function `main': + configure:1380: storage size of `buf' isn't known + configure: failed program was: + #line 1377 "configure" + #include "confdefs.h" + #include + int main() { + struct stat64 buf; int i = stat64("/", &buf); + ; return 0; } + configure:1400: gcc -pipe -c conftest.c 1>&5 + configure:1429: checking for 64-bit integer type + configure:1442: gcc -pipe -c conftest.c 1>&5 + configure: In function `main': + configure:1438: `__int64' undeclared (first use in this function) + configure:1438: (Each undeclared identifier is reported only once + configure:1438: for each function it appears in.) + configure:1438: parse error before `value' + configure: failed program was: + #line 1435 "configure" + #include "confdefs.h" + + int main() { + __int64 value = (__int64) 0; + ; return 0; } + configure:1460: gcc -pipe -o conftest conftest.c 1>&5 + configure:1485: checking for struct dirent64 + configure:1499: gcc -pipe -c conftest.c 1>&5 + configure:1493:24: sys/dirent.h: No such file or directory + configure: In function `main': + configure:1495: storage size of `p' isn't known + configure: failed program was: + #line 1491 "configure" + #include "confdefs.h" + #include + #include + int main() { + struct dirent64 p; + ; return 0; } + configure:1520: checking for struct stat64 + configure:1534: gcc -pipe -c conftest.c 1>&5 + configure:1555: checking for off64_t + configure:1569: gcc -pipe -c conftest.c 1>&5 + configure:1611: checking for Tcl configuration + configure:1684: checking for existence of /home/ludwig/tcltk/patch3/tcl8.4a4/unix/tclConfig.sh + configure:1742: checking if 64bit support is requested + configure:1762: checking if 64bit Sparc VIS support is requested + configure:1786: checking system version (for dynamic loading) + configure:1812: checking for dlopen in -ldl + configure:1831: gcc -pipe -o conftest conftest.c -ldl 1>&5 + configure:1875: checking for ar + configure:3012: checking for build with symbols + configure:3056: checking for sin + configure:3084: gcc -pipe -o conftest -rdynamic conftest.c 1>&5 + configure:3068: warning: conflicting types for built-in function `sin' + /tmp/ccOt9PPx.o: In function `main': + /tmp/ccOt9PPx.o(.text+0x7): undefined reference to `sin' + collect2: ld returned 1 exit status + configure: failed program was: + #line 3061 "configure" + #include "confdefs.h" + /* System header to define __stub macros and hopefully few prototypes, + which can conflict with char sin(); below. */ + #include + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char sin(); + + int main() { + + /* 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_sin) || defined (__stub___sin) + choke me + #else + sin(); + #endif + + ; return 0; } + configure:3105: checking for main in -lieee + configure:3120: gcc -pipe -o conftest -rdynamic conftest.c -lieee 1>&5 + configure:3201: checking stdlib.h + configure:3264: checking fd_set and sys/select + configure:3273: gcc -pipe -c conftest.c 1>&5 + configure:3317: checking for ANSI C header files + configure:3330: gcc -E conftest.c >/dev/null 2>conftest.out + configure:3397: gcc -pipe -o conftest -rdynamic conftest.c 1>&5 + configure:3421: checking for mode_t + configure:3454: checking for pid_t + configure:3487: checking for size_t + configure:3520: checking for uid_t in sys/types.h + configure:3562: checking for sys/time.h + configure:3572: gcc -E conftest.c >/dev/null 2>conftest.out + configure:3599: checking whether time.h and sys/time.h may both be included + configure:3613: gcc -pipe -c conftest.c 1>&5 + configure:3639: checking pw_gecos in struct pwd + configure:3648: gcc -pipe -c conftest.c 1>&5 + configure:3681: checking for X + configure:4107: checking for main in -lXbsd + configure:4122: gcc -pipe -o conftest -rdynamic conftest.c -lXbsd 1>&5 + /usr/bin/ld: cannot find -lXbsd + collect2: ld returned 1 exit status + configure: failed program was: + #line 4115 "configure" + #include "confdefs.h" + + int main() { + main() + ; return 0; } + configure:4145: checking for connect + configure:4173: gcc -pipe -o conftest -rdynamic conftest.c 1>&5 + configure:4286: checking for gethostbyname + configure:4314: gcc -pipe -o conftest -rdynamic conftest.c 1>&5 + configure:4431: checking for sin + configure:4480: checking for main in -lieee + configure:4522: checking whether char is unsigned + configure:4594: checking for strtod + configure:4622: gcc -pipe -o conftest -rdynamic conftest.c 1>&5 + configure:4644: checking for Solaris2.4/Tru64 strtod bugs + configure:4669: gcc -pipe -o conftest -rdynamic conftest.c 1>&5 + configure:4701: checking how to build libraries diff -c -P -r orig/tk8.4a4/unix/config.status patch3/tk8.4a4/unix/config.status *** orig/tk8.4a4/unix/config.status Thu Jan 1 01:00:00 1970 --- patch3/tk8.4a4/unix/config.status Fri Jun 21 07:33:46 2002 *************** *** 0 **** --- 1,208 ---- + #! /bin/sh + # Generated automatically by configure. + # Run this file to recreate the current configuration. + # This directory was configured as follows, + # on host localhost.localdomain: + # + # ./configure + # + # Compiler output produced by configure, useful for debugging + # configure, is in ./config.log if it exists. + + ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]" + for ac_option + do + case "$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion" + exec ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "./config.status generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "$ac_cs_usage"; exit 0 ;; + *) echo "$ac_cs_usage"; exit 1 ;; + esac + done + + ac_given_srcdir=/home/ludwig/tcltk/patch3/tk8.4a4/unix + + trap 'rm -fr Makefile tkConfig.sh conftest*; exit 1' 1 2 15 + + # Protect against being on the right side of a sed subst in config.status. + sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g; + s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF + + + s%@SHELL@%/bin/sh%g + s%@CFLAGS@%%g + s%@CPPFLAGS@%%g + s%@CXXFLAGS@%%g + s%@FFLAGS@%%g + s%@DEFS@% -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_PW_GECOS=1 %g + s%@LDFLAGS@%-rdynamic%g + s%@LIBS@%%g + s%@exec_prefix@%/usr/local%g + s%@prefix@%/usr/local%g + s%@program_transform_name@%s,x,x,%g + s%@bindir@%${exec_prefix}/bin%g + s%@sbindir@%${exec_prefix}/sbin%g + s%@libexecdir@%${exec_prefix}/libexec%g + s%@datadir@%${prefix}/share%g + s%@sysconfdir@%${prefix}/etc%g + s%@sharedstatedir@%${prefix}/com%g + s%@localstatedir@%${prefix}/var%g + s%@libdir@%/usr/local/lib%g + s%@includedir@%${prefix}/include%g + s%@oldincludedir@%/usr/include%g + s%@infodir@%${prefix}/info%g + s%@mandir@%${prefix}/man%g + s%@CC@%gcc -pipe%g + s%@RANLIB@%:%g + s%@CPP@%gcc -E%g + s%@TCL_THREADS@%0%g + s%@TCL_VERSION@%8.4%g + s%@TCL_BIN_DIR@%/home/ludwig/tcltk/patch3/tcl8.4a4/unix%g + s%@TCL_SRC_DIR@%/home/ludwig/tcltk/patch3/tcl8.4a4%g + s%@TCL_LIB_FILE@%libtcl8.4.so%g + s%@TCL_LIB_FLAG@%-ltcl8.4%g + s%@TCL_LIB_SPEC@%-L/home/ludwig/tcltk/patch3/tcl8.4a4/unix -ltcl8.4%g + s%@TCL_STUB_LIB_FILE@%libtclstub8.4.a%g + s%@TCL_STUB_LIB_FLAG@%-ltclstub8.4%g + s%@TCL_STUB_LIB_SPEC@%-L/home/ludwig/tcltk/patch3/tcl8.4a4/unix -ltclstub8.4%g + s%@AR@%ar%g + s%@DL_LIBS@%-ldl%g + s%@CFLAGS_DEBUG@%-g%g + s%@CFLAGS_OPTIMIZE@%-O -D__NO_STRING_INLINES -D__NO_MATH_INLINES%g + s%@CFLAGS_WARNING@%-Wall -Wconversion -Wno-implicit-int%g + s%@TK_VERSION@%8.4%g + s%@TK_MAJOR_VERSION@%8%g + s%@TK_MINOR_VERSION@%4%g + s%@TK_PATCH_LEVEL@%a4%g + s%@TK_DBGX@%%g + s%@TK_STUB_LIB_FILE@%libtkstub8.4.a%g + s%@TK_STUB_LIB_FLAG@%-ltkstub8.4%g + s%@TK_BUILD_STUB_LIB_SPEC@%-L/home/ludwig/tcltk/patch3/tk8.4a4/unix -ltkstub8.4%g + s%@TK_STUB_LIB_SPEC@%-L/usr/local/lib -ltkstub8.4%g + s%@TK_BUILD_STUB_LIB_PATH@%/home/ludwig/tcltk/patch3/tk8.4a4/unix/libtkstub8.4.a%g + s%@TK_STUB_LIB_PATH@%/usr/local/lib/libtkstub8.4.a%g + s%@MAKE_STUB_LIB@%${STLIB_LD} $@ ${STUB_LIB_OBJS}%g + s%@TK_STUB_FLAGS@%%g + s%@TK_BUILD_EXP_FILE@%%g + s%@TK_EXP_FILE@%%g + s%@TCL_STUB_FLAGS@%-DUSE_TCL_STUBS%g + s%@CFLAGS_DEFAULT@%$(CFLAGS_OPTIMIZE)%g + s%@LDFLAGS_DEFAULT@%$(LDFLAGS_OPTIMIZE)%g + s%@LDFLAGS_DEBUG@%%g + s%@LDFLAGS_OPTIMIZE@%%g + s%@EXTRA_CFLAGS@%%g + s%@MATH_LIBS@%-lieee -lm%g + s%@MAKE_LIB@%${SHLIB_LD} -o $@ ${OBJS} $(TK_LD_SEARCH_FLAGS) ${TCL_STUB_LIB_SPEC} ${SHLIB_LD_LIBS}%g + s%@SHLIB_CFLAGS@%-fPIC%g + s%@TK_SHLIB_CFLAGS@%-fPIC%g + s%@STLIB_LD@%${AR} cr%g + s%@SHLIB_LD@%gcc -pipe -shared%g + s%@SHLIB_LD_LIBS@%${LIBS}%g + s%@SHLIB_SUFFIX@%.so%g + s%@SHLIB_VERSION@%%g + s%@TK_BUILD_LIB_SPEC@%-L/home/ludwig/tcltk/patch3/tk8.4a4/unix -ltk8.4%g + s%@TK_CC_SEARCH_FLAGS@%-Wl,-rpath,${LIB_RUNTIME_DIR}:/usr/X11R6/lib%g + s%@TK_LD_SEARCH_FLAGS@%-Wl,-rpath,${LIB_RUNTIME_DIR}:/usr/X11R6/lib%g + s%@TK_LIB_FILE@%libtk8.4.so%g + s%@TK_LIB_FLAG@%-ltk8.4%g + s%@TK_LIB_SPEC@%-L/usr/local/lib -ltk8.4%g + s%@TK_SRC_DIR@%/home/ludwig/tcltk/patch3/tk8.4a4%g + s%@XINCLUDES@%-I/usr/X11R6/include%g + s%@XLIBSW@%-L/usr/X11R6/lib -lX11%g + s%@TK_SHARED_BUILD@%1%g + s%@LOCALES@%de en es fr%g + + CEOF + + # 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_cmds=90 # Maximum number of lines to put in a sed script. + ac_file=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_cmds # 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" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi + + CONFIG_FILES=${CONFIG_FILES-"Makefile tkConfig.sh"} + for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ + # $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub + s%@configure_input@%$configure_input%g + s%@srcdir@%$srcdir%g + s%@top_srcdir@%$top_srcdir%g + " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file + fi; done + rm -f conftest.s* + + + + exit 0 diff -c -P -r orig/tk8.4a4/unix/tkConfig.sh patch3/tk8.4a4/unix/tkConfig.sh *** orig/tk8.4a4/unix/tkConfig.sh Thu Jan 1 01:00:00 1970 --- patch3/tk8.4a4/unix/tkConfig.sh Fri Jun 21 07:33:51 2002 *************** *** 0 **** --- 1,93 ---- + # 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. + # This script is intended to be included by the configure scripts + # for Tk extensions so that they don't have to figure this all + # out for themselves. This file does not duplicate information + # already provided by tclConfig.sh, so you may need to use that + # file in addition to this one. + # + # The information in this file is specific to a single platform. + # + # RCS: @(#) $Id: tkConfig.sh.in,v 1.7 1999/03/10 07:04:45 stanton Exp $ + + # Tk's version number. + TK_VERSION='8.4' + TK_MAJOR_VERSION='8' + TK_MINOR_VERSION='4' + TK_PATCH_LEVEL='a4' + + # -D flags for use with the C compiler. + TK_DEFS=' -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_PW_GECOS=1 ' + + # Flag, 1: we built a shared lib, 0 we didn't + TK_SHARED_BUILD=1 + + # This indicates if Tk was build with debugging symbols + TK_DBGX= + + # The name of the Tk library (may be either a .a file or a shared library): + TK_LIB_FILE='libtk8.4.so' + + # Additional libraries to use when linking Tk. + TK_LIBS='-L/usr/X11R6/lib -lX11 -ldl -lieee -lm' + + # Top-level directory in which Tcl's platform-independent files are + # installed. + TK_PREFIX='/usr/local' + + # Top-level directory in which Tcl's platform-specific files (e.g. + # executables) are installed. + TK_EXEC_PREFIX='/usr/local' + + # -I switch(es) to use to make all of the X11 include files accessible: + TK_XINCLUDES='-I/usr/X11R6/include' + + # Linker switch(es) to use to link with the X11 library archive. + TK_XLIBSW='-L/usr/X11R6/lib -lX11' + + # -l flag to pass to the linker to pick up the Tcl library + TK_LIB_FLAG='-ltk8.4' + + # String to pass to linker to pick up the Tk library from its + # build directory. + TK_BUILD_LIB_SPEC='-L/home/ludwig/tcltk/patch3/tk8.4a4/unix -ltk8.4' + + # String to pass to linker to pick up the Tk library from its + # installed directory. + TK_LIB_SPEC='-L/usr/local/lib -ltk8.4' + + # Location of the top-level source directory from which Tk was built. + # This is the directory that contains a README file as well as + # subdirectories such as generic, unix, etc. If Tk was compiled in a + # different place than the directory containing the source files, this + # points to the location of the sources, not the location where Tk was + # compiled. + TK_SRC_DIR='/home/ludwig/tcltk/patch3/tk8.4a4' + + # Needed if you want to make a 'fat' shared library library + # containing tk objects or link a different wish. + TK_CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}:/usr/X11R6/lib' + TK_LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}:/usr/X11R6/lib' + + # The name of the Tk stub library (.a): + TK_STUB_LIB_FILE='libtkstub8.4.a' + + # -l flag to pass to the linker to pick up the Tk stub library + TK_STUB_LIB_FLAG='-ltkstub8.4' + + # String to pass to linker to pick up the Tk stub library from its + # build directory. + TK_BUILD_STUB_LIB_SPEC='-L/home/ludwig/tcltk/patch3/tk8.4a4/unix -ltkstub8.4' + + # String to pass to linker to pick up the Tk stub library from its + # installed directory. + TK_STUB_LIB_SPEC='-L/usr/local/lib -ltkstub8.4' + + # Path to the Tk stub library in the build directory. + TK_BUILD_STUB_LIB_PATH='/home/ludwig/tcltk/patch3/tk8.4a4/unix/libtkstub8.4.a' + + # Path to the Tk stub library in the install directory. + TK_STUB_LIB_PATH='/usr/local/lib/libtkstub8.4.a' diff -c -P -r orig/tk8.4a4/unix/tkUnixDefault.h patch3/tk8.4a4/unix/tkUnixDefault.h *** orig/tk8.4a4/unix/tkUnixDefault.h Fri Feb 22 22:07:05 2002 --- patch3/tk8.4a4/unix/tkUnixDefault.h Fri Jun 21 19:23:23 2002 *************** *** 475,480 **** --- 475,481 ---- #define DEF_TEXT_INSERT_OFF_TIME "300" #define DEF_TEXT_INSERT_ON_TIME "600" #define DEF_TEXT_INSERT_WIDTH "2" + #define DEF_TEXT_MAX_UNDO "0" #define DEF_TEXT_PADX "1" #define DEF_TEXT_PADY "1" #define DEF_TEXT_RELIEF "sunken" diff -c -P -r orig/tk8.4a4/win/Makefile.in patch3/tk8.4a4/win/Makefile.in *** orig/tk8.4a4/win/Makefile.in Wed Mar 6 09:51:52 2002 --- patch3/tk8.4a4/win/Makefile.in Fri Jun 21 07:18:36 2002 *************** *** 339,344 **** --- 339,345 ---- tkTextTag.$(OBJEXT) \ tkTextWind.$(OBJEXT) \ tkTrig.$(OBJEXT) \ + tkUndo.$(OBJEXT) \ tkUtil.$(OBJEXT) \ tkVisual.$(OBJEXT) \ tkStubInit.$(OBJEXT) \ diff -c -P -r orig/tk8.4a4/win/tkWinDefault.h patch3/tk8.4a4/win/tkWinDefault.h *** orig/tk8.4a4/win/tkWinDefault.h Fri Feb 22 22:07:05 2002 --- patch3/tk8.4a4/win/tkWinDefault.h Fri Jun 21 20:00:23 2002 *************** *** 480,485 **** --- 480,486 ---- #define DEF_TEXT_INSERT_OFF_TIME "300" #define DEF_TEXT_INSERT_ON_TIME "600" #define DEF_TEXT_INSERT_WIDTH "2" + #define DEF_TEXT_MAX_UNDO "0" #define DEF_TEXT_PADX "1" #define DEF_TEXT_PADY "1" #define DEF_TEXT_RELIEF "sunken"