2
===================================================================
3
RCS file: /usr/local/cvs/debian/expect/configure.in,v
4
retrieving revision 1.9
5
diff -u -r1.9 configure.in
6
--- configure.in 17 Aug 2004 07:20:43 -0000 1.9
7
+++ configure.in 17 Aug 2004 08:30:51 -0000
9
AC_MSG_RESULT(unshared)
12
+# now see if we can/should use Tcl stubs
13
+AC_MSG_CHECKING([whether to use Tcl stubs])
15
+ [ --enable-stubs use Tcl stubs, if available],
16
+ [enable_stubs=$enableval], [enable_stubs=no])
17
+if test "$enable_shared" = "yes" && test "$enable_stubs" = "yes" && test "x${TCL_SUPPORTS_STUBS}" = "x1"; then
19
+ EXP_CFLAGS="$EXP_CFLAGS -DUSE_TCL_STUBS"
25
# Now that we've found the Tcl sources, configure the debugger
26
# this is a little tricky because it has its own configure script
27
@@ -1174,7 +1186,11 @@
29
# seems a little strange to build in Tcl's build-lib, but
30
# that's what Tk does.
31
- EXP_SHLIB_LD_LIBS="$TCL_BUILD_LIB_SPEC $TCL_DL_LIBS $LIBS -lc"
32
+ if test "$enable_stubs" = "yes"; then
33
+ EXP_SHLIB_LD_LIBS="$TCL_BUILD_STUB_LIB_SPEC $TCL_DL_LIBS $LIBS $LIBS -lc"
35
+ EXP_SHLIB_LD_LIBS="$TCL_BUILD_LIB_SPEC $TCL_DL_LIBS $LIBS -lc"
39
#--------------------------------------------------------------------
41
===================================================================
42
RCS file: /usr/local/cvs/debian/expect/exp_command.c,v
43
retrieving revision 1.10
44
diff -u -r1.10 exp_command.c
45
--- exp_command.c 17 Aug 2004 08:30:46 -0000 1.10
46
+++ exp_command.c 17 Aug 2004 08:30:51 -0000
48
static Tcl_HashTable slaveNames;
49
#endif /* HAVE_PTYTRAP */
51
+/* These save the original functions so they can be used later. */
52
+Tcl_CmdInfo exp_close_info;
53
+Tcl_CmdInfo exp_return_info;
55
typedef struct ThreadSpecificData {
57
* List of all exp channels currently open. This is per thread and is
58
@@ -2306,12 +2310,9 @@
59
/* Historical note: we used "close" long before there was a */
60
/* Tcl builtin by the same name. */
63
Tcl_ResetResult(interp);
64
- if (0 == Tcl_GetCommandInfo(interp,"close",&info)) {
65
- info.clientData = 0;
67
- return(Tcl_CloseObjCmd(info.clientData,interp,objc_orig,objv_orig));
69
+ return(exp_close_info.objProc(exp_close_info.objClientData,interp,objc_orig,objv_orig));
74
/* if successful (i.e., TCL_RETURN is returned) */
75
/* modify the result, so that we will handle it specially */
77
- int result = Tcl_ReturnObjCmd(clientData,interp,objc,objv);
78
+ int result = exp_return_info.objProc(exp_return_info.objClientData,interp,objc,objv);
79
if (result == TCL_RETURN)
80
result = EXP_TCL_RETURN;
83
===================================================================
84
RCS file: /usr/local/cvs/debian/expect/exp_command.h,v
85
retrieving revision 1.9
86
diff -u -r1.9 exp_command.h
87
--- exp_command.h 17 Aug 2004 08:30:43 -0000 1.9
88
+++ exp_command.h 17 Aug 2004 08:30:51 -0000
90
EXTERN int exp_default_rm_nulls;
91
EXTERN int exp_default_close_on_eof;
93
+EXTERN Tcl_CmdInfo exp_close_info;
94
+EXTERN Tcl_CmdInfo exp_return_info;
96
EXTERN int exp_one_arg_braced _ANSI_ARGS_((Tcl_Obj *));
97
EXTERN int exp_eval_with_one_arg _ANSI_ARGS_((ClientData,
98
Tcl_Interp *, struct Tcl_Obj * CONST objv[]));
100
===================================================================
101
RCS file: /usr/local/cvs/debian/expect/exp_main_exp.c,v
102
retrieving revision 1.5
103
diff -u -r1.5 exp_main_exp.c
104
--- exp_main_exp.c 17 Aug 2004 07:09:41 -0000 1.5
105
+++ exp_main_exp.c 17 Aug 2004 08:30:51 -0000
107
would appreciate credit if this program or parts of it are used.
110
+/* Don't use stubs since we are in the main application. */
111
+#undef USE_TCL_STUBS
113
#include "expect_cf.h"
116
Index: exp_main_sub.c
117
===================================================================
118
RCS file: /usr/local/cvs/debian/expect/exp_main_sub.c,v
119
retrieving revision 1.6
120
diff -u -r1.6 exp_main_sub.c
121
--- exp_main_sub.c 17 Aug 2004 07:20:43 -0000 1.6
122
+++ exp_main_sub.c 17 Aug 2004 08:30:51 -0000
124
char *dot = strchr(TCL_VERSION,'.');
125
int tcl_minor = atoi(dot+1);
127
+#ifndef USE_TCL_STUBS
128
if (tcl_major < NEED_TCL_MAJOR ||
129
(tcl_major == NEED_TCL_MAJOR && tcl_minor < NEED_TCL_MINOR)) {
130
sprintf(interp->result,
132
if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 0) == NULL) {
136
+ if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
141
+ if (Tcl_GetCommandInfo(interp, "close", &exp_close_info) == 0) {
144
+ if (Tcl_GetCommandInfo(interp, "return", &exp_return_info) == 0) {
148
if (Tcl_PkgProvide(interp, "Expect", EXP_VERSION) != TCL_OK) {
152
===================================================================
153
RCS file: /usr/local/cvs/debian/expect/exp_main_tk.c,v
154
retrieving revision 1.6
155
diff -u -r1.6 exp_main_tk.c
156
--- exp_main_tk.c 17 Aug 2004 08:30:45 -0000 1.6
157
+++ exp_main_tk.c 17 Aug 2004 08:30:51 -0000
159
static char sccsid[] = "@(#) tkAppInit.c 1.19 95/12/23 17:09:24";
160
#endif /* not lint */
162
+/* Don't use stubs since we are in the main application. */
163
+#undef USE_TCL_STUBS
166
#include <string.h> /* strrchr(3) */