From e41b121e94ccce9877824e55f865885bbabe40c3 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Sun, 16 Jan 2022 02:34:43 +0900 Subject: [PATCH] [wasm] configure.ac: setup platform specific libraries These flags are very wasi-libc version specific, so updating wasi-libc may break the build. But supporting multiple wasi-libc versions in ruby doesn't have much benefit because wasi-libc is not installed in most systems. --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index 840fa110a3..f0f3bab570 100644 --- a/configure.ac +++ b/configure.ac @@ -1215,6 +1215,10 @@ main() RUBY_APPEND_OPTIONS(LDFLAGS, "-sFORCE_FILESYSTEM=1") ac_cv_func_shutdown=no ], +[wasi*],[ LIBS="-lm -lwasi-emulated-mman -lwasi-emulated-signal -lwasi-emulated-getpid -lwasi-emulated-process-clocks $LIBS" + RUBY_APPEND_OPTIONS(CFLAGS, -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_MMAN -D_WASI_EMULATED_GETPID -D_WASI_EMULATED_PROCESS_CLOCKS) + RUBY_APPEND_OPTIONS(CPPFLAGS, -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_MMAN -D_WASI_EMULATED_GETPID -D_WASI_EMULATED_PROCESS_CLOCKS) + ] [ LIBS="-lm $LIBS"]) : ${ORIG_LIBS=$LIBS}