From 076ca079d63d7d0bb777cc7a6f9b69df9c578192 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Thu, 4 Apr 2024 16:07:53 -0700 Subject: [PATCH] Configure: added --with-quickjs option. --- auto/help | 1 + auto/options | 6 ++++-- auto/quickjs | 13 ++++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/auto/help b/auto/help index b053d85d..064a209b 100644 --- a/auto/help +++ b/auto/help @@ -48,4 +48,5 @@ default: "$NJS_LD_OPT" --no-zlib disables zlib discovery. When this option is enabled zlib dependant code is not built as a part of libnjs.a. + --with-quickjs requires QuickJS engine. END diff --git a/auto/options b/auto/options index 19c5e35d..0a4dc6c7 100644 --- a/auto/options +++ b/auto/options @@ -14,7 +14,8 @@ NJS_DEBUG_GENERATOR=NO NJS_ADDRESS_SANITIZER=NO NJS_ADDR2LINE=NO -NJS_QUICKJS=YES +NJS_QUICKJS=NO +NJS_TRY_QUICKJS=YES NJS_OPENSSL=YES NJS_LIBXML2=YES NJS_ZLIB=YES @@ -48,7 +49,7 @@ do --debug-opcode=*) NJS_DEBUG_OPCODE="$value" ;; --debug-generator=*) NJS_DEBUG_GENERATOR="$value" ;; - --no-quickjs) NJS_QUICKJS=NO ;; + --no-quickjs) NJS_TRY_QUICKJS=NO ;; --no-openssl) NJS_OPENSSL=NO ;; --no-libxml2) NJS_LIBXML2=NO ;; --no-zlib) NJS_ZLIB=NO ;; @@ -57,6 +58,7 @@ do --no-pcre2) NJS_TRY_PCRE2=NO ;; --no-goto) NJS_TRY_GOTO=NO ;; + --with-quickjs) NJS_TRY_QUICKJS=YES; NJS_QUICKJS=YES ;; --help) . auto/help diff --git a/auto/quickjs b/auto/quickjs index c60739b0..28b7902e 100644 --- a/auto/quickjs +++ b/auto/quickjs @@ -6,7 +6,7 @@ NJS_QUICKJS_LIB= NJS_HAVE_QUICKJS=NO -if [ $NJS_QUICKJS = YES ]; then +if [ $NJS_TRY_QUICKJS = YES ]; then njs_found=no njs_feature="QuickJS library -lquickjs.lto" @@ -40,7 +40,7 @@ if [ $NJS_QUICKJS = YES ]; then if [ $njs_found = no ]; then njs_feature="QuickJS library -I/usr/include/quickjs/ -L/usr/lib/quickjs/ -lquickjs.lto" njs_feature_incs="/usr/include/quickjs/" - njs_feature_libs="-L/usr/lib/quickjs/ -lquickjs.lto -lm -ldl -lpthread" + njs_feature_libs="-L/usr/lib/quickjs/ -lquijs.lto -lm -ldl -lpthread" . auto/feature fi @@ -48,7 +48,7 @@ if [ $NJS_QUICKJS = YES ]; then if [ $njs_found = no ]; then njs_feature="QuickJS library -I/usr/include/quickjs/ -L/usr/lib/quickjs/ -lquickjs" njs_feature_incs="/usr/include/quickjs/" - njs_feature_libs="-L/usr/lib/quickjs/ -lquickjs -lm -ldl -lpthread" + njs_feature_libs="-L/usr/lib/quickjs/ -lquijs -lm -ldl -lpthread" . auto/feature fi @@ -60,4 +60,11 @@ if [ $NJS_QUICKJS = YES ]; then NJS_LIB_AUX_LIBS="$NJS_LIB_AUX_LIBS $njs_feature_libs" fi + if [ $NJS_QUICKJS = YES -a $njs_found = no ]; then + echo + echo $0: error: no QuickJS library found. + echo + exit 1; + fi + fi -- 2.47.3