-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-chez.sh
65 lines (47 loc) · 1.25 KB
/
build-chez.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#! /bin/sh
PETITE=1
set -e
if ! [ -x "$(command -v node)" ]; then
echo 'node is not installed.' >&2
echo 'Please install it at https://nodejs.org/en/' >&2
exit 1
fi
if ! [ -x "$(command -v make)" ]; then
echo 'make is not installed.' >&2
exit 1
fi
if ! [ -x "$(command -v emcc)" ]; then
echo 'emcc is not installed.' >&2
echo 'Please install it at https://emscripten.org/docs/getting_started/downloads.html' >&2
exit 1
fi
git submodule update
cd ChezScheme
git submodule update
if [ $PETITE ]; then
empetite='--empetite'
fi
./configure --emscripten $empetite
make
echo 'Finished make'
cd em-pb/c
# The default build doesn't quite work for us, so we create our own.
emcc -DDISABLE_ICONV -Wpointer-arith -Wall -Wextra -Wno-implicit-fallthrough \
-Os \
-s USE_ZLIB=1 \
-s EXIT_RUNTIME=1 \
-s ALLOW_MEMORY_GROWTH=1 \
-s MODULARIZE=1 \
-s EXPORT_ES6=1 \
-o ../bin/pb/scheme.js ../boot/pb/main.o ../boot/pb/libkernel.a ../lz4/lib/liblz4.a
echo 'Finished building'
cd ..
mkdir ../../src/chez/
cp bin/pb/scheme.wasm ../../src/chez/
cp bin/pb/scheme.js ../../src/chez/
cp boot/pb/petite.boot ../../src/chez/
if ! [ $PETITE ]; then
cp boot/pb/scheme.boot ../../src/chez/
fi
cd ../..
node process-scheme.cjs