[njs] Configure: added --with-quickjs option.

Dmitry Volyntsev xeioex at nginx.com
Fri Apr 5 01:38:44 UTC 2024


details:   https://hg.nginx.org/njs/rev/1c8b6b9bc06c
branches:  
changeset: 2312:1c8b6b9bc06c
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Thu Apr 04 16:07:53 2024 -0700
description:
Configure: added --with-quickjs option.

diffstat:

 auto/help    |   1 +
 auto/options |   6 ++++--
 auto/quickjs |  13 ++++++++++---
 3 files changed, 15 insertions(+), 5 deletions(-)

diffs (81 lines):

diff -r 834096122cef -r 1c8b6b9bc06c auto/help
--- a/auto/help	Thu Apr 04 16:07:46 2024 -0700
+++ b/auto/help	Thu Apr 04 16:07:53 2024 -0700
@@ -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 -r 834096122cef -r 1c8b6b9bc06c auto/options
--- a/auto/options	Thu Apr 04 16:07:46 2024 -0700
+++ b/auto/options	Thu Apr 04 16:07:53 2024 -0700
@@ -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 -r 834096122cef -r 1c8b6b9bc06c auto/quickjs
--- a/auto/quickjs	Thu Apr 04 16:07:46 2024 -0700
+++ b/auto/quickjs	Thu Apr 04 16:07:53 2024 -0700
@@ -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


More information about the nginx-devel mailing list