~ubuntu-branches/ubuntu/intrepid/expect-tcl8.3/intrepid

« back to all changes in this revision

Viewing changes to debian/patches/stubs

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2007-09-20 19:04:00 UTC
  • Revision ID: james.westby@ubuntu.com-20070920190400-d5h8lmy5wkgblvt3
Tags: 5.43.0-5.1
Merge in changes from expect 5.43.0-13.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: configure.in
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
8
 
@@ -319,6 +319,18 @@
9
 
   AC_MSG_RESULT(unshared)
10
 
 fi
11
 
 
12
 
+# now see if we can/should use Tcl stubs
13
 
+AC_MSG_CHECKING([whether to use Tcl stubs])
14
 
+AC_ARG_ENABLE(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
18
 
+  AC_MSG_RESULT(yes)
19
 
+  EXP_CFLAGS="$EXP_CFLAGS -DUSE_TCL_STUBS"
20
 
+else
21
 
+  AC_MSG_RESULT(no)
22
 
+fi
23
 
+
24
 
 #
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 @@
28
 
 else
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"
34
 
+       else
35
 
+         EXP_SHLIB_LD_LIBS="$TCL_BUILD_LIB_SPEC $TCL_DL_LIBS $LIBS -lc"
36
 
+       fi
37
 
 fi
38
 
 
39
 
 #--------------------------------------------------------------------
40
 
Index: exp_command.c
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
47
 
@@ -123,6 +123,10 @@
48
 
 static Tcl_HashTable slaveNames;
49
 
 #endif /* HAVE_PTYTRAP */
50
 
 
51
 
+/* These save the original functions so they can be used later. */
52
 
+Tcl_CmdInfo exp_close_info;
53
 
+Tcl_CmdInfo exp_return_info;
54
 
+
55
 
 typedef struct ThreadSpecificData {
56
 
     /*
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. */
61
 
 
62
 
-       Tcl_CmdInfo info;
63
 
        Tcl_ResetResult(interp);
64
 
-       if (0 == Tcl_GetCommandInfo(interp,"close",&info)) {
65
 
-           info.clientData = 0;
66
 
-       }
67
 
-       return(Tcl_CloseObjCmd(info.clientData,interp,objc_orig,objv_orig));
68
 
+           
69
 
+       return(exp_close_info.objProc(exp_close_info.objClientData,interp,objc_orig,objv_orig));
70
 
     }
71
 
 
72
 
     if (chanName) {
73
 
@@ -2956,7 +2957,7 @@
74
 
     /* if successful (i.e., TCL_RETURN is returned) */
75
 
     /* modify the result, so that we will handle it specially */
76
 
 
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;
81
 
     return result;
82
 
Index: exp_command.h
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
89
 
@@ -35,6 +35,9 @@
90
 
 EXTERN int exp_default_rm_nulls;
91
 
 EXTERN int exp_default_close_on_eof;
92
 
 
93
 
+EXTERN Tcl_CmdInfo exp_close_info;
94
 
+EXTERN Tcl_CmdInfo exp_return_info;
95
 
+
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[]));
99
 
Index: exp_main_exp.c
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
106
 
@@ -7,6 +7,9 @@
107
 
 would appreciate credit if this program or parts of it are used.
108
 
 */
109
 
 
110
 
+/* Don't use stubs since we are in the main application. */
111
 
+#undef USE_TCL_STUBS
112
 
+
113
 
 #include "expect_cf.h"
114
 
 #include <stdio.h>
115
 
 #include "tcl.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
123
 
@@ -486,6 +486,7 @@
124
 
        char *dot = strchr(TCL_VERSION,'.');
125
 
        int tcl_minor = atoi(dot+1);
126
 
 
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,
131
 
@@ -499,6 +500,19 @@
132
 
     if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 0) == NULL) {
133
 
       return TCL_ERROR;
134
 
     }
135
 
+#else
136
 
+    if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
137
 
+      return TCL_ERROR;
138
 
+    }
139
 
+#endif
140
 
+
141
 
+    if (Tcl_GetCommandInfo(interp, "close", &exp_close_info) == 0) {
142
 
+      return TCL_ERROR;
143
 
+    }
144
 
+    if (Tcl_GetCommandInfo(interp, "return", &exp_return_info) == 0) {
145
 
+      return TCL_ERROR;
146
 
+    }
147
 
148
 
     if (Tcl_PkgProvide(interp, "Expect", EXP_VERSION) != TCL_OK) {
149
 
       return TCL_ERROR;
150
 
     }
151
 
Index: exp_main_tk.c
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
158
 
@@ -32,6 +32,9 @@
159
 
 static char sccsid[] = "@(#) tkAppInit.c 1.19 95/12/23 17:09:24";
160
 
 #endif /* not lint */
161
 
 
162
 
+/* Don't use stubs since we are in the main application. */
163
 
+#undef USE_TCL_STUBS
164
 
+
165
 
 #include <ctype.h>
166
 
 #include <string.h>  /* strrchr(3) */
167