@@ -14,17 +14,19 @@ if [ -z "$LLVMDIR" ]; then
14
14
exit 1
15
15
fi
16
16
echo " llvm is in $LLVMDIR "
17
- echo " Building build tools"
18
- cd $LLVMDIR
19
- mkdir tool-build
20
- cd tool-build
17
+ if [ -d " $LLVMDIR /emscripten-build" ]; then
18
+ echo " Please sudo rm -rf $LLVMDIR /emscripten-build."
19
+ exit 1
20
+ fi
21
+ echo " Building build tools ..."
22
+ mkdir -p $LLVMDIR /tool-build &&
23
+ cd $LLVMDIR /tool-build &&
21
24
../configure $CONFIG_ARGS &&
22
25
BUILD_DIRS_ONLY=1 make -j4 || exit 1
23
- cd ..
24
26
25
- echo " Building Bitcode of llvm tools"
26
- mkdir emscripten-build
27
- cd emscripten-build
27
+ echo " Building Bitcode of llvm tools ... "
28
+ mkdir -p $LLVMDIR / emscripten-build &&
29
+ cd $LLVMDIR / emscripten-build &&
28
30
$EMSCRIPTEN_ROOT /emconfigure ../configure $CONFIG_ARGS --with-extra-options=-Wno-warn-absolute-paths || exit 2
29
31
# sed -e '/HAVE_ARC4RANDOM/ s?^?//?' -i .bak include/llvm/Config/config.h
30
32
mkdir -p Release/bin &&
@@ -35,7 +37,7 @@ curl https://raw.githubusercontent.com/kripken/Relooper/master/ministring.h > in
35
37
$EMSCRIPTEN_ROOT /emmake make -i -j4 # &> /dev/null
36
38
37
39
echo " Copying tools to bitcode-for-js"
38
- # rm -rf $SCRIPTDIR/bitcode-for-js
39
- mkdir $SCRIPTDIR /bitcode-for-js
40
+ rm -rf $SCRIPTDIR /bitcode-for-js
41
+ mkdir -p $SCRIPTDIR /bitcode-for-js &&
40
42
find $LLVMDIR /emscripten-build/Release/bin -maxdepth 1 -not -perm -111 -not -name " .*" -type f -exec basename {} \; | xargs -I% cp $LLVMDIR /emscripten-build/Release/bin/% $SCRIPTDIR /bitcode-for-js/%.bc
41
43
0 commit comments