summaryrefslogtreecommitdiffhomepage
path: root/auto/njs
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2022-12-15 08:17:39 -0800
committerKonstantin Pavlov <thresh@nginx.com>2022-12-15 08:17:39 -0800
commite22669f2728814aba82da14702d18bfa9685311e (patch)
treec9c9471dab359e8e33fca24c5d4f035ab5b278db /auto/njs
parenta1d28488f9df8e28ee25ea438c275b96b9afe5b6 (diff)
parent4409a10ff0bd6bb45fb88716bd383cd867958a8a (diff)
downloadunit-e22669f2728814aba82da14702d18bfa9685311e.tar.gz
unit-e22669f2728814aba82da14702d18bfa9685311e.tar.bz2
Merged with the default branch.
Diffstat (limited to '')
-rw-r--r--auto/njs49
1 files changed, 49 insertions, 0 deletions
diff --git a/auto/njs b/auto/njs
new file mode 100644
index 00000000..c0c43f19
--- /dev/null
+++ b/auto/njs
@@ -0,0 +1,49 @@
+
+# Copyright (C) NGINX, Inc.
+
+
+nxt_found=no
+NXT_HAVE_NJS=NO
+
+if /bin/sh -c "(pkg-config njs --exists)" >> $NXT_AUTOCONF_ERR 2>&1;
+then
+ NXT_NJS_AUX_CFLAGS=
+ NXT_NJS_AUX_LIBS=
+ NXT_NJS_CFLAGS=`pkg-config njs --cflags`
+ NXT_NJS_LIBS=`pkg-config njs --libs`
+else
+ NXT_NJS_AUX_CFLAGS=
+ NXT_NJS_AUX_LIBS="$NXT_LIBM $NXT_LIB_AUX_LIBS"
+ NXT_NJS_CFLAGS=
+ NXT_NJS_LIBS="-lnjs"
+fi
+
+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"