]> git.kaiwu.me - njs.git/commitdiff
Configure: added --with-quickjs option.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 4 Apr 2024 23:07:53 +0000 (16:07 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 4 Apr 2024 23:07:53 +0000 (16:07 -0700)
auto/help
auto/options
auto/quickjs

index b053d85ddaab3e2dfdc4eaeef7bc4726796ab0a8..064a209b44ee25d4d73e919892aa291f6efa4543 100644 (file)
--- 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
index 19c5e35db0085d8a68f44f04d890ed9b6db56743..0a4dc6c7444a3419f6b2aee33545bdb18d7f70fd 100644 (file)
@@ -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
index c60739b054b2c2e31d091cb9206719cfa559adb8..28b7902e3bdb68c467507ed9d85f94975f854e7e 100644 (file)
@@ -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