summaryrefslogtreecommitdiffhomepage
path: root/auto
diff options
context:
space:
mode:
Diffstat (limited to 'auto')
-rw-r--r--auto/modules/wasm21
1 files changed, 20 insertions, 1 deletions
diff --git a/auto/modules/wasm b/auto/modules/wasm
index 1f388de6..17648b5f 100644
--- a/auto/modules/wasm
+++ b/auto/modules/wasm
@@ -62,6 +62,8 @@ NXT_WASM_LIB_PATH=${NXT_WASM_LIB_PATH=}
NXT_WASM_LDFLAGS=
if [ "$NXT_WASM_RUNTIME" = "wasmtime" ]; then
NXT_WASM_LDFLAGS=-lwasmtime
+elif [ "$NXT_WASM_RUNTIME" = "wamr" ]; then
+ NXT_WASM_LDFLAGS="-lvmlib -lm"
fi
NXT_WASM_ADDITIONAL_FLAGS="-fno-strict-aliasing \
-Wno-missing-field-initializers \
@@ -111,10 +113,25 @@ if [ "$NXT_WASM_RUNTIME" = "wasmtime" ]; then
return 0;
}"
+elif [ "$NXT_WASM_RUNTIME" = "wamr" ]; then
+ nxt_feature="wamr"
+ nxt_feature_name=""
+ nxt_feature_run=no
+ nxt_feature_incs="-I${NXT_WASM_INCLUDE_PATH}"
+ nxt_feature_libs="-L${NXT_WASM_LIB_PATH} $NXT_WASM_LDFLAGS"
+ nxt_feature_test="
+ #include <wasm_export.h>
- . auto/feature
+ int main(void) {
+ if (!wasm_runtime_init())
+ return 1;
+
+ return 0;
+ }"
fi
+. auto/feature
+
if [ $nxt_found = no ]; then
$echo
$echo $0: error: no $NXT_WASM_RUNTIME found.
@@ -143,6 +160,8 @@ NXT_WASM_MODULE_SRCS=" \
if [ "$NXT_WASM_RUNTIME" = "wasmtime" ]; then
NXT_WASM_MODULE_SRCS="$NXT_WASM_MODULE_SRCS src/wasm/nxt_rt_wasmtime.c"
+elif [ "$NXT_WASM_RUNTIME" = "wamr" ]; then
+ NXT_WASM_MODULE_SRCS="$NXT_WASM_MODULE_SRCS src/wasm/nxt_rt_wamr.c"
fi