~mcf/mupdf

ref: e27ceb2b0e64b9a56ba79d844ea96553d87dc113 mupdf/platform/wasm/build.sh -rw-r--r-- 621 bytes
e27ceb2b — Robin Watts OSS-Fuzz 29728: Avoid buffer overflow. 1 year, 6 months ago
                                                                                
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
#!/bin/bash

make -j4 -C ../.. generate

source /opt/emsdk/emsdk_env.sh

echo Building library:
make -j4 -C ../.. \
	OS=wasm build=release \
	XCFLAGS="-DTOFU -DTOFU_CJK -DFZ_ENABLE_SVG=0 -DFZ_ENABLE_HTML=0 -DFZ_ENABLE_EPUB=0 -DFZ_ENABLE_JS=0" \
	libs

echo
echo Linking WebAssembly:
emcc -Wall -Os -g1 -o libmupdf.js \
	-s WASM=1 \
	-s VERBOSE=0 \
	-s ASSERTIONS=1 \
	-s ABORTING_MALLOC=0 \
	-s TOTAL_MEMORY=134217728 \
	-s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall","cwrap"]' \
	-I ../../include \
	--pre-js wrap.js \
	wrap.c \
	../../build/wasm/release/libmupdf.a \
	../../build/wasm/release/libmupdf-third.a

echo Done.