summaryrefslogtreecommitdiffhomepage
path: root/auto/njs
diff options
context:
space:
mode:
authorZhidao HONG <z.hong@f5.com>2022-11-20 23:16:51 +0800
committerZhidao HONG <z.hong@f5.com>2022-11-20 23:16:51 +0800
commit4d6d146e920667a8afeacd355e4fb6a94387066e (patch)
treed25e70f93a4f91960434c4d631072e9936f80e36 /auto/njs
parent4735931ace321752c387dae04c8b217ef22897ee (diff)
downloadunit-4d6d146e920667a8afeacd355e4fb6a94387066e.tar.gz
unit-4d6d146e920667a8afeacd355e4fb6a94387066e.tar.bz2
Basic njs support.
Diffstat (limited to 'auto/njs')
-rw-r--r--auto/njs41
1 files changed, 41 insertions, 0 deletions
diff --git a/auto/njs b/auto/njs
new file mode 100644
index 00000000..72304793
--- /dev/null
+++ b/auto/njs
@@ -0,0 +1,41 @@
+
+# Copyright (C) NGINX, Inc.
+
+
+nxt_found=no
+NXT_HAVE_NJS=NO
+
+NXT_NJS_CFLAGS=
+NXT_NJS_AUX_CFLAGS=
+NXT_NJS_LIBS="-lnjs"
+NXT_NJS_AUX_LIBS="$NXT_LIBM $NXT_LIB_AUX_LIBS"
+
+nxt_feature="NJS"
+nxt_feature_name=NXT_HAVE_NJS
+nxt_feature_run=no
+nxt_feature_incs="$NXT_NJS_CFLAGS $NXT_NJS_AUX_CFLAGS"
+nxt_feature_libs="$NXT_NJS_LIBS $NXT_NJS_AUX_LIBS"
+nxt_feature_test="#include <njs.h>
+
+ int main(void) {
+ njs_vm_t *vm;
+ njs_vm_opt_t opts;
+
+ njs_vm_opt_init(&opts);
+
+ vm = njs_vm_create(&opts);
+ if (vm == NULL)
+ return 1;
+ return 0;
+ }"
+. auto/feature
+
+if [ $nxt_found = no ]; then
+ $echo
+ $echo $0: error: no NJS library found.
+ $echo
+ exit 1;
+fi
+
+NXT_LIB_AUX_CFLAGS="$NXT_LIB_AUX_CFLAGS $NXT_NJS_CFLAGS"
+NXT_LIB_AUX_LIBS="$NXT_NJS_LIBS $NXT_LIB_AUX_LIBS"