Finalize support for pthreads in emscripten

This commit is contained in:
Logan McNaughton 2016-09-23 10:25:07 -06:00 committed by GitHub
parent 159d0b55cf
commit 533add53ad

View File

@ -138,6 +138,7 @@ for f in `ls -v *_${platform}.${EXT}`; do
whole_archive=
big_stack=
async=0
pthread=0
if [ $name = "nxengine" ] ; then
echo "Applying whole archive linking..."
whole_archive="WHOLE_ARCHIVE_LINK=1"
@ -162,7 +163,7 @@ for f in `ls -v *_${platform}.${EXT}`; do
if [ $MAKEFILE_GRIFFIN = "yes" ]; then
make -C ../ -f Makefile.griffin platform=${platform} clean || exit 1
elif [ $PLATFORM = "emscripten" ]; then
make -C ../ -f Makefile.emscripten ASYNC=$async LTO=$lto -j7 clean || exit 1
make -C ../ -f Makefile.emscripten PTHREAD=$pthread ASYNC=$async LTO=$lto -j7 clean || exit 1
elif [ $PLATFORM = "unix" ]; then
make -C ../ -f Makefile LINK=g++ LTO=$lto -j7 clean || exit 1
else
@ -174,7 +175,7 @@ for f in `ls -v *_${platform}.${EXT}`; do
if [ $MAKEFILE_GRIFFIN = "yes" ]; then
make -C ../ -f Makefile.griffin platform=${platform} $whole_archive $big_stack -j3 || exit 1
elif [ $PLATFORM = "emscripten" ]; then
make -C ../ -f Makefile.emscripten ASYNC=$async LTO=$lto -j7 TARGET=${name}_libretro.js || exit 1
make -C ../ -f Makefile.emscripten PTHREAD=$pthread ASYNC=$async LTO=$lto -j7 TARGET=${name}_libretro.js || exit 1
elif [ $PLATFORM = "unix" ]; then
make -C ../ -f Makefile LINK=g++ $whole_archive $big_stack -j3 || exit 1
elif [ $PLATFORM = "ctr" ]; then
@ -251,6 +252,9 @@ for f in `ls -v *_${platform}.${EXT}`; do
mkdir -p ../pkg/emscripten/
mv -f ../${name}_libretro.js ../pkg/emscripten/${name}_libretro.js
mv -f ../${name}_libretro.js.mem ../pkg/emscripten/${name}_libretro.js.mem
if [ $pthread != 0 ] ; then
mv -f ../pthread-main.js ../pkg/emscripten/pthread-main.js
fi
fi
# Remove executable files
@ -279,7 +283,7 @@ for f in `ls -v *_${platform}.${EXT}`; do
if [ $MAKEFILE_GRIFFIN = "yes" ]; then
make -C ../ -f Makefile.griffin platform=${platform} clean || exit 1
elif [ $PLATFORM = "emscripten" ]; then
make -C ../ -f Makefile.emscripten ASYNC=$async LTO=$lto -j7 clean || exit 1
make -C ../ -f Makefile.emscripten PTHREAD=$pthread ASYNC=$async LTO=$lto -j7 clean || exit 1
elif [ $PLATFORM = "unix" ]; then
make -C ../ -f Makefile LTO=$lto -j7 clean || exit 1
else