-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathemmake.sh
executable file
·24 lines (18 loc) · 953 Bytes
/
emmake.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
#! /bin/sh
cp xmlvalidate.c libxml2
cd libxml2
patch -N < ../Makefile.am.patch
[ -f ./Makefile ] || emconfigure ./autogen.sh --with-minimum --with-schemas --disable-shared
emmake make
OBJECTS="SAX.o entities.o encoding.o error.o parserInternals.o \
parser.o tree.o hash.o list.o xmlIO.o xmlmemory.o uri.o \
valid.o xlink.o HTMLparser.o HTMLtree.o debugXML.o xpath.o \
xpointer.o xinclude.o nanohttp.o nanoftp.o \
catalog.o globals.o threads.o c14n.o xmlstring.o buf.o \
xmlregexp.o xmlschemas.o xmlschemastypes.o xmlunicode.o \
xmlreader.o relaxng.o dict.o SAX2.o \
xmlwriter.o legacy.o chvalid.o pattern.o xmlsave.o \
xmlmodule.o schematron.o xzlib.o"
emcc -Os xmlvalidate.o $OBJECTS -o xmlvalidate.js -s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_FUNCTIONS='["_validate", "_init"]' -s EXPORTED_RUNTIME_METHODS='["cwrap"]' -s 'ENVIRONMENT=worker' --pre-js ../pre.js --post-js ../post.js
mv xmlvalidate.wasm xmlvalidate.js ../dist
cd ..