Compile libretro-super on Windows; the easy way

As I stated in other threads I have been trying to figure out a streamlined way to compile libretro-super in Windows using Maister’s prepackaged mingw-w64+git environment from here http://forum.themaister.net/viewtopic.php?id=467

I got it working so here is the new environment: Link: https://anonfiles.com/file/b7e41f74904793e908aca44cdecdb312

The only thing I changed in his environment was an addition of a libz.a and libzdll.a in the mingw64/lib folder so that genplus and stella would compile. I had to build these libs from source to get them working properly. Just like his environment you can run this from a usb stick if you please. Obviously the instructions are a little different but hopefully just as easy for those who have never compiled in their life. There are only a few extra steps compared to building just retroarch alone. The only cores that don’t compile with this are the gl cores and mednafen-snes, scummvm, mame, and picodrive. All of these cores are new and/or experimental on Windows so it is not much of a surprise.

Step by step instructions (newb friendly): [ul] [li]start the shell with Git BAsh.vbs[/:2v1jlhcy][/li][li]git clone git://github.com/libretro/libretro-super.git[/:2v1jlhcy][/li][li]cd libretro-super[/:2v1jlhcy][/li][li]open libretro-build.sh in text editor (notepad++ recommended)[/:2v1jlhcy][/li][li]find line 50, 60 and 70 where it says MAKE=mingw32-make, CC=mingw32-gcc, CXX=mingw32-g++ respectively[/:2v1jlhcy][/li][li]simply remove mingw32 prefix from these instructions to end up with MAKE=make, CC=gcc and CXX=g++[/:2v1jlhcy][/li][li]scroll to the very bottom of the script and erase mednafen-snes, scummvm, picodrive and mame lines since these won’t compile anyway[/:2v1jlhcy][/li][li]save script and exit, hardest part is finished[/:2v1jlhcy][/li][li]sh libretro-fetch.sh[/:2v1jlhcy][/li][li]OPTIONAL For those with more than 1GB ram, open libretro-mednafen/Makefile in text editor, line 21 change to CACHE_CD = 1[/:2v1jlhcy][/li][li]sh libretro-build.sh[/:2v1jlhcy][/li][li]wait a while…[/:2v1jlhcy][/li][li]a new folder is created inside libretro-super dir called dist/win; go there now[/:2v1jlhcy][/li][li]surprise! All of your cores await your retroarch installation move them where you will and enjoy[/:2v1jlhcy][/li][/ul]

To update the cores: [ul] [li]open shell again[/:2v1jlhcy][/li][li]cd libretro-super[/:2v1jlhcy][/li][li]rm -f dist/win/.dll[/:2v1jlhcy][/li][li]rm -f libretro-build.sh[/:2v1jlhcy][/li][li]git reset --hard[/:2v1jlhcy][/li][li]git pull[/:2v1jlhcy][/li][li]edit libretro-build.sh with a text editor in the exact same way as mentioned above[/:2v1jlhcy][/li][li]sh libretro-fetch.sh[/:2v1jlhcy][/li][li]sh libretro-build.sh[/:2v1jlhcy][/li][li]once again your cores will be waiting for you in dist/win[/*:2v1jlhcy][/li][/ul]

and finally, enjoy the fruits of your labor!

I’ll see what I can do about getting the gl cores to compile as well. I can’t really promise anything, at least until they become stable. I am pretty new to C++ still and just learning the basics.

Thanks for sharing this. I’m sure many people will find it very useful :slight_smile:

I hope so. Tried to keep it simple as possible for everyone. Many people love to have the “latest and greatest” releases so hopefully this will help facilitate.

Appreciated, my existing setup chokes on most cores. An environment for compiling 32-bit cores would be helpful as well, if you’re up for it.

have you tried this for 32 bit already? Mingw-w64 should compile both 32 and 64-bit binaries.

Hadn’t tried your setup yet, assumed it worked like the instructions on the RetroArch compilation guide where you need a separate mingw for 32-bit compiles.

mingw-w64 is a fork of mingw which can compile both 32 and 64 bit binaries. I am almost certain you should be able to compile a 32 bit retroarch following maisters guide. Same for mine. Give it a shot

I don’t know how :confused: Following your guide produces 64bit dlls.

I think you have to add something like -m32 to your CFLAGS and have 32-bit libraries.

I tried to build a 32 bit retroarch and hunterk is right. I’ll see if there is a simple way to fix it.