Skip to content

Commit 5919a57

Browse files
committed
build-wasi.sh: Move some settings to mpconfigvariant.mk.
Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
1 parent 2825247 commit 5919a57

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

ports/unix/build-wasi.sh

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,8 @@
11
#! /bin/sh
22

3-
# prerequisites
4-
#
5-
# WASI_SDK: wasi-sdk 25.0 or later
6-
# WASM_OPT: binaryen wasm-opt version_117 or later
7-
8-
# Note:
9-
# we specify the target "--target=wasm32-wasi" explicitly below for the case
10-
# where $CLANG is built with a configuration different from wasi-sdk.
11-
# ditto for "-B ${WASI_SDK}/bin/".
12-
133
set -e
144

15-
WASI_SDK=${WASI_SDK:-/opt/wasi-sdk-25.0}
16-
WASI_SYSROOT=${WASI_SYSROOT:-${WASI_SDK}/share/wasi-sysroot}
17-
WASM_OPT=${WASM_OPT:-wasm-opt}
18-
RESOURCE_DIR=$(${WASI_SDK}/bin/clang --print-resource-dir)
19-
LLVM_DIR=${LLVM_DIR:-${WASI_SDK}}
20-
CLANG=${CLANG:-${LLVM_DIR}/bin/clang}
21-
CC="${CLANG} --sysroot ${WASI_SYSROOT} -resource-dir ${RESOURCE_DIR}"
22-
23-
CFLAGS="--target=wasm32-wasi -D_WASI_EMULATED_PROCESS_CLOCKS -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_MMAN -mllvm -wasm-enable-sjlj" \
24-
LDFLAGS="--target=wasm32-wasi -lwasi-emulated-process-clocks -lwasi-emulated-signal -lwasi-emulated-mman -lsetjmp -B ${WASI_SDK}/bin/" \
255
make \
26-
CC="${CC}" \
27-
STRIP="${WASI_SDK}/bin/strip" \
28-
SIZE="${WASI_SDK}/bin/size" \
296
UNAME_S=wasi \
307
VARIANT=wasi \
318
"$@"

ports/unix/variants/wasi/mpconfigvariant.mk

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
# prerequisites
2+
#
3+
# WASI_SDK: wasi-sdk 25.0 or later
4+
# WASM_OPT: binaryen wasm-opt version_117 or later
5+
6+
# Note:
7+
# we specify the target "--target=wasm32-wasi" explicitly below for the case
8+
# where $CLANG is built with a configuration different from wasi-sdk.
9+
# ditto for "-B ${WASI_SDK}/bin/".
10+
11+
WASI_SDK = /opt/wasi-sdk-25.0
12+
WASI_SYSROOT = $(WASI_SDK)/share/wasi-sysroot
13+
WASM_OPT = wasm-opt
14+
RESOURCE_DIR = $(shell $(WASI_SDK)/bin/clang --print-resource-dir)
15+
LLVM_DIR = $(WASI_SDK)
16+
CLANG = $(LLVM_DIR)/bin/clang
17+
18+
CC = $(CLANG) --sysroot $(WASI_SYSROOT) -resource-dir $(RESOURCE_DIR)
19+
STRIP = $(WASI_SDK)/bin/strip
20+
SIZE = $(WASI_SDK)/bin/size
21+
22+
CFLAGS += --target=wasm32-wasi -D_WASI_EMULATED_PROCESS_CLOCKS -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_MMAN -mllvm -wasm-enable-sjlj
23+
24+
LDFLAGS += --target=wasm32-wasi -lwasi-emulated-process-clocks -lwasi-emulated-signal -lwasi-emulated-mman -lsetjmp -B ${WASI_SDK}/bin/
25+
126
# WASI doesn't have FFI
227
MICROPY_PY_FFI = 0
328

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy