summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/expect/xcode_12.patch
blob: f7ae9e459732f9b75dab6ab5541552921549e147 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
https://core.tcl-lang.org/expect/tktview/0d5b33c00e5b4bbedb835498b0360d7115e832a0
--- expect5.45.4/configure.in.ORIG	2020-12-05 17:26:55.000000000 +0000
+++ expect5.45.4/configure.in	2020-12-05 18:39:00.000000000 +0000
@@ -452,7 +452,11 @@
 # because Unixware 2.0 handles it specially and refuses to compile
 # autoconf's automatic test that is a call with no arguments
 AC_MSG_CHECKING([for memcpy])
-AC_TRY_LINK(,[
+AC_TRY_LINK([
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+],[
 char *s1, *s2;
 memcpy(s1,s2,0);
 ],
@@ -469,7 +473,7 @@
 AC_MSG_CHECKING([if WNOHANG requires _POSIX_SOURCE])
 AC_TRY_RUN([
 #include <sys/wait.h>
-main() {
+int main() {
 #ifndef WNOHANG
 	return 0;
 #else
@@ -489,7 +493,7 @@
 AC_TRY_RUN([
 #include <stdio.h>
 #include <sys/wait.h>
-main() {
+int main() {
 #ifdef WNOHANG
 	FILE *fp = fopen("wnohang","w");
 	fprintf(fp,"%d",WNOHANG);
@@ -536,6 +540,13 @@
 AC_MSG_CHECKING([if signals need to be re-armed])
 AC_TRY_RUN([
 #include <signal.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifndef NO_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
 #define RETSIGTYPE $retsigtype
 
 int signal_rearms = 0;
@@ -553,7 +564,7 @@
 signal_rearms++;
 }
 
-main()
+int main()
 {
 	signal(SIGINT,parent_sigint_handler);
 
@@ -567,8 +578,9 @@
 
 		wait(&status);
 		unlink("core");
-		exit(signal_rearms);
+		return signal_rearms;
 	}
+	return -1;
 }],
 	AC_MSG_RESULT(yes)
 	AC_DEFINE(REARM_SIG)
@@ -714,10 +726,10 @@
 AC_MSG_CHECKING([for struct sgttyb])
 AC_TRY_RUN([
 #include <sgtty.h>
-main()
+int main()
 {
   struct sgttyb tmp;
-  exit(0);
+  return 0;
 }],
         AC_MSG_RESULT(yes)
         AC_DEFINE(HAVE_SGTTYB)
@@ -738,10 +750,10 @@
   # pty_termios.c is set up to handle pty_termio.
   AC_MSG_CHECKING([for struct termio])
   AC_TRY_RUN([#include <termio.h>
-  main()
+  int main()
   {
     struct termio tmp;
-    exit(0);
+    return 0;
   }],
         AC_DEFINE(HAVE_TERMIO)
         PTY_TYPE=termios
@@ -760,10 +772,10 @@
 #  include <inttypes.h>
 #  endif
 #  include <termios.h>
-  main()
+  int main()
   {
     struct termios tmp;
-    exit(0);
+    return 0;
   }],
         AC_DEFINE(HAVE_TERMIOS)
         PTY_TYPE=termios
@@ -782,7 +794,7 @@
 #include <inttypes.h>
 #endif
 #include <termios.h>
-main() {
+int main() {
 #if defined(TCGETS) || defined(TCGETA)
 	return 0;
 #else
@@ -797,21 +809,18 @@
 	AC_MSG_ERROR([Expect can't be cross compiled])
 )
 
-AC_MSG_CHECKING([if TIOCGWINSZ in termios.h])
+AC_MSG_CHECKING([if termios.h and sys/ioctl.h may both be included])
 AC_TRY_RUN([
 /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
 #ifdef HAVE_INTTYPES_H
 #include <inttypes.h>
 #endif
 #include <termios.h>
-main() {
-#ifdef TIOCGWINSZ
+#include <sys/ioctl.h>
+int main() {
 	return 0;
-#else
-	return 1;
-#endif
 }],
-	AC_DEFINE(HAVE_TIOCGWINSZ_IN_TERMIOS_H)
+	AC_DEFINE(HAVE_TERMIOS_AND_IOCTL_H_TOGETHER)
 	AC_MSG_RESULT(yes)
 ,
 	AC_MSG_RESULT(no)
@@ -823,7 +832,7 @@
 AC_MSG_CHECKING([for Cray-style ptys])
 SETUID=":"
 AC_TRY_RUN([
-main(){
+int main(){
 #ifdef CRAY
 	return 0;
 #else
@@ -878,12 +887,12 @@
 AC_TRY_RUN([
 extern char *tzname[2];
 extern int daylight;
-main()
+int main()
 {
   int *x = &daylight;
   char **y = tzname;
 
-  exit(0);
+  return 0;
 }],
 	AC_DEFINE(HAVE_SV_TIMEZONE)
 	AC_MSG_RESULT(yes),
--- expect5.45.4/tclconfig/tcl.m4.ORIG	2020-12-05 17:31:41.000000000 +0000
+++ expect5.45.4/tclconfig/tcl.m4	2020-12-05 17:32:39.000000000 +0000
@@ -2400,7 +2400,7 @@
 	AC_TRY_COMPILE([#include <time.h>],
 	    [extern long timezone;
 	    timezone += 1;
-	    exit (0);],
+	    return 0;],
 	    tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)])
     if test $tcl_cv_timezone_long = yes ; then
 	AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
@@ -2412,7 +2412,7 @@
 	    AC_TRY_COMPILE([#include <time.h>],
 		[extern time_t timezone;
 		timezone += 1;
-		exit (0);],
+		return 0;],
 		tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)])
 	if test $tcl_cv_timezone_time = yes ; then
 	    AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
@@ -2452,17 +2452,17 @@
 		    double value;
 		    value = strtod(infString, &term);
 		    if ((term != infString) && (term[-1] == 0)) {
-			exit(1);
+			return 1;
 		    }
 		    value = strtod(nanString, &term);
 		    if ((term != nanString) && (term[-1] == 0)) {
-			exit(1);
+			return 1;
 		    }
 		    value = strtod(spaceString, &term);
 		    if (term == (spaceString+1)) {
-			exit(1);
+			return 1;
 		    }
-		    exit(0);
+		    return 0;
 		}], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy,
 		    tcl_cv_strtod_buggy=buggy)])
 	if test "$tcl_cv_strtod_buggy" = buggy; then
--- expect5.45.4/exp_tty.h.ORIG	2020-12-05 18:25:06.000000000 +0000
+++ expect5.45.4/exp_tty.h	2020-12-05 18:24:14.000000000 +0000
@@ -19,6 +19,7 @@
 void exp_tty_echo(int set);
 void exp_tty_break(Tcl_Interp *interp, int fd);
 int exp_tty_raw_noecho(Tcl_Interp *interp, exp_tty *tty_old, int *was_raw, int *was_echo);
+int exp_tty_cooked_echo(Tcl_Interp *interp, exp_tty *tty_old, int *was_raw, int *was_echo);
 int exp_israw(void);
 int exp_isecho(void);
 
--- expect5.45.4/exp_chan.c.ORIG	2020-12-05 18:42:14.000000000 +0000
+++ expect5.45.4/exp_chan.c	2020-12-05 18:42:36.000000000 +0000
@@ -35,6 +35,7 @@
 #include "exp_prog.h"
 #include "exp_command.h"
 #include "exp_log.h"
+#include "exp_event.h"
 #include "tcldbg.h" /* Dbg_StdinMode */
 
 extern int		expSetBlockModeProc _ANSI_ARGS_((int fd, int mode));
--- expect5.45.4/exp_clib.c.ORIG	2020-12-05 18:40:52.000000000 +0000
+++ expect5.45.4/exp_clib.c	2020-12-05 18:41:18.000000000 +0000
@@ -8,6 +8,7 @@
 */
 
 #include "expect_cf.h"
+#include "exp_command.h"
 #include <stdio.h>
 #include <setjmp.h>
 #ifdef HAVE_INTTYPES_H
--- expect5.45.4/exp_win.c.ORIG	2020-12-05 18:27:20.000000000 +0000
+++ expect5.45.4/exp_win.c	2020-12-05 18:33:24.000000000 +0000
@@ -32,17 +32,13 @@
 
 #ifdef HAVE_TERMIOS
 #  include <termios.h>
+#  ifdef HAVE_TERMIOS_AND_IOCTL_H_TOGETHER
+#    include <sys/ioctl.h>
+#  endif
 #else
 #  include <sys/ioctl.h>
 #endif
 
-/* Sigh.  On AIX 2.3, termios.h exists but does not define TIOCGWINSZ */
-/* Instead, it has to come from ioctl.h.  However, As I said above, this */
-/* can't be cavalierly included on all machines, even when it exists. */
-#if defined(HAVE_TERMIOS) && !defined(HAVE_TIOCGWINSZ_IN_TERMIOS_H)
-#  include <sys/ioctl.h>
-#endif
-
 /* SCO defines window size structure in PTEM and TIOCGWINSZ in termio.h */
 /* Sigh... */
 #if defined(HAVE_SYS_PTEM_H)
--- expect5.45.4/pty_termios.c.ORIG	2020-12-05 18:43:05.000000000 +0000
+++ expect5.45.4/pty_termios.c	2020-12-05 18:45:20.000000000 +0000
@@ -77,6 +77,10 @@
 #include <sys/sysmacros.h>
 #endif
 
+#ifdef HAVE_OPENPTY
+#include <util.h>
+#endif
+
 #ifdef HAVE_PTYTRAP
 #include <sys/ptyio.h>
 #endif
@@ -102,6 +106,7 @@
 #include "exp_tty_in.h"
 #include "exp_rename.h"
 #include "exp_pty.h"
+#include "exp_int.h"
 
 void expDiagLog();
 void expDiagLogPtr();