Skip to content

Commit 0901177

Browse files
committed
Supressing emscripten warning about -I paths
Showing compiler output, taking EMSCRIPTEN_ROOT from ~/.emscripten (can be overriden with EMSCRIPTEN env variable)
1 parent 0afc570 commit 0901177

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

make-bitcode-for-javascript.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
if [ "$#" -ne 1 ]; then
2+
echo "Illegal number of parameters"
3+
exit 1
4+
fi
5+
# Override by setting EMSCRIPTEN environment variable
6+
EMSCRIPTEN_ROOT=$(python -c 'import os; import imp; print imp.load_source("", os.path.expanduser("~/.emscripten")).EMSCRIPTEN_ROOT')
17
SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
28
LLVMDIR=$( cd "$1" && pwd )
39
echo "Running from $SCRIPTDIR"
10+
echo "Using emscripten in $EMSCRIPTEN_ROOT"
411
if [ -z "$LLVMDIR" ]; then
512
echo "Specify a path to an llvm or fastcomp source tree"
613
exit 1
@@ -10,24 +17,24 @@ echo "Building build tools"
1017
cd $LLVMDIR
1118
mkdir tool-build
1219
cd tool-build
13-
../configure --enable-optimized --enable-targets=x86,js --enable-libcpp --disable-jit --disable-threads --disable-pthreads --disable-assertions --enable-cxx11 &> /dev/null &&
14-
BUILD_DIRS_ONLY=1 make -j4 &> /dev/null || exit 1
20+
../configure --enable-optimized --enable-targets=x86,js --enable-libcpp --disable-jit --disable-threads --disable-pthreads --disable-assertions --enable-cxx11 &&
21+
BUILD_DIRS_ONLY=1 make -j4 || exit 1
1522
cd ..
1623

1724
echo "Building Bitcode of llvm tools"
1825
mkdir emscripten-build
1926
cd emscripten-build
20-
emconfigure ../configure --enable-optimized --enable-targets=x86,js --enable-libcpp --disable-jit --disable-threads --disable-pthreads --disable-assertions --enable-bindings=no --disable-zlib &>/dev/null || exit 1
27+
$EMSCRIPTEN_ROOT/emconfigure ../configure --with-extra-options=-Wno-warn-absolute-paths --enable-optimized --enable-targets=x86,js --enable-libcpp --disable-jit --disable-threads --disable-pthreads --disable-assertions --enable-bindings=no --disable-zlib || exit 2
2128
#sed -e '/HAVE_ARC4RANDOM/ s?^?//?' -i .bak include/llvm/Config/config.h
2229
mkdir -p Release/bin &&
2330
cp ../tool-build/Release/bin/* Release/bin &&
2431
chflags uchg Release/bin/* || exit 1
2532
cp $SCRIPTDIR/stdio.h include &&
2633
curl https://raw.githubusercontent.com/kripken/Relooper/master/ministring.h > include/ministring.h &&
27-
emmake make -i -j4 #&> /dev/null
34+
$EMSCRIPTEN_ROOT/emmake make -i -j4 #&> /dev/null
2835

2936
echo "Copying tools to bitcode-for-js"
3037
#rm -rf $SCRIPTDIR/bitcode-for-js
3138
mkdir $SCRIPTDIR/bitcode-for-js
32-
find $LLVMDIR/emscripten-build/Release/bin -maxdepth 1 -not -perm -111 -not -name ".*" -type f -exec basename {} \;| xargs -I% cp -v $LLVMDIR/emscripten-build/Release/bin/% $SCRIPTDIR/bitcode-for-js/%.bc
39+
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
3340

0 commit comments

Comments
 (0)