diff --git a/Makefile.griffin b/Makefile.griffin index 19d7b5a3cf..c7c7c4fd45 100644 --- a/Makefile.griffin +++ b/Makefile.griffin @@ -49,6 +49,11 @@ PYTHON2 = python2$(EXE_EXT) PYTHON3 = python3$(EXE_EXT) GIT = git$(EXE_EXT) +ifeq ($(WHOLE_ARCHIVE_LINK), 1) + WHOLE_START := -Wl,--whole-archive + WHOLE_END := -Wl,--no-whole-archive +endif + ifeq ($(platform), ngc) CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT) CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT) @@ -120,10 +125,6 @@ else ifeq ($(platform), psp1) endif CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE) -ifeq ($(WHOLE_ARCHIVE_LINK), 1) - WHOLE_START := -Wl,--whole-archive - WHOLE_END := -Wl,--no-whole-archive -endif OBJ = griffin/griffin.o $(PLATOBJS) diff --git a/dist-scripts/emscripten-cores.sh b/dist-scripts/emscripten-cores.sh index 1983fefdde..b335b7ddcf 100644 --- a/dist-scripts/emscripten-cores.sh +++ b/dist-scripts/emscripten-cores.sh @@ -8,7 +8,7 @@ fi make -C ../ -f Makefile.emscripten clean || exit 1 for f in *_emscripten.bc ; do - name=`echo "$f" | sed 's/\(_libretro\|\)_emscripten.bc$//'` + name=`echo "$f" | sed 's/\(_libretro_emscripten\|\).bc$//'` lto=1 echo "building $name" if [ $name = "tyrquake" ] ; then diff --git a/dist-scripts/ngc-cores.sh b/dist-scripts/ngc-cores.sh index 31ad41ec55..c9dc2d7686 100755 --- a/dist-scripts/ngc-cores.sh +++ b/dist-scripts/ngc-cores.sh @@ -3,13 +3,15 @@ make -C ../ -f Makefile.griffin platform=ngc clean || exit 1 for f in *_ngc.a ; do - name=`echo "$f" | sed 's/\(_libretro\|\)_ngc.a$//'` + name=`echo "$f" | sed 's/\(_libretro_ngc\|\).a$//'` whole_archive= big_stack= if [ $name = "nxengine" ] ; then + echo "NXEngine found, applying whole archive linking..." whole_archive="WHOLE_ARCHIVE_LINK=1" fi if [ $name = "tyrquake" ] ; then + echo "Tyrquake found, applying big stack..." big_stack="BIG_STACK=1" fi cp -f "$f" ../libretro_ngc.a diff --git a/dist-scripts/ps3-cores-cex-355.sh b/dist-scripts/ps3-cores-cex-355.sh index 00bdb4561b..dc062b2dda 100755 --- a/dist-scripts/ps3-cores-cex-355.sh +++ b/dist-scripts/ps3-cores-cex-355.sh @@ -11,9 +11,10 @@ make -C ../ -f Makefile.ps3.rgl || exit 1 EXE_PATH=/usr/local/cell/host-win32/bin for f in *_ps3.a ; do - name=`echo "$f" | sed 's/\(_libretro\|\)_ps3.a$//'` + name=`echo "$f" | sed 's/\(_libretro_ps3\|\).a$//'` whole_archive= if [ $name = "nxengine" ] ; then + echo "NXEngine found, applying whole archive linking..." whole_archive="WHOLE_ARCHIVE_LINK=1" echo $name yes fi diff --git a/dist-scripts/ps3-cores-cobraode.sh b/dist-scripts/ps3-cores-cobraode.sh index 7139ae448e..bbcaa186d9 100644 --- a/dist-scripts/ps3-cores-cobraode.sh +++ b/dist-scripts/ps3-cores-cobraode.sh @@ -13,9 +13,10 @@ SCETOOL_PATH=/cygdrive/c/Users/aaa801/ps3tools/ps3tools/tools/scetool/scetool.ex SCETOOL_FLAGS="--sce-type SELF --compress-data FALSE --self-type APP --key-revision 0004 --self-fw-version 0003004100000000 --self-app-version 0001000000000000 --self-auth-id 1010000001000003 --self-vendor-id 01000002 --self-cap-flags 00000000000000000000000000000000000000000000003b0000000100040000" for f in *_ps3.a ; do - name=`echo "$f" | sed 's/\(_libretro\|\)_ps3.a$//'` + name=`echo "$f" | sed 's/\(_libretro_ps3\|\).a$//'` whole_archive= if [ $name = "nxengine" ] ; then + echo "NXEngine found, applying whole archive linking..." whole_archive="WHOLE_ARCHIVE_LINK=1" echo $name yes fi diff --git a/dist-scripts/ps3-cores-dex.sh b/dist-scripts/ps3-cores-dex.sh index 9328dd8d46..3dfa213bd8 100755 --- a/dist-scripts/ps3-cores-dex.sh +++ b/dist-scripts/ps3-cores-dex.sh @@ -12,9 +12,10 @@ MAKE_FSELF_NPDRM=$EXE_PATH/make_fself_npdrm.exe MAKE_PACKAGE_NPDRM=$EXE_PATH/make_package_npdrm.exe for f in *_ps3.a ; do - name=`echo "$f" | sed 's/\(_libretro\|\)_ps3.a$//'` + name=`echo "$f" | sed 's/\(_libretro_ps3\|\).a$//'` whole_archive= if [ $name = "nxengine" ] ; then + echo "NXEngine found, applying whole archive linking..." whole_archive="WHOLE_ARCHIVE_LINK=1" echo $name yes fi diff --git a/dist-scripts/psp1-cores.sh b/dist-scripts/psp1-cores.sh index 9264624341..df4680272c 100755 --- a/dist-scripts/psp1-cores.sh +++ b/dist-scripts/psp1-cores.sh @@ -7,13 +7,15 @@ make -C ../ -f Makefile.psp1 clean || exit 1 make -C ../ -f Makefile.psp1 || exit 1 for f in *_psp1.a ; do - name=`echo "$f" | sed 's/\(_libretro\|\)_psp1.a$//'` + name=`echo "$f" | sed 's/\(_libretro_psp1\|\).a$//'` whole_archive= big_stack= if [ $name = "nxengine" ] ; then + echo "NXEngine found, applying whole archive linking..." whole_archive="WHOLE_ARCHIVE_LINK=1" fi if [ $name = "tyrquake" ] ; then + echo "Tyrquake found, applying big stack..." big_stack="BIG_STACK=1" fi cp -f "$f" ../libretro_psp1.a diff --git a/dist-scripts/wii-cores.sh b/dist-scripts/wii-cores.sh index 2398490baa..78d9d37d7d 100755 --- a/dist-scripts/wii-cores.sh +++ b/dist-scripts/wii-cores.sh @@ -7,13 +7,15 @@ make -C ../ -f Makefile.wii.salamander || exit 1 make -C ../ -f Makefile.wii.salamander pkg || exit 1 for f in *_wii.a ; do - name=`echo "$f" | sed 's/\(_libretro\|\)_wii.a$//'` + name=`echo "$f" | sed 's/\(_libretro_wii\|\).a$//'` whole_archive= big_stack= if [ $name = "nxengine" ] ; then + echo "NXEngine found, applying whole archive linking..." whole_archive="WHOLE_ARCHIVE_LINK=1" fi if [ $name = "tyrquake" ] ; then + echo "Tyrquake found, applying big stack..." big_stack="BIG_STACK=1" fi cp -f "$f" ../libretro_wii.a diff --git a/dist-scripts/xdk1-cores.sh b/dist-scripts/xdk1-cores.sh index 312e665848..3892a64b49 100644 --- a/dist-scripts/xdk1-cores.sh +++ b/dist-scripts/xdk1-cores.sh @@ -12,9 +12,10 @@ mkdir -p ../msvc/RetroArch-Xbox1/Release mkdir -p ../msvc/RetroArch-Xbox1/Release_LTCG for f in *_xdk.lib ; do - name=`echo "$f" | sed 's/\(_libretro\|\)_xdk.lib$//'` + name=`echo "$f" | sed 's/\(_libretro_xdk\|\).lib$//'` echo $name if [ $name = "tyrquake" ] || [ $name = "genesis_plus_gx" ] ; then + echo "Applying whole archive linking for this core..." cp -f "$f" ../msvc/RetroArch-Xbox1/Release_LTCG_BigStack/libretro_xdk.lib cmd.exe /k xdk1_env_bigstack.bat ${name}_libretro_xdk1 else diff --git a/dist-scripts/xdk360-cores.sh b/dist-scripts/xdk360-cores.sh index ade310fd3a..cfd5e2dec1 100644 --- a/dist-scripts/xdk360-cores.sh +++ b/dist-scripts/xdk360-cores.sh @@ -10,7 +10,7 @@ mkdir -p ../msvc/RetroArch-360/Release mkdir -p ../msvc/RetroArch-360/Release_LTCG for f in *_xdk360.lib ; do - name=`echo "$f" | sed 's/\(_libretro\|\)_xdk360.lib$//'` + name=`echo "$f" | sed 's/\(_libretro_xdk360\|\).lib$//'` echo $name cp -f "$f" ../msvc/RetroArch-360/Release_LTCG/libretro_xdk360.lib cmd.exe /k xdk360_env.bat ${name}_libretro_xdk360