-
Notifications
You must be signed in to change notification settings - Fork 1
Compilation guide (Windows)
Compiling RetroArch for Windows is done with the MinGW toolchain. Both 32-bit and 64-bit variants should work.
Download and run Git for Windows, and you should be able to get a bash shell with Git working.
You'll also need the MinGW-w64 toolchain here. There are many builds to choose from. Generally, from left pane, pick WIN32 or WIN64 downloads, Personal Builds, and go from there (I personally use rubenvb's builds, but that's me). You'll want to see x86_64-w64-mingw32 for 64-bit toolchains and i686-w64-mingw32 for 32-bit toolchains.
For example, x86_64-w64-mingw32-gcc-4.8.0-win64 means the toolchain compiles code for x86_64-w64-mingw32 (64-bit) and the compiler itself runs on win64. There are builds that run on other setups, like Cygwin, OSX and Linux which are used to cross compile for Windows.
After you have downloaded and extracted the archive, make sure you set the PATH environmental variable to point to bin/ directory. After setup correctly, you should be able to run gcc -v in the Git shell.
On the forum there is a prepackaged Win64 setup that includes everything you need to build RetroArch.
Then you can check out the source tree:
git clone git://github.com/Themaister/RetroArch.git
cd RetroArch
Now we need to download the library pack and the headers pack, and extract them into the top directory of RetroArch. Pick the 32-bit or 64-bit archives depending on which architecture you're building for:
https://github.com/downloads/Themaister/RetroArch/RetroArch-win32-libs.zip (32-bit)
https://github.com/downloads/Themaister/RetroArch/RetroArch-win32-headers.zip (32-bit)
https://github.com/downloads/Themaister/RetroArch/RetroArch-win64-headers.zip (64-bit)
https://github.com/downloads/Themaister/RetroArch/RetroArch-win64-libs.zip (64-bit)
Note that you might have to install dsound.h and dinput.h DirectX headers in a place where MinGW can see them. This is typically C:/MinGW/include or something like that.
Now build:
mingw32-make -f Makefile.win # If your compiler isn't called gcc/g++, you can set the proper compiler name with CC= and CXX=, standard Unix fare. You will also need to set WINDRES=.
By default, D3D9 support is compiled in. If your MinGW has D3D headers/libs properly installed, it will work. If you however are unable to build D3D9 using your toolchain, you can disable D3D9 by adding HAVE_D3D9=0 to the make commandline. Recent MinGW-w64/i686-w64 builds are able to compile D3D9 without any fuss.
Since the command-line isn't very comfortable on Windows, you will most likely want RetroArch-Phoenix unless you're planning to launch via XBMC or something like that.
git clone git://github.com/Themaister/RetroArch-Phoenix.git
cd RetroArch-Phoenix
mingw32-make -f Makefile.win
Then you can move the retroarch-phoenix.exe into the folder you built RetroArch to make your life easier :)
RetroArch does not include a libretro implementation by default. Refer to a libretro implementation how to build the DLL.
Building with a cross chain on Linux is probably the most convenient option. You should have unzip and wget installed for maximum laziness! :D
You might need to install DirectX headers (dinput.h, dsound.h) properly.
git clone git://github.com/Themaister/RetroArch.git
cd RetroArch
make -f Makefile.win libs_x86 # libs_x86_64 if you're cross building for x64 Windows.
make -f Makefile.win CC=i486-mingw32-gcc CXX=i486-mingw32-g++ # Cross-chain might be called differently on your distro.
Nothing unexpected here:
git clone git://github.com/Themaister/RetroArch-Phoenix.git
cd RetroArch-Phoenix
make -f Makefile.win CC=i486-mingw32-gcc CXX=i486-mingw32-g++ WINDRES=i486-mingw32-windres # Will work for 64-bit compilers as well :)
If you want to make distribution builds you can use the ssnes-mingw-build.sh script included in the top directory.
It will checkout the latest sources, download libraries, and build distributable .zip files for both 32-bit and 64-bit in "slim" and "full" variants as found in the downloads section. It will also include the GUI:
NOBUILD_64BIT=1 MINGW32_BASE=i486-mingw32 ./retroarch-mingw-build.sh # Build for just 32-bit.
NOBUILD_32BIT=1 MINGW64_BASE=x86_64-w64-mingw32 ./retroarch-mingw-build.sh # Build for just 64-bit.
MINGW32_BASE=i486-mingw32 MINGW64_BASE=x86_64-w64-mingw32 ./retroarch-mingw32-build.sh # Build for both.
The names of the cross chains vary from distro to distro.