Skip to content

Latest commit

 

History

History
72 lines (53 loc) · 2.9 KB

README_Windows_compile.md

File metadata and controls

72 lines (53 loc) · 2.9 KB

Mednafen

Compiling this Repository for Windows... on Linux

Dependencies

Mednafen is built upon a number of external libraries which are required in order to compile.

Apparently, one of the dependencies broke the MSYS2 build sometime in the past couple of years, so Windows builds are cross-compiled from Linux now.

Assuming that you already have already built for linux, you will need to do the following:

sudo apt-get install build-essential pkg-config libmpfr-dev libgmp-dev libmpc-dev gawk p7zip-full

You will also need to do the following:

  1. Create a directory "mednafen-cross-sources", within your home directory
  2. Obtain the following packages and place them in that folder:
  1. Copy all of the mednafen/mswin/*.patch files into that folder (the one named 'mednafen-cross-sources'). For example, from within the mednafen/mswin directory, cp *.patch ~/mednafen-cross-sources/

Build Toolchain Commands

Change directory into the mednafen/mswin directory, and:

  • Build the gcc cross compiler
  • Build the toolchain for cross-compile
  • Build mednafen for cross-compile

Assuming you are in the repository's top-level directory, you should execte the following:

cd mednafen/mswin
./build-linux-gcc-4.9.4.sh
./build-toolchain.sh

Compile Commands

Now that the toolchain is created, the build of the mednafen source comes next. If you have already built on linux in-place, you will need to clean up the residual configuration and objects. Change directories to the 'mednafen' directory, then run:

make distclean

In order to build the source, the starting directory is the directory above the 'mednafen' folder, so change to that (should be the root folder of the git repository). As part of the build, the build script will create a 'build64' folder there with output files.

From within the (repository's root) folder, you would execute:

./mednafen/mswin/build-mednafen.sh

At this point, the mednafen binary can be found in the (base)/build64/src/ folder.

If you want to build a full zip file of the packaging, you will need to run this from the repository's root folder (one level above the mednafen folder):

./mednafen/mswin/package-mednafen.sh

At this point, the mednafen-$(VERSION).zip file is in the (repo root) folder.