@agoric/xsnap 0.14.3-u13.0 → 0.14.3-u16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/README.md +3 -3
  2. package/api.js +4 -2
  3. package/build.env +1 -1
  4. package/moddable/modules/data/base64/base64.js +28 -0
  5. package/moddable/modules/data/base64/manifest.json +11 -0
  6. package/moddable/modules/data/base64/modBase64.c +188 -0
  7. package/moddable/modules/data/binaryMessage/BinaryMessage.js +106 -0
  8. package/moddable/modules/data/crc/crc.c +205 -0
  9. package/moddable/modules/data/crc/crc.js +36 -0
  10. package/moddable/modules/data/crc/manifest.json +8 -0
  11. package/moddable/modules/data/hex/hex.js +28 -0
  12. package/moddable/modules/data/hex/manifest.json +11 -0
  13. package/moddable/modules/data/hex/modHex.c +139 -0
  14. package/moddable/modules/data/logical/logical.js +32 -0
  15. package/moddable/modules/data/logical/modLogical.c +98 -0
  16. package/moddable/modules/data/qrcode/manifest.json +9 -0
  17. package/moddable/modules/data/qrcode/qrcode.c +93 -0
  18. package/moddable/modules/data/qrcode/qrcode.js +23 -0
  19. package/moddable/modules/data/qrcode/qrcodegen.c +1025 -0
  20. package/moddable/modules/data/qrcode/qrcodegen.h +267 -0
  21. package/moddable/modules/data/text/decoder/manifest.json +8 -0
  22. package/moddable/modules/data/text/decoder/textdecoder.c +480 -0
  23. package/moddable/modules/data/text/decoder/textdecoder.js +27 -0
  24. package/moddable/modules/data/text/encoder/manifest.json +8 -0
  25. package/moddable/modules/data/text/encoder/textencoder.c +232 -0
  26. package/moddable/modules/data/text/encoder/textencoder.js +24 -0
  27. package/moddable/modules/data/tinyint/tinyint.c +150 -0
  28. package/moddable/modules/data/tinyint/tinyint.js +53 -0
  29. package/moddable/modules/data/url/manifest.json +17 -0
  30. package/moddable/modules/data/url/url.c +1959 -0
  31. package/moddable/modules/data/url/url.js +210 -0
  32. package/moddable/modules/data/wavreader/manifest.json +8 -0
  33. package/moddable/modules/data/wavreader/wavreader.js +128 -0
  34. package/moddable/modules/data/zlib/deflate.c +161 -0
  35. package/moddable/modules/data/zlib/deflate.js +63 -0
  36. package/moddable/modules/data/zlib/inflate.c +145 -0
  37. package/moddable/modules/data/zlib/inflate.js +66 -0
  38. package/moddable/modules/data/zlib/manifest_deflate.json +9 -0
  39. package/moddable/modules/data/zlib/manifest_inflate.json +9 -0
  40. package/moddable/modules/data/zlib/miniz.c +4924 -0
  41. package/moddable/xs/includes/xs.d.ts +73 -0
  42. package/moddable/xs/includes/xs.h +1533 -0
  43. package/moddable/xs/includes/xsmc.h +206 -0
  44. package/moddable/xs/makefiles/lin/makefile +33 -0
  45. package/moddable/xs/makefiles/lin/xsc.mk +118 -0
  46. package/moddable/xs/makefiles/lin/xsid.mk +90 -0
  47. package/moddable/xs/makefiles/lin/xsl.mk +168 -0
  48. package/moddable/xs/makefiles/lin/xst.mk +201 -0
  49. package/moddable/xs/makefiles/mac/makefile +33 -0
  50. package/moddable/xs/makefiles/mac/xsc.mk +130 -0
  51. package/moddable/xs/makefiles/mac/xsid.mk +102 -0
  52. package/moddable/xs/makefiles/mac/xsl.mk +177 -0
  53. package/moddable/xs/makefiles/mac/xst.mk +203 -0
  54. package/moddable/xs/makefiles/mac/xst_no_asan.txt +52 -0
  55. package/moddable/xs/makefiles/win/build.bat +26 -0
  56. package/moddable/xs/makefiles/win/xsc.mak +142 -0
  57. package/moddable/xs/makefiles/win/xsid.mak +113 -0
  58. package/moddable/xs/makefiles/win/xsl.mak +186 -0
  59. package/moddable/xs/makefiles/win/xst.mak +195 -0
  60. package/moddable/xs/platforms/lin_xs.h +99 -0
  61. package/moddable/xs/platforms/mac_xs.h +97 -0
  62. package/moddable/xs/platforms/wasm_xs.h +79 -0
  63. package/moddable/xs/platforms/win_xs.h +104 -0
  64. package/moddable/xs/platforms/xsHost.h +63 -0
  65. package/moddable/xs/platforms/xsPlatform.h +618 -0
  66. package/moddable/xs/sources/xsAPI.c +2555 -0
  67. package/moddable/xs/sources/xsAll.c +294 -0
  68. package/moddable/xs/sources/xsAll.h +2741 -0
  69. package/moddable/xs/sources/xsArguments.c +222 -0
  70. package/moddable/xs/sources/xsArray.c +2657 -0
  71. package/moddable/xs/sources/xsAtomics.c +844 -0
  72. package/moddable/xs/sources/xsBigInt.c +1859 -0
  73. package/moddable/xs/sources/xsBoolean.c +109 -0
  74. package/moddable/xs/sources/xsCode.c +4493 -0
  75. package/moddable/xs/sources/xsCommon.c +1710 -0
  76. package/moddable/xs/sources/xsCommon.h +1142 -0
  77. package/moddable/xs/sources/xsDataView.c +2890 -0
  78. package/moddable/xs/sources/xsDate.c +1541 -0
  79. package/moddable/xs/sources/xsDebug.c +2710 -0
  80. package/moddable/xs/sources/xsDefaults.c +134 -0
  81. package/moddable/xs/sources/xsError.c +353 -0
  82. package/moddable/xs/sources/xsFunction.c +776 -0
  83. package/moddable/xs/sources/xsGenerator.c +865 -0
  84. package/moddable/xs/sources/xsGlobal.c +839 -0
  85. package/moddable/xs/sources/xsJSON.c +1091 -0
  86. package/moddable/xs/sources/xsLexical.c +1969 -0
  87. package/moddable/xs/sources/xsLockdown.c +933 -0
  88. package/moddable/xs/sources/xsMapSet.c +1649 -0
  89. package/moddable/xs/sources/xsMarshall.c +1020 -0
  90. package/moddable/xs/sources/xsMath.c +624 -0
  91. package/moddable/xs/sources/xsMemory.c +1941 -0
  92. package/moddable/xs/sources/xsModule.c +3101 -0
  93. package/moddable/xs/sources/xsNumber.c +560 -0
  94. package/moddable/xs/sources/xsObject.c +1102 -0
  95. package/moddable/xs/sources/xsPlatforms.c +480 -0
  96. package/moddable/xs/sources/xsProfile.c +577 -0
  97. package/moddable/xs/sources/xsPromise.c +1199 -0
  98. package/moddable/xs/sources/xsProperty.c +636 -0
  99. package/moddable/xs/sources/xsProxy.c +1014 -0
  100. package/moddable/xs/sources/xsRegExp.c +1168 -0
  101. package/moddable/xs/sources/xsRun.c +4889 -0
  102. package/moddable/xs/sources/xsScope.c +1293 -0
  103. package/moddable/xs/sources/xsScript.c +288 -0
  104. package/moddable/xs/sources/xsScript.h +1186 -0
  105. package/moddable/xs/sources/xsSnapshot.c +2161 -0
  106. package/moddable/xs/sources/xsSnapshot.h +51 -0
  107. package/moddable/xs/sources/xsSourceMap.c +218 -0
  108. package/moddable/xs/sources/xsString.c +3332 -0
  109. package/moddable/xs/sources/xsSymbol.c +503 -0
  110. package/moddable/xs/sources/xsSyntaxical.c +4193 -0
  111. package/moddable/xs/sources/xsTree.c +1893 -0
  112. package/moddable/xs/sources/xsType.c +1488 -0
  113. package/moddable/xs/sources/xsdtoa.c +6672 -0
  114. package/moddable/xs/sources/xsmc.c +340 -0
  115. package/moddable/xs/sources/xsre.c +7578 -0
  116. package/package.json +39 -22
  117. package/scripts/get_xsnap_version.sh +14 -0
  118. package/scripts/test-package.sh +21 -0
  119. package/src/avaAssertXS.js +6 -2
  120. package/src/avaHandler.cjs +2 -5
  121. package/src/avaXS.js +7 -8
  122. package/src/build.js +161 -28
  123. package/src/replay.js +0 -3
  124. package/src/xsnap.js +105 -91
  125. package/src/xsrepl.js +2 -3
  126. package/xsnap-native/xsnap/makefiles/lin/makefile +10 -0
  127. package/xsnap-native/xsnap/makefiles/lin/xsnap-worker.mk +156 -0
  128. package/xsnap-native/xsnap/makefiles/lin/xsnap.mk +144 -0
  129. package/xsnap-native/xsnap/makefiles/mac/makefile +10 -0
  130. package/xsnap-native/xsnap/makefiles/mac/xsnap-worker.mk +165 -0
  131. package/xsnap-native/xsnap/makefiles/mac/xsnap.mk +153 -0
  132. package/xsnap-native/xsnap/sources/xsnap-worker.c +1008 -0
  133. package/xsnap-native/xsnap/sources/xsnap.c +717 -0
  134. package/xsnap-native/xsnap/sources/xsnap.h +142 -0
  135. package/xsnap-native/xsnap/sources/xsnapPlatform.c +1501 -0
  136. package/xsnap-native/xsnap/sources/xsnapPlatform.h +105 -0
  137. package/CHANGELOG.md +0 -646
@@ -0,0 +1,201 @@
1
+ #
2
+ # Copyright (c) 2016-2022 Moddable Tech, Inc.
3
+ #
4
+ # This file is part of the Moddable SDK Tools.
5
+ #
6
+ # The Moddable SDK Tools is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # The Moddable SDK Tools is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with the Moddable SDK Tools. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+
20
+ % : %.c
21
+ %.o : %.c
22
+
23
+ GOAL ?= debug
24
+ NAME = xst
25
+ ifneq ($(VERBOSE),1)
26
+ MAKEFLAGS += --silent
27
+ endif
28
+
29
+ XS_DIR ?= $(realpath ../..)
30
+ BUILD_DIR ?= $(realpath ../../../build)
31
+
32
+ FUZZILLI ?= 0
33
+ OSSFUZZ ?= 0
34
+ OSSFUZZ_JSONPARSE ?= 0
35
+ FUZZING ?= 0
36
+
37
+ BIN_DIR = $(BUILD_DIR)/bin/lin/$(GOAL)
38
+ INC_DIR = $(XS_DIR)/includes
39
+ PLT_DIR = $(XS_DIR)/platforms
40
+ SRC_DIR = $(XS_DIR)/sources
41
+ TLS_DIR = $(XS_DIR)/tools
42
+ TMP_DIR = $(BUILD_DIR)/tmp/lin/$(GOAL)/$(NAME)
43
+
44
+ MACOS_ARCH ?= -arch i386
45
+ MACOS_VERSION_MIN ?= -mmacosx-version-min=10.7
46
+ LINK_OPTIONS = -rdynamic
47
+
48
+ C_OPTIONS = \
49
+ -fno-common \
50
+ -DINCLUDE_XSPLATFORM \
51
+ -DXSPLATFORM=\"xst.h\" \
52
+ -DmxDebug=1 \
53
+ -DmxLockdown=1 \
54
+ -DmxNoConsole=1 \
55
+ -DmxParse=1 \
56
+ -DmxProfile=1 \
57
+ -DmxRun=1 \
58
+ -DmxSloppy=1 \
59
+ -DmxSnapshot=1 \
60
+ -DmxRegExpUnicodePropertyEscapes=1 \
61
+ -DmxStringNormalize=1 \
62
+ -DmxMinusZero=1 \
63
+ -I$(INC_DIR) \
64
+ -I$(PLT_DIR) \
65
+ -I$(SRC_DIR) \
66
+ -I$(TLS_DIR) \
67
+ -I$(TLS_DIR)/yaml \
68
+ -I$(TMP_DIR)
69
+ C_OPTIONS += \
70
+ -Wno-misleading-indentation \
71
+ -Wno-implicit-fallthrough
72
+ ifeq ($(GOAL),debug)
73
+ C_OPTIONS += -DmxASANStackMargin=131072
74
+ ifneq ($(FUZZING),0)
75
+ C_OPTIONS += -DmxStress=1
76
+ C_OPTIONS += -DFUZZING=1
77
+ endif
78
+ ifneq ($(OSSFUZZ),0)
79
+ C_OPTIONS += -DOSSFUZZ=1 -DmxMetering=1
80
+ ifneq ($(FUZZ_METER),0)
81
+ C_OPTIONS += -DmxFuzzMeter=$(FUZZ_METER)
82
+ endif
83
+ C_OPTIONS += $(CFLAGS)
84
+ LINK_OPTIONS += $(CXXFLAGS)
85
+ ifneq ($(OSSFUZZ_JSONPARSE),0)
86
+ C_OPTIONS += -DOSSFUZZ_JSONPARSE=1
87
+ endif
88
+ else
89
+ C_OPTIONS += -g -O0 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter
90
+ LINK_OPTIONS += -fsanitize=address -fno-omit-frame-pointer
91
+ C_OPTIONS += -fsanitize=address -fno-omit-frame-pointer
92
+ endif
93
+
94
+ ifneq ($(FUZZILLI),0)
95
+ C_OPTIONS += -DFUZZILLI=1 -fsanitize-coverage=trace-pc-guard
96
+ endif
97
+ else
98
+ C_OPTIONS += -DmxMultipleThreads=1 -O3
99
+ endif
100
+
101
+ LIBRARIES = -ldl -lm -lpthread -latomic
102
+ ifneq ($(FUZZING),0)
103
+ LIBRARIES += -lrt
104
+ endif
105
+
106
+ OBJECTS = \
107
+ $(TMP_DIR)/xsAll.o \
108
+ $(TMP_DIR)/xsAPI.o \
109
+ $(TMP_DIR)/xsArguments.o \
110
+ $(TMP_DIR)/xsArray.o \
111
+ $(TMP_DIR)/xsAtomics.o \
112
+ $(TMP_DIR)/xsBigInt.o \
113
+ $(TMP_DIR)/xsBoolean.o \
114
+ $(TMP_DIR)/xsCode.o \
115
+ $(TMP_DIR)/xsCommon.o \
116
+ $(TMP_DIR)/xsDataView.o \
117
+ $(TMP_DIR)/xsDate.o \
118
+ $(TMP_DIR)/xsDebug.o \
119
+ $(TMP_DIR)/xsDefaults.o \
120
+ $(TMP_DIR)/xsError.o \
121
+ $(TMP_DIR)/xsFunction.o \
122
+ $(TMP_DIR)/xsGenerator.o \
123
+ $(TMP_DIR)/xsGlobal.o \
124
+ $(TMP_DIR)/xsJSON.o \
125
+ $(TMP_DIR)/xsLexical.o \
126
+ $(TMP_DIR)/xsLockdown.o \
127
+ $(TMP_DIR)/xsMapSet.o \
128
+ $(TMP_DIR)/xsMarshall.o \
129
+ $(TMP_DIR)/xsMath.o \
130
+ $(TMP_DIR)/xsMemory.o \
131
+ $(TMP_DIR)/xsModule.o \
132
+ $(TMP_DIR)/xsNumber.o \
133
+ $(TMP_DIR)/xsObject.o \
134
+ $(TMP_DIR)/xsPlatforms.o \
135
+ $(TMP_DIR)/xsProfile.o \
136
+ $(TMP_DIR)/xsPromise.o \
137
+ $(TMP_DIR)/xsProperty.o \
138
+ $(TMP_DIR)/xsProxy.o \
139
+ $(TMP_DIR)/xsRegExp.o \
140
+ $(TMP_DIR)/xsRun.o \
141
+ $(TMP_DIR)/xsScope.o \
142
+ $(TMP_DIR)/xsScript.o \
143
+ $(TMP_DIR)/xsSourceMap.o \
144
+ $(TMP_DIR)/xsString.o \
145
+ $(TMP_DIR)/xsSymbol.o \
146
+ $(TMP_DIR)/xsSyntaxical.o \
147
+ $(TMP_DIR)/xsTree.o \
148
+ $(TMP_DIR)/xsType.o \
149
+ $(TMP_DIR)/xsdtoa.o \
150
+ $(TMP_DIR)/xsre.o \
151
+ $(TMP_DIR)/api.o \
152
+ $(TMP_DIR)/dumper.o \
153
+ $(TMP_DIR)/emitter.o \
154
+ $(TMP_DIR)/loader.o \
155
+ $(TMP_DIR)/parser.o \
156
+ $(TMP_DIR)/reader.o \
157
+ $(TMP_DIR)/scanner.o \
158
+ $(TMP_DIR)/writer.o \
159
+ $(TMP_DIR)/xsmc.o \
160
+ $(TMP_DIR)/textdecoder.o \
161
+ $(TMP_DIR)/textencoder.o \
162
+ $(TMP_DIR)/modBase64.o \
163
+ $(TMP_DIR)/xst.o
164
+
165
+ VPATH += $(SRC_DIR) $(TLS_DIR) $(TLS_DIR)/yaml
166
+ VPATH += $(MODDABLE)/modules/data/text/decoder
167
+ VPATH += $(MODDABLE)/modules/data/text/encoder
168
+ VPATH += $(MODDABLE)/modules/data/base64
169
+
170
+ build: $(TMP_DIR) $(BIN_DIR) $(BIN_DIR)/$(NAME)
171
+
172
+ $(TMP_DIR):
173
+ mkdir -p $(TMP_DIR)
174
+
175
+ $(BIN_DIR):
176
+ mkdir -p $(BIN_DIR)
177
+
178
+ $(BIN_DIR)/$(NAME): $(OBJECTS)
179
+ @echo "#" $(NAME) $(GOAL) ": cc" $(@F)
180
+ ifneq ($(OSSFUZZ),0)
181
+ @echo $(CXX) $(LIB_FUZZING_ENGINE) $(LINK_OPTIONS) $(OBJECTS) $(LIBRARIES) -o $@
182
+ $(CXX) $(LIB_FUZZING_ENGINE) $(LINK_OPTIONS) $(OBJECTS) $(LIBRARIES) -o $@
183
+ else
184
+ $(CC) $(LINK_OPTIONS) $(OBJECTS) $(LIBRARIES) -o $@
185
+ endif
186
+
187
+ $(OBJECTS): $(TLS_DIR)/xst.h
188
+ $(OBJECTS): $(PLT_DIR)/xsPlatform.h
189
+ $(OBJECTS): $(SRC_DIR)/xsCommon.h
190
+ $(OBJECTS): $(SRC_DIR)/xsAll.h
191
+ $(OBJECTS): $(SRC_DIR)/xsScript.h
192
+ $(TMP_DIR)/%.o: %.c
193
+ @echo "#" $(NAME) $(GOAL) ": cc" $(<F)
194
+ @echo $(CC) $< $(C_OPTIONS) -c -o $@
195
+ $(CC) $< $(C_OPTIONS) -c -o $@
196
+
197
+ clean:
198
+ rm -rf $(BUILD_DIR)/bin/lin/debug/$(NAME)
199
+ rm -rf $(BUILD_DIR)/bin/lin/release/$(NAME)
200
+ rm -rf $(BUILD_DIR)/tmp/lin/debug/$(NAME)
201
+ rm -rf $(BUILD_DIR)/tmp/lin/release/$(NAME)
@@ -0,0 +1,33 @@
1
+ #
2
+ # Copyright (c) 2016-2017 Moddable Tech, Inc.
3
+ #
4
+ # This file is part of the Moddable SDK Tools.
5
+ #
6
+ # The Moddable SDK Tools is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # The Moddable SDK Tools is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with the Moddable SDK Tools. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+ .NOTPARALLEL:
20
+
21
+ XS_DIR ?= $(MODDABLE)/xs
22
+ export XS_DIR
23
+ BUILD_DIR ?= $(MODDABLE)/build
24
+ export BUILD_DIR
25
+
26
+ all: debug release
27
+
28
+ debug:
29
+ make -f xst.mk
30
+
31
+ release:
32
+ make GOAL=release -f xst.mk
33
+
@@ -0,0 +1,130 @@
1
+ #
2
+ # Copyright (c) 2016-2017 Moddable Tech, Inc.
3
+ #
4
+ # This file is part of the Moddable SDK Tools.
5
+ #
6
+ # The Moddable SDK Tools is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # The Moddable SDK Tools is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with the Moddable SDK Tools. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+ # This file incorporates work covered by the following copyright and
20
+ # permission notice:
21
+ #
22
+ # Copyright (C) 2010-2016 Marvell International Ltd.
23
+ # Copyright (C) 2002-2010 Kinoma, Inc.
24
+ #
25
+ # Licensed under the Apache License, Version 2.0 (the "License");
26
+ # you may not use this file except in compliance with the License.
27
+ # You may obtain a copy of the License at
28
+ #
29
+ # http://www.apache.org/licenses/LICENSE-2.0
30
+ #
31
+ # Unless required by applicable law or agreed to in writing, software
32
+ # distributed under the License is distributed on an "AS IS" BASIS,
33
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34
+ # See the License for the specific language governing permissions and
35
+ # limitations under the License.
36
+ #
37
+
38
+ % : %.c
39
+ %.o : %.c
40
+
41
+ GOAL ?= debug
42
+ NAME = xsc
43
+ MAKEFLAGS += --jobs
44
+ ifneq ($(VERBOSE),1)
45
+ MAKEFLAGS += --silent
46
+ endif
47
+
48
+ XS_DIR ?= $(realpath ../..)
49
+ BUILD_DIR ?= $(realpath ../../../build)
50
+
51
+ BIN_DIR = $(BUILD_DIR)/bin/mac/$(GOAL)
52
+ INC_DIR = $(XS_DIR)/includes
53
+ PLT_DIR = $(XS_DIR)/platforms
54
+ SRC_DIR = $(XS_DIR)/sources
55
+ TLS_DIR = $(XS_DIR)/tools
56
+ TMP_DIR = $(BUILD_DIR)/tmp/mac/$(GOAL)/$(NAME)
57
+
58
+ # MACOS_ARCH ?= -arch i386
59
+ MACOS_ARCH ?=
60
+ MACOS_VERSION_MIN ?= -mmacosx-version-min=10.7
61
+
62
+ C_OPTIONS =\
63
+ -fno-common\
64
+ $(MACOS_ARCH)\
65
+ $(MACOS_VERSION_MIN)\
66
+ -I$(INC_DIR)\
67
+ -I$(PLT_DIR) \
68
+ -I$(SRC_DIR)\
69
+ -I$(TLS_DIR)\
70
+ -I$(TMP_DIR)\
71
+ -DmxCompile=1\
72
+ -DmxParse=1
73
+ ifneq ("x$(SDKROOT)", "x")
74
+ C_OPTIONS += -isysroot $(SDKROOT)
75
+ endif
76
+ ifeq ($(GOAL),debug)
77
+ C_OPTIONS += -DmxDebug=1 -g -O0 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter
78
+ else
79
+ C_OPTIONS += -O3
80
+ endif
81
+
82
+ LIBRARIES = -framework CoreServices
83
+
84
+ LINK_OPTIONS = $(MACOS_VERSION_MIN) $(MACOS_ARCH)
85
+ ifneq ("x$(SDKROOT)", "x")
86
+ LINK_OPTIONS += -isysroot $(SDKROOT)
87
+ endif
88
+
89
+ OBJECTS = \
90
+ $(TMP_DIR)/xsBigInt.o \
91
+ $(TMP_DIR)/xsCode.o \
92
+ $(TMP_DIR)/xsCommon.o \
93
+ $(TMP_DIR)/xsdtoa.o \
94
+ $(TMP_DIR)/xsLexical.o \
95
+ $(TMP_DIR)/xsre.o \
96
+ $(TMP_DIR)/xsScope.o \
97
+ $(TMP_DIR)/xsScript.o \
98
+ $(TMP_DIR)/xsSourceMap.o \
99
+ $(TMP_DIR)/xsSyntaxical.o \
100
+ $(TMP_DIR)/xsTree.o \
101
+ $(TMP_DIR)/xsc.o
102
+
103
+ VPATH += $(SRC_DIR) $(TLS_DIR)
104
+
105
+ build: $(TMP_DIR) $(BIN_DIR) $(BIN_DIR)/$(NAME)
106
+
107
+ $(TMP_DIR):
108
+ mkdir -p $(TMP_DIR)
109
+
110
+ $(BIN_DIR):
111
+ mkdir -p $(BIN_DIR)
112
+
113
+ $(BIN_DIR)/$(NAME): $(OBJECTS)
114
+ @echo "#" $(NAME) $(GOAL) ": cc" $(@F)
115
+ $(CC) $(LINK_OPTIONS) $(LIBRARIES) $(OBJECTS) -o $@
116
+
117
+ $(OBJECTS): $(PLT_DIR)/xsPlatform.h
118
+ $(OBJECTS): $(SRC_DIR)/xsCommon.h
119
+ $(OBJECTS): $(SRC_DIR)/xsScript.h
120
+
121
+ $(TMP_DIR)/%.o: %.c
122
+ @echo "#" $(NAME) $(GOAL) ": cc" $(<F)
123
+ $(CC) $< $(C_OPTIONS) -c -o $@
124
+
125
+ clean:
126
+ rm -rf $(BUILD_DIR)/bin/mac/debug/$(NAME)
127
+ rm -rf $(BUILD_DIR)/bin/mac/release/$(NAME)
128
+ rm -rf $(BUILD_DIR)/tmp/mac/debug/$(NAME)
129
+ rm -rf $(BUILD_DIR)/tmp/mac/release/$(NAME)
130
+
@@ -0,0 +1,102 @@
1
+ #
2
+ # Copyright (c) 2016-2023 Moddable Tech, Inc.
3
+ #
4
+ # This file is part of the Moddable SDK Tools.
5
+ #
6
+ # The Moddable SDK Tools is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # The Moddable SDK Tools is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with the Moddable SDK Tools. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+
20
+ % : %.c
21
+ %.o : %.c
22
+
23
+ GOAL ?= debug
24
+ NAME = xsid
25
+ MAKEFLAGS += --jobs
26
+ ifneq ($(VERBOSE),1)
27
+ MAKEFLAGS += --silent
28
+ endif
29
+
30
+ XS_DIR ?= $(realpath ../..)
31
+ BUILD_DIR ?= $(realpath ../../../build)
32
+
33
+ BIN_DIR = $(BUILD_DIR)/bin/mac/$(GOAL)
34
+ INC_DIR = $(XS_DIR)/includes
35
+ PLT_DIR = $(XS_DIR)/platforms
36
+ SRC_DIR = $(XS_DIR)/sources
37
+ TLS_DIR = $(XS_DIR)/tools
38
+ TMP_DIR = $(BUILD_DIR)/tmp/mac/$(GOAL)/$(NAME)
39
+
40
+ # MACOS_ARCH ?= -arch i386
41
+ MACOS_ARCH ?=
42
+ MACOS_VERSION_MIN ?= -mmacosx-version-min=10.7
43
+
44
+ C_OPTIONS =\
45
+ -fno-common\
46
+ $(MACOS_ARCH)\
47
+ $(MACOS_VERSION_MIN)\
48
+ -I$(INC_DIR)\
49
+ -I$(PLT_DIR) \
50
+ -I$(SRC_DIR)\
51
+ -I$(TLS_DIR)\
52
+ -I$(TMP_DIR)\
53
+ -DmxCompile=1
54
+ ifneq ("x$(SDKROOT)", "x")
55
+ C_OPTIONS += -isysroot $(SDKROOT)
56
+ endif
57
+ ifeq ($(GOAL),debug)
58
+ C_OPTIONS += -DmxDebug=1 -g -O0 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter
59
+ else
60
+ C_OPTIONS += -O3
61
+ endif
62
+
63
+ LIBRARIES = -framework CoreServices
64
+
65
+ LINK_OPTIONS = $(MACOS_VERSION_MIN) $(MACOS_ARCH)
66
+ ifneq ("x$(SDKROOT)", "x")
67
+ LINK_OPTIONS += -isysroot $(SDKROOT)
68
+ endif
69
+
70
+ OBJECTS = \
71
+ $(TMP_DIR)/xsdtoa.o \
72
+ $(TMP_DIR)/xsre.o \
73
+ $(TMP_DIR)/xsCommon.o \
74
+ $(TMP_DIR)/xsid.o
75
+
76
+ VPATH += $(SRC_DIR) $(TLS_DIR)
77
+
78
+ build: $(TMP_DIR) $(BIN_DIR) $(BIN_DIR)/$(NAME)
79
+
80
+ $(TMP_DIR):
81
+ mkdir -p $(TMP_DIR)
82
+
83
+ $(BIN_DIR):
84
+ mkdir -p $(BIN_DIR)
85
+
86
+ $(BIN_DIR)/$(NAME): $(OBJECTS)
87
+ @echo "#" $(NAME) $(GOAL) ": cc" $(@F)
88
+ $(CC) $(LINK_OPTIONS) $(LIBRARIES) $(OBJECTS) -o $@
89
+
90
+ $(OBJECTS): $(PLT_DIR)/xsPlatform.h
91
+ $(OBJECTS): $(SRC_DIR)/xsCommon.h
92
+
93
+ $(TMP_DIR)/%.o: %.c
94
+ @echo "#" $(NAME) $(GOAL) ": cc" $(<F)
95
+ $(CC) $< $(C_OPTIONS) -c -o $@
96
+
97
+ clean:
98
+ rm -rf $(BUILD_DIR)/bin/mac/debug/$(NAME)
99
+ rm -rf $(BUILD_DIR)/bin/mac/release/$(NAME)
100
+ rm -rf $(BUILD_DIR)/tmp/mac/debug/$(NAME)
101
+ rm -rf $(BUILD_DIR)/tmp/mac/release/$(NAME)
102
+
@@ -0,0 +1,177 @@
1
+ #
2
+ # Copyright (c) 2016-2017 Moddable Tech, Inc.
3
+ #
4
+ # This file is part of the Moddable SDK Tools.
5
+ #
6
+ # The Moddable SDK Tools is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # The Moddable SDK Tools is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with the Moddable SDK Tools. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+ # This file incorporates work covered by the following copyright and
20
+ # permission notice:
21
+ #
22
+ # Copyright (C) 2010-2016 Marvell International Ltd.
23
+ # Copyright (C) 2002-2010 Kinoma, Inc.
24
+ #
25
+ # Licensed under the Apache License, Version 2.0 (the "License");
26
+ # you may not use this file except in compliance with the License.
27
+ # You may obtain a copy of the License at
28
+ #
29
+ # http://www.apache.org/licenses/LICENSE-2.0
30
+ #
31
+ # Unless required by applicable law or agreed to in writing, software
32
+ # distributed under the License is distributed on an "AS IS" BASIS,
33
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34
+ # See the License for the specific language governing permissions and
35
+ # limitations under the License.
36
+ #
37
+
38
+ % : %.c
39
+ %.o : %.c
40
+
41
+ GOAL ?= debug
42
+ NAME = xsl
43
+ MAKEFLAGS += --jobs
44
+ ifneq ($(VERBOSE),1)
45
+ MAKEFLAGS += --silent
46
+ endif
47
+
48
+ XS_DIR ?= $(realpath ../..)
49
+ BUILD_DIR ?= $(realpath ../../../build)
50
+
51
+ XSC = $(BUILD_DIR)/bin/mac/$(GOAL)/xsc
52
+
53
+ BIN_DIR = $(BUILD_DIR)/bin/mac/$(GOAL)
54
+ INC_DIR = $(XS_DIR)/includes
55
+ PLT_DIR = $(XS_DIR)/platforms
56
+ SRC_DIR = $(XS_DIR)/sources
57
+ TLS_DIR = $(XS_DIR)/tools
58
+ TMP_DIR = $(BUILD_DIR)/tmp/mac/$(GOAL)/$(NAME)
59
+
60
+ # MACOS_ARCH ?= -arch i386
61
+ MACOS_ARCH ?=
62
+ MACOS_VERSION_MIN ?= -mmacosx-version-min=10.7
63
+
64
+ C_OPTIONS =\
65
+ -fno-common\
66
+ $(MACOS_ARCH)\
67
+ $(MACOS_VERSION_MIN)\
68
+ -DINCLUDE_XSPLATFORM \
69
+ -DXSPLATFORM=\"xslOpt.h\" \
70
+ -I$(INC_DIR)\
71
+ -I$(PLT_DIR) \
72
+ -I$(SRC_DIR)\
73
+ -I$(TLS_DIR)\
74
+ -I$(TMP_DIR)\
75
+ -DmxLink=1\
76
+ -DmxRun=1
77
+ C_OPTIONS +=\
78
+ -DmxNoFunctionLength=1\
79
+ -DmxNoFunctionName=1\
80
+ -DmxHostFunctionPrimitive=1\
81
+ -DmxFewGlobalsTable=1
82
+ ifneq ("x$(SDKROOT)", "x")
83
+ C_OPTIONS += -isysroot $(SDKROOT)
84
+ endif
85
+ ifeq ($(GOAL),debug)
86
+ C_OPTIONS += -DmxDebug=1 -g -O0 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter
87
+ else
88
+ C_OPTIONS += -O3
89
+ endif
90
+
91
+ LIBRARIES = -framework CoreServices
92
+
93
+ LINK_OPTIONS = $(MACOS_VERSION_MIN) $(MACOS_ARCH)
94
+ ifneq ("x$(SDKROOT)", "x")
95
+ LINK_OPTIONS += -isysroot $(SDKROOT)
96
+ endif
97
+
98
+ OBJECTS = \
99
+ $(TMP_DIR)/xsAll.o \
100
+ $(TMP_DIR)/xsAPI.o \
101
+ $(TMP_DIR)/xsArguments.o \
102
+ $(TMP_DIR)/xsArray.o \
103
+ $(TMP_DIR)/xsAtomics.o \
104
+ $(TMP_DIR)/xsBigInt.o \
105
+ $(TMP_DIR)/xsBoolean.o \
106
+ $(TMP_DIR)/xsCode.o \
107
+ $(TMP_DIR)/xsCommon.o \
108
+ $(TMP_DIR)/xsDataView.o \
109
+ $(TMP_DIR)/xsDate.o \
110
+ $(TMP_DIR)/xsDebug.o \
111
+ $(TMP_DIR)/xsDefaults.o \
112
+ $(TMP_DIR)/xsError.o \
113
+ $(TMP_DIR)/xsFunction.o \
114
+ $(TMP_DIR)/xsGenerator.o \
115
+ $(TMP_DIR)/xsGlobal.o \
116
+ $(TMP_DIR)/xsJSON.o \
117
+ $(TMP_DIR)/xsLexical.o \
118
+ $(TMP_DIR)/xsMapSet.o \
119
+ $(TMP_DIR)/xsMarshall.o \
120
+ $(TMP_DIR)/xsMath.o \
121
+ $(TMP_DIR)/xsMemory.o \
122
+ $(TMP_DIR)/xsModule.o \
123
+ $(TMP_DIR)/xsNumber.o \
124
+ $(TMP_DIR)/xsObject.o \
125
+ $(TMP_DIR)/xsPlatforms.o \
126
+ $(TMP_DIR)/xsPromise.o \
127
+ $(TMP_DIR)/xsProperty.o \
128
+ $(TMP_DIR)/xsProxy.o \
129
+ $(TMP_DIR)/xsRegExp.o \
130
+ $(TMP_DIR)/xsRun.o \
131
+ $(TMP_DIR)/xsScope.o \
132
+ $(TMP_DIR)/xsScript.o \
133
+ $(TMP_DIR)/xsSourceMap.o \
134
+ $(TMP_DIR)/xsString.o \
135
+ $(TMP_DIR)/xsSymbol.o \
136
+ $(TMP_DIR)/xsSyntaxical.o \
137
+ $(TMP_DIR)/xsTree.o \
138
+ $(TMP_DIR)/xsType.o \
139
+ $(TMP_DIR)/xsdtoa.o \
140
+ $(TMP_DIR)/xsre.o \
141
+ $(TMP_DIR)/xslBase.o \
142
+ $(TMP_DIR)/xslOpt.o \
143
+ $(TMP_DIR)/xslSlot.o \
144
+ $(TMP_DIR)/xslStrip.o \
145
+ $(TMP_DIR)/xsl.o
146
+
147
+ VPATH += $(SRC_DIR) $(TLS_DIR)
148
+
149
+ build: $(TMP_DIR) $(BIN_DIR) $(BIN_DIR)/$(NAME)
150
+
151
+ $(TMP_DIR):
152
+ mkdir -p $(TMP_DIR)
153
+
154
+ $(BIN_DIR):
155
+ mkdir -p $(BIN_DIR)
156
+
157
+ $(BIN_DIR)/$(NAME): $(OBJECTS)
158
+ @echo "#" $(NAME) $(GOAL) ": cc" $(@F)
159
+ $(CC) $(LINK_OPTIONS) $(LIBRARIES) $(OBJECTS) -o $@
160
+
161
+ $(OBJECTS): $(PLT_DIR)/xsPlatform.h
162
+ $(OBJECTS): $(SRC_DIR)/xsCommon.h
163
+ $(OBJECTS): $(SRC_DIR)/xsAll.h
164
+ $(OBJECTS): $(TLS_DIR)/xsl.h
165
+ $(OBJECTS): $(TLS_DIR)/xslOpt.h
166
+
167
+ $(TMP_DIR)/%.o: %.c
168
+ @echo "#" $(NAME) $(GOAL) ": cc" $(<F)
169
+ $(CC) $< $(C_OPTIONS) -c -o $@
170
+
171
+ clean:
172
+ rm -rf $(BUILD_DIR)/bin/mac/debug/$(NAME)
173
+ rm -rf $(BUILD_DIR)/bin/mac/release/$(NAME)
174
+ rm -rf $(BUILD_DIR)/tmp/mac/debug/$(NAME)
175
+ rm -rf $(BUILD_DIR)/tmp/mac/release/$(NAME)
176
+
177
+