HOWTO: compile Qemu under Windows for i386 and x86_64 emulation targets

Getting needed stuff

First of all we need to get MSYS and MinGW. You can find them at: MinGW download page. I used MSYS-1.0.10.exe and MinGW-5.1.3.exe.

We also need the SDL library source (I used SDL-1.2.11.tar.gz) at SDL home and the zlib source (I used zlib-1.2.3.tar.gz) at zlib home.

And, obviously, you must have the qemu sources (I used qemu-0.9.0.tar.gz), found at qemu home.

 

Installing the development environment

Choose a drive to install to. In this example is used F:\. If you want to use drive C:\, substitute F:\ occurrences in this HOWTO with C:\.

Install the Minimal SYStem. Run MSYS-1.0.10.exe and:

  1. choose F:\msys as destination folder
  2. accept default settings until you see the post install command console
  3. at the prompt Do you wish to continue with the post install? answer y
  4. at the prompt Do you have MinGW installed? answer n
  5. accept other settings

Install MinGW. Ensure you have a working internet connection and run MinGW-5.1.3.exe:

  1. choose download and install
  2. choose Minimal installation and select MinGW make
  3. choose F:\msys\mingw\ as destination folder
  4. accept other settings

Installing needed libraries

Create a directory named F:\msys\work and copy SDL-1.2.11.tar.gz zlib-1.2.3.tar.gz and qemu-0.9.0.tar.gz in F:\msys\work.

Open the MSYS environment, accessible from the desktop shortcut or executing F:\msys\msys.bat.

At the $ prompt type:

cd /work
tar -xzf SDL-1.2.11.tar.gz
tar -xzf zlib-1.2.3.tar.gz
tar -xzf qemu-0.9.0.tar.gz
cd SDL-1.2.11
./configure
make
make install
cd ../zlib-1.2.3
configure --prefix=/mingw
make
make install

Now you have set up the build environment.

 

Compiling qemu

We will configure the installation directory to F:\Qemu. If you wish to install in other directory, substitute the prefix value with the path in the form: /drive/path. For "C:\Program Files" use --prefix="/C/Program Files/"

In MSYS type:

cd ../qemu-0.9.0/
./configure --target-list="i386-softmmu x86_64-softmmu" --prefix=/F/Qemu --enable-adlib
make
make install

Now you must copy SDL.dll to the installation directory. You can do that typing in MSYS (subsitute the right dir):

cp /local/bin/SDL.dll /F/Qemu

Enjoy you own personal qemu build!