mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-20 14:19:18 +02:00
Repair emscripten build
This commit is contained in:
parent
8f52f457d6
commit
0078ae2e83
2 changed files with 15 additions and 7 deletions
13
Makefile
13
Makefile
|
@ -20,6 +20,8 @@ CHIBI_DEPENDENCIES = ./chibi-scheme$(EXE)
|
||||||
|
|
||||||
SNOW_CHIBI ?= tools/snow-chibi
|
SNOW_CHIBI ?= tools/snow-chibi
|
||||||
|
|
||||||
|
TEMPFILE := $(shell mktemp -t chibi.XXXXXX)
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
CHIBI_COMPILED_LIBS = lib/chibi/filesystem$(SO) lib/chibi/process$(SO) \
|
CHIBI_COMPILED_LIBS = lib/chibi/filesystem$(SO) lib/chibi/process$(SO) \
|
||||||
|
@ -87,16 +89,17 @@ all: chibi-scheme$(EXE) all-libs chibi-scheme.pc $(META_FILES)
|
||||||
js: js/chibi.js
|
js: js/chibi.js
|
||||||
|
|
||||||
js/chibi.js: chibi-scheme-emscripten chibi-scheme-static.bc js/pre.js js/post.js js/exported_functions.json
|
js/chibi.js: chibi-scheme-emscripten chibi-scheme-static.bc js/pre.js js/post.js js/exported_functions.json
|
||||||
emcc -O2 chibi-scheme-static.bc -o $@ -s MODULARIZE=1 -s EXPORT_NAME=\"Chibi\" -s EXPORTED_FUNCTIONS=@js/exported_functions.json `find lib -type f \( -name "*.scm" -or -name "*.sld" \) -printf " --preload-file %p"` --pre-js js/pre.js --post-js js/post.js
|
emcc -O3 chibi-scheme-static.bc -o $@ -s MODULARIZE=1 -s EXPORT_NAME=\"Chibi\" -s EXPORTED_FUNCTIONS=@js/exported_functions.json `find lib -type f \( -name "*.scm" -or -name "*.sld" \) -printf " --preload-file %p"` --pre-js js/pre.js --post-js js/post.js
|
||||||
|
|
||||||
chibi-scheme-static.bc:
|
chibi-scheme-static.bc:
|
||||||
emmake $(MAKE) PLATFORM=emscripten CHIBI_DEPENDENCIES= CHIBI=./chibi-scheme-emscripten PREFIX= CFLAGS=-O2 SEXP_USE_DL=0 EXE=.bc SO=.bc CPPFLAGS="-DSEXP_USE_STRICT_TOPLEVEL_BINDINGS=1 -DSEXP_USE_ALIGNED_BYTECODE=1 -DSEXP_USE_STATIC_LIBS=1" clibs.c chibi-scheme-static.bc
|
emmake $(MAKE) PLATFORM=emscripten CHIBI_DEPENDENCIES= CHIBI=./chibi-scheme-emscripten PREFIX= CFLAGS=-O2 SEXP_USE_DL=0 EXE=.bc SO=.bc CPPFLAGS="-DSEXP_USE_STRICT_TOPLEVEL_BINDINGS=1 -DSEXP_USE_ALIGNED_BYTECODE=1 -DSEXP_USE_STATIC_LIBS=1 -DSEXP_USE_STATIC_LIBS_NO_INCLUDE=0" clibs.c chibi-scheme-static.bc
|
||||||
|
|
||||||
chibi-scheme-emscripten: VERSION
|
chibi-scheme-emscripten: VERSION
|
||||||
$(MAKE) clean
|
$(MAKE) dist-clean
|
||||||
$(MAKE) chibi-scheme-static PLATFORM=emscripten SEXP_USE_DL=0
|
$(MAKE) chibi-scheme-static PLATFORM=emscripten SEXP_USE_DL=0
|
||||||
mv chibi-scheme-static$(EXE) chibi-scheme-emscripten
|
mv chibi-scheme-static$(EXE) $(TEMPFILE)
|
||||||
$(MAKE) clean
|
$(MAKE) dist-clean
|
||||||
|
mv $(TEMPFILE) chibi-scheme-emscripten
|
||||||
|
|
||||||
include/chibi/install.h: Makefile
|
include/chibi/install.h: Makefile
|
||||||
echo '#define sexp_so_extension "'$(SO)'"' > $@
|
echo '#define sexp_so_extension "'$(SO)'"' > $@
|
||||||
|
|
|
@ -39,14 +39,19 @@
|
||||||
FP_SUBNORMAL)
|
FP_SUBNORMAL)
|
||||||
|
|
||||||
(c-declare
|
(c-declare
|
||||||
"#ifndef FP_FAST_FMA
|
"#if defined(__EMSCRIPTEN__) || !defined(FP_FAST_FMA)
|
||||||
#define FP_FAST_FMA 0
|
#define FP_FAST_FMA 0
|
||||||
#endif")
|
#endif")
|
||||||
|
|
||||||
(define-c-const boolean
|
(define-c-const boolean
|
||||||
(fl-fast-+* FP_FAST_FMA))
|
(fl-fast-+* FP_FAST_FMA))
|
||||||
|
|
||||||
(define-c double (fl+* "fma") (double double double))
|
(cond-expand
|
||||||
|
(emscripten
|
||||||
|
(c-declare "#define flmuladd(x, y, z) ((x) * (y) + (z))")
|
||||||
|
(define-c double (fl+* "flmuladd") (double double double)))
|
||||||
|
(else
|
||||||
|
(define-c double (fl+* "fma") (double double double))))
|
||||||
|
|
||||||
;; These aren't any faster than the builtin ops. It might be
|
;; These aren't any faster than the builtin ops. It might be
|
||||||
;; interesting to provide these as a way to get flonum support when
|
;; interesting to provide these as a way to get flonum support when
|
||||||
|
|
Loading…
Add table
Reference in a new issue