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