-
Notifications
You must be signed in to change notification settings - Fork 12
/
make.sh
executable file
·51 lines (46 loc) · 1.37 KB
/
make.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
#!/bin/sh
export GITDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/"
export FLACOUTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/flac/src/flac/.libs/"
cd libogg
echo -----------------------------------
echo Making libogg
echo -----------------------------------
./autogen.sh
emconfigure ./configure
emmake make
export OGGDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/
cd ..
cd flac
echo -----------------------------------
echo Making flac
echo -----------------------------------
if [ -d "$FLACOUTDIR" ]; then
emmake make clean
else
./autogen.sh
emconfigure ./configure --with-ogg=$OGGDIR
fi
cd ../libogg
ln -s src/.libs lib
ln -s include/ogg ogg
cd ../flac
emmake make
export FLACDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/
cd ..
cd $FLACOUTDIR
if [ -d "$FLACOUTDIR" ]; then
mv flac flac.so
echo -----------------------------------
echo Building JavaScript
echo -----------------------------------
em++ -O3 $OGGDIR"lib/libogg.so" $FLACDIR"src/libFLAC/.libs/libFLAC.so" flac.so -o flac.html -s EXPORTED_FUNCTIONS="['_main_js']" -s RESERVED_FUNCTION_POINTERS=1
cp -f flac.js $GITDIR"worker/flac.js"
cp -f flac.html.mem $GITDIR"worker/flac.data.js"
cd $GITDIR
echo -----------------------------------
echo Running Press Ctrl+C to abort
echo -----------------------------------
emrun iframe.html
else
echo $FLACOUTDIR is not a directory. Aborting.
fi