File tree Expand file tree Collapse file tree 13 files changed +2596
-662
lines changed Expand file tree Collapse file tree 13 files changed +2596
-662
lines changed Original file line number Diff line number Diff line change 20
20
if [ $njs_found = yes -a $NJS_HAVE_READLINE = YES ]; then
21
21
cat << END >> $NJS_MAKEFILE
22
22
23
- shell_test : njs test/shell_test.exp
23
+ shell_test_njs : njs test/shell_test.exp
24
24
PATH=$NJS_BUILD_DIR:\$(PATH) LANG=C.UTF-8 TERM=screen \
25
25
expect -f test/shell_test.exp
26
+ PATH=$NJS_BUILD_DIR:\$(PATH) LANG=C.UTF-8 TERM=screen \
27
+ expect -f test/shell_test_njs.exp
28
+ END
29
+
30
+ if [ $NJS_HAVE_QUICKJS = YES ]; then
31
+ cat << END >> $NJS_MAKEFILE
32
+
33
+ shell_test: shell_test_njs shell_test_quickjs
34
+
35
+ shell_test_quickjs: njs test/shell_test.exp
36
+ PATH=$NJS_BUILD_DIR:\$(PATH) LANG=C.UTF-8 TERM=screen NJS_ENGINE=QuickJS \
37
+ expect -f test/shell_test.exp
26
38
END
27
39
40
+ else
41
+ cat << END >> $NJS_MAKEFILE
42
+
43
+ shell_test: shell_test_njs
44
+ END
45
+
46
+ fi
47
+
28
48
else
29
49
echo " - expect tests are disabled"
30
50
Original file line number Diff line number Diff line change @@ -241,8 +241,7 @@ lib_test: $NJS_BUILD_DIR/njs_auto_config.h \\
241
241
$NJS_BUILD_DIR/lvlhsh_unit_test
242
242
$NJS_BUILD_DIR/unicode_unit_test
243
243
244
- test262: njs
245
-
244
+ test262_njs: njs
246
245
test/test262 --binary=$NJS_BUILD_DIR/njs
247
246
248
247
unit_test: $NJS_BUILD_DIR/njs_auto_config.h \\
@@ -265,6 +264,26 @@ dist:
265
264
&& echo njs-\$(NJS_VER).tar.gz done
266
265
END
267
266
267
+ if [ $NJS_HAVE_QUICKJS = YES ]; then
268
+ cat << END >> $NJS_MAKEFILE
269
+
270
+ test262: njs test262_njs test262_quickjs
271
+
272
+ test262_quickjs: njs
273
+ NJS_SKIP_LIST="test/js/promise_rejection_tracker_recursive.t.js \\
274
+ test/js/async_exception_in_await.t.js" \\
275
+ test/test262 --binary='$NJS_BUILD_DIR/njs -n QuickJS -m'
276
+ END
277
+
278
+ else
279
+ cat << END >> $NJS_MAKEFILE
280
+
281
+ test262: njs test262_njs
282
+ END
283
+
284
+ fi
285
+
286
+
268
287
njs_ts_deps=`echo $NJS_TS_SRCS \
269
288
| sed -e "s# *\([^ ][^ ]*\)#\1$njs_regex_cont#g"`
270
289
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ NJS_DEBUG_GENERATOR=NO
14
14
NJS_ADDRESS_SANITIZER=NO
15
15
NJS_ADDR2LINE=NO
16
16
17
+ NJS_QUICKJS=YES
17
18
NJS_OPENSSL=YES
18
19
NJS_LIBXML2=YES
19
20
NJS_ZLIB=YES
47
48
--debug-opcode=*) NJS_DEBUG_OPCODE="$value" ;;
48
49
--debug-generator=*) NJS_DEBUG_GENERATOR="$value" ;;
49
50
51
+ --no-quickjs) NJS_QUICKJS=NO ;;
50
52
--no-openssl) NJS_OPENSSL=NO ;;
51
53
--no-libxml2) NJS_LIBXML2=NO ;;
52
54
--no-zlib) NJS_ZLIB=NO ;;
Original file line number Diff line number Diff line change
1
+
2
+ # Copyright (C) Dmitry Volyntsev
3
+ # Copyright (C) NGINX, Inc.
4
+
5
+
6
+ NJS_QUICKJS_LIB=
7
+ NJS_HAVE_QUICKJS=NO
8
+
9
+ if [ $NJS_QUICKJS = YES ]; then
10
+ njs_found=no
11
+
12
+ njs_feature="QuickJS library"
13
+ njs_feature_name=NJS_HAVE_QUICKJS
14
+ njs_feature_run=yes
15
+ njs_feature_incs=
16
+ njs_feature_libs=""
17
+ njs_feature_test="#if defined(__GNUC__) && (__GNUC__ >= 8)
18
+ #pragma GCC diagnostic push
19
+ #pragma GCC diagnostic ignored \"-Wcast-function-type\"
20
+ #endif
21
+
22
+ #include <quickjs.h>
23
+
24
+ int main() {
25
+ JSRuntime *rt;
26
+
27
+ rt = JS_NewRuntime();
28
+ JS_FreeRuntime(rt);
29
+ return 0;
30
+ }"
31
+ . auto/feature
32
+
33
+ if [ $njs_found = no ]; then
34
+ njs_feature="QuickJS library -lquickjs.lto"
35
+ njs_feature_incs="/usr/include/quickjs/"
36
+ njs_feature_libs="-L/usr/lib/quickjs/ -lquickjs.lto -lm -ldl -lpthread"
37
+
38
+ . auto/feature
39
+ fi
40
+
41
+ if [ $njs_found = no ]; then
42
+ njs_feature="QuickJS library -lquickjs"
43
+ njs_feature_libs="-L/usr/lib/quickjs/ -lquickjs -lm -ldl -lpthread"
44
+
45
+ . auto/feature
46
+ fi
47
+
48
+ if [ $njs_found = yes ]; then
49
+ NJS_HAVE_QUICKJS=YES
50
+ NJS_QUICKJS_LIB="$njs_feature_libs"
51
+ NJS_LIB_INCS="$NJS_LIB_INCS $njs_feature_incs"
52
+ NJS_LIB_AUX_LIBS="$NJS_LIB_AUX_LIBS $njs_feature_libs"
53
+ fi
54
+
55
+ fi
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ if [ $NJS_HAVE_READLINE = YES ]; then
18
18
echo " + using readline library: $NJS_READLINE_LIB"
19
19
fi
20
20
21
+ if [ $NJS_HAVE_QUICKJS = YES ]; then
22
+ echo " + using QuickJS library: $NJS_QUICKJS_LIB"
23
+ fi
24
+
21
25
if [ $NJS_HAVE_OPENSSL = YES ]; then
22
26
echo " + using OpenSSL library: $NJS_OPENSSL_LIB"
23
27
fi
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ NJS_LIB_AUX_LIBS=
50
50
. auto/explicit_bzero
51
51
. auto/pcre
52
52
. auto/readline
53
+ . auto/quickjs
53
54
. auto/openssl
54
55
. auto/libxml2
55
56
. auto/zlib
You can’t perform that action at this time.
0 commit comments