From 533add53ad2edc54c5eb0fe3df60b9c2cbb456ef Mon Sep 17 00:00:00 2001 From: Logan McNaughton Date: Fri, 23 Sep 2016 10:25:07 -0600 Subject: [PATCH] Finalize support for pthreads in emscripten --- dist-scripts/dist-cores.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dist-scripts/dist-cores.sh b/dist-scripts/dist-cores.sh index 6afc3c6089..d9158e6ab6 100755 --- a/dist-scripts/dist-cores.sh +++ b/dist-scripts/dist-cores.sh @@ -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