-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwacl.patch
200 lines (182 loc) · 6.89 KB
/
wacl.patch
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
diff -ruN tcl8.6.6/compat/fake-rfc2553.c tcl/compat/fake-rfc2553.c
--- tcl8.6.6/compat/fake-rfc2553.c 2016-02-25 21:12:36.000000000 +0100
+++ tcl/compat/fake-rfc2553.c 2017-04-20 21:13:57.296858854 +0200
@@ -35,6 +35,7 @@
* that ai_family is AF_INET. Don't use it for another purpose.
*/
#include "tclInt.h"
+#define HAVE_STRLCPY 1
TCL_DECLARE_MUTEX(netdbMutex)
diff -ruN tcl8.6.6/generic/tcl.h tcl/generic/tcl.h
--- tcl8.6.6/generic/tcl.h 2016-07-22 16:43:05.000000000 +0200
+++ tcl/generic/tcl.h 2017-04-20 21:13:57.296858854 +0200
@@ -1,3 +1,4 @@
+#undef TCL_WIDE_INT_IS_LONG
/*
* tcl.h --
*
diff -ruN tcl8.6.6/unix/configure.in tcl/unix/configure.in
--- tcl8.6.6/unix/configure.in 2016-07-26 16:07:18.000000000 +0200
+++ tcl/unix/configure.in 2017-04-20 21:13:57.296858854 +0200
@@ -337,39 +337,6 @@
AC_DEFINE(NO_STRING_H, 1, [Do we have <string.h>?]) ])
#--------------------------------------------------------------------
-# On some systems strstr is broken: it returns a pointer even even if
-# the original string is empty.
-#--------------------------------------------------------------------
-
-SC_TCL_CHECK_BROKEN_FUNC(strstr, [
- extern int strstr();
- exit(strstr("\0test", "test") ? 1 : 0);
-])
-
-#--------------------------------------------------------------------
-# Check for strtoul function. This is tricky because under some
-# versions of AIX strtoul returns an incorrect terminator
-# pointer for the string "0".
-#--------------------------------------------------------------------
-
-SC_TCL_CHECK_BROKEN_FUNC(strtoul, [
- extern int strtoul();
- char *term, *string = "0";
- exit(strtoul(string,&term,0) != 0 || term != string+1);
-])
-
-#--------------------------------------------------------------------
-# Check for the strtod function. This is tricky because in some
-# versions of Linux strtod mis-parses strings starting with "+".
-#--------------------------------------------------------------------
-
-SC_TCL_CHECK_BROKEN_FUNC(strtod, [
- extern double strtod();
- char *term, *string = " +69";
- exit(strtod(string,&term) != 69 || term != string+4);
-])
-
-#--------------------------------------------------------------------
# Under Solaris 2.4, strtod returns the wrong value for the
# terminating character under some conditions. Check for this
# and if the problem exists use a substitute procedure
diff -ruN tcl8.6.6/unix/Makefile.in tcl/unix/Makefile.in
--- tcl8.6.6/unix/Makefile.in 2016-07-26 16:07:18.000000000 +0200
+++ tcl/unix/Makefile.in 2017-04-25 05:26:53.020618227 +0200
@@ -227,6 +227,7 @@
TOP_DIR = @TCL_SRC_DIR@
BUILD_DIR = @builddir@
GENERIC_DIR = $(TOP_DIR)/generic
+WACL_DIR = $(TOP_DIR)/../opt
TOMMATH_DIR = $(TOP_DIR)/libtommath
COMPAT_DIR = $(TOP_DIR)/compat
TOOL_DIR = $(TOP_DIR)/tools
@@ -356,8 +357,10 @@
ZLIB_OBJS = Zadler32.o Zcompress.o Zcrc32.o Zdeflate.o Zinfback.o \
Zinffast.o Zinflate.o Zinftrees.o Ztrees.o Zuncompr.o Zzutil.o
+WACL_OBJS = wacl.o waclAppInit.o
+
TCL_OBJS = ${GENERIC_OBJS} ${UNIX_OBJS} ${NOTIFY_OBJS} ${COMPAT_OBJS} \
- ${OO_OBJS} @DL_OBJS@ @PLAT_OBJS@
+ ${OO_OBJS} ${WACL_OBJS} @DL_OBJS@ @PLAT_OBJS@
OBJS = ${TCL_OBJS} ${TOMMATH_OBJS} @DTRACE_OBJ@ @ZLIB_OBJS@
@@ -465,6 +468,10 @@
$(GENERIC_DIR)/tclAssembly.c \
$(GENERIC_DIR)/tclZlib.c
+WACL_SRCS = \
+ $(WACL_DIR)/wacl.c \
+ $(WACL_DIR)/waclAppInit.c
+
OO_SRCS = \
$(GENERIC_DIR)/tclOO.c \
$(GENERIC_DIR)/tclOOBasic.c \
@@ -606,7 +613,7 @@
# things like "make depend".
SRCS = $(GENERIC_SRCS) $(TOMMATH_SRCS) $(UNIX_SRCS) $(NOTIFY_SRCS) \
- $(OO_SRCS) $(STUB_SRCS) @PLAT_SRCS@ @ZLIB_SRCS@
+ $(OO_SRCS) $(WACL_SRCS) $(STUB_SRCS) @PLAT_SRCS@ @ZLIB_SRCS@
#--------------------------------------------------------------------------
# Start of rules
@@ -614,7 +621,7 @@
all: binaries libraries doc packages
-binaries: ${LIB_FILE} ${TCL_EXE}
+binaries: ${LIB_FILE}
libraries:
@@ -657,7 +664,7 @@
# $(SHELL) config.status
clean: clean-packages
- rm -rf *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out \
+ rm -rf *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out* \
errors ${TCL_EXE} ${TCLTEST_EXE} lib.exp Tcl @DTRACE_HDR@
cd dltest ; $(MAKE) clean
@@ -796,8 +803,6 @@
@echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/"
@@INSTALL_LIB@
@chmod 555 "$(DLL_INSTALL_DIR)/$(LIB_FILE)"
- @echo "Installing ${TCL_EXE} as $(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"
- @$(INSTALL_PROGRAM) ${TCL_EXE} "$(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"
@echo "Installing tclConfig.sh to $(CONFIG_INSTALL_DIR)/"
@$(INSTALL_DATA) tclConfig.sh "$(CONFIG_INSTALL_DIR)/tclConfig.sh"
@echo "Installing tclooConfig.sh to $(CONFIG_INSTALL_DIR)/"
@@ -1252,6 +1257,12 @@
tclPkg.o: $(GENERIC_DIR)/tclPkg.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPkg.c
+wacl.o: $(WACL_DIR)/wacl.c
+ $(CC) -c $(CC_SWITCHES) $(WACL_DIR)/wacl.c
+
+waclAppInit.o: $(WACL_DIR)/waclAppInit.c
+ $(CC) -c $(CC_SWITCHES) $(WACL_DIR)/waclAppInit.c
+
# TIP #59, embedding of configuration information into the binary library.
#
# Part of Tcl's configuration information are the paths where it was installed
diff -ruN tcl8.6.6/unix/tclUnixChan.c tcl/unix/tclUnixChan.c
--- tcl8.6.6/unix/tclUnixChan.c 2016-02-25 21:12:38.000000000 +0100
+++ tcl/unix/tclUnixChan.c 2017-04-20 21:13:57.297858893 +0200
@@ -1847,9 +1847,18 @@
/*
* Wait for the event or a timeout.
*/
-
+#ifdef __EMSCRIPTEN__
+ /*
+ * EL: Emscripten does not support the exception fds, it throws
+ * an assert exception. Therefore we call select() with NULL for
+ * the exceptfds parameter.
+ */
+ numFound = select(fd + 1, &readableMask, &writableMask,
+ NULL, timeoutPtr);
+#else
numFound = select(fd + 1, &readableMask, &writableMask,
&exceptionMask, timeoutPtr);
+#endif // __EMSCRIPTEN__
if (numFound == 1) {
if (FD_ISSET(fd, &readableMask)) {
SET_BITS(result, TCL_READABLE);
diff -ruN tcl8.6.6/unix/tclUnixCompat.c tcl/unix/tclUnixCompat.c
--- tcl8.6.6/unix/tclUnixCompat.c 2016-02-25 21:12:38.000000000 +0100
+++ tcl/unix/tclUnixCompat.c 2017-04-20 21:13:57.297858893 +0200
@@ -1,3 +1,4 @@
+#undef HAVE_CPUID
/*
* tclUnixCompat.c
*
diff -ruN tcl8.6.6/unix/tclUnixNotfy.c tcl/unix/tclUnixNotfy.c
--- tcl8.6.6/unix/tclUnixNotfy.c 2016-03-23 12:43:13.000000000 +0100
+++ tcl/unix/tclUnixNotfy.c 2017-04-20 21:13:57.297858893 +0200
@@ -1059,9 +1059,20 @@
#else
tsdPtr->readyMasks = tsdPtr->checkMasks;
+#ifdef __EMSCRIPTEN__
+ /*
+ * EL: Emscripten does not support the exception fds, it throws
+ * an assert exception. Therefore we call select() with NULL for
+ * the exceptfds parameter.
+ */
+ numFound = select(tsdPtr->numFdBits, &tsdPtr->readyMasks.readable,
+ &tsdPtr->readyMasks.writable, NULL,
+ timeoutPtr);
+#else
numFound = select(tsdPtr->numFdBits, &tsdPtr->readyMasks.readable,
&tsdPtr->readyMasks.writable, &tsdPtr->readyMasks.exception,
timeoutPtr);
+#endif /* __EMSCRIPTEN__ */
/*
* Some systems don't clear the masks after an error, so we have to do