forked from trevorlinton/webkit.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.sh
executable file
·50 lines (43 loc) · 1.3 KB
/
config.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
#!/bin/sh
if [ -d "$JAVA_HEAP_SIZE" ]; then
export JAVA_HEAP_SIZE="2048m"
fi
if [ -d "$JAVAFLAGS" ]; then
export JAVAFLAGS="-client -d32"
export JAVA_FLAGS=$JAVAFLAGS
fi
export EMSCRIPTEN_ROOT=`em-config EMSCRIPTEN_ROOT`
export NINJA_ROOT=`which ninja`
if [ ! "$NINJA_ROOT" ]; then
echo "Cannot find ninja build tool.";
exit 1
fi
if [ -d "$EMSCRIPTEN_ROOT" ]; then
export EMSCRIPTEN_EMCC=$EMSCRIPTEN_ROOT/emcc
export EMSCRIPTEN_EMCPP=$EMSCRIPTEN_ROOT/em++
if [ -z "$EMSCRIPTEN_INCLUDE" ]; then
export EMSCRIPTEN_INCLUDE=$EMSCRIPTEN_ROOT/system/include
fi
if [ ! -d "$EMSCRIPTEN_INCLUDE" ]; then
echo "config.sh: Error: Cannot find system include directory for emscripten."
exit 1
fi
else
echo "config.sh: Error: Cannot find root directory for emscripten."
exit 1
fi
# if [ `uname`=='Darwin' ]; then
# echo "Building Xcode and Ninja files."
# export GYP_GENERATORS=xcode,ninja
# else
echo "Building Ninja files."
export GYP_GENERATORS=ninja
# fi
export GYP_DEFINES="clang=1"
./tools/gyp-emscripten/gyp -Dsource_arch=js -Dtarget_arch=js -Darch=js --toplevel-dir=$PWD --depth=. --generator-output=. -G output_dir=. webkit.gyp
if [ "$?" -ne "0" ]; then
echo "Failed to configure webkit.js properly."
exit 1
else
echo "webkit.js project files successfully configured and built."
fi