]> git.kaiwu.me - njs.git/commitdiff
Configure: improved QuickJS discovery.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 4 Apr 2024 23:07:46 +0000 (16:07 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 4 Apr 2024 23:07:46 +0000 (16:07 -0700)
At the first try do not assume the exact library and includes location.

auto/quickjs

index aba868866938897bbc23b68cbf20773ec6d9e367..c60739b054b2c2e31d091cb9206719cfa559adb8 100644 (file)
@@ -9,11 +9,11 @@ NJS_HAVE_QUICKJS=NO
 if [ $NJS_QUICKJS = YES ]; then
     njs_found=no
 
-    njs_feature="QuickJS library"
+    njs_feature="QuickJS library -lquickjs.lto"
     njs_feature_name=NJS_HAVE_QUICKJS
     njs_feature_run=yes
     njs_feature_incs=
-    njs_feature_libs=""
+    njs_feature_libs="-lquickjs.lto -lm -ldl -lpthread"
     njs_feature_test="#if defined(__GNUC__) && (__GNUC__ >= 8)
                       #pragma GCC diagnostic push
                       #pragma GCC diagnostic ignored \"-Wcast-function-type\"
@@ -31,7 +31,14 @@ if [ $NJS_QUICKJS = YES ]; then
     . auto/feature
 
     if [ $njs_found = no ]; then
-        njs_feature="QuickJS library -lquickjs.lto"
+        njs_feature="QuickJS library -lquickjs"
+        njs_feature_libs="-lquickjs -lm -ldl -lpthread"
+
+        . auto/feature
+    fi
+
+    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"
 
@@ -39,7 +46,8 @@ if [ $NJS_QUICKJS = YES ]; then
     fi
 
     if [ $njs_found = no ]; then
-        njs_feature="QuickJS library -lquickjs"
+        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"
 
         . auto/feature