-
Notifications
You must be signed in to change notification settings - Fork 8
Compiling and Running on Windows
NOTE: You must have a git checkout of the repository. Zip source downloads do not work as they are missing the submodule information and contents (and I'm not aware of a way to replace the standard github zip links on the repo main page)
** NOTE: The following steps regarding Cygwin apply to v0.9.4
and earlier only. Later commits require MSYS2 as Cygwin does not offer glib-2.56. Instructions for MSYS2 will be authored soon. **
Compiling on Windows is done via Cygwin using the MinGW toolchain to produce a native Windows executable. (Cygwin environment is not required to run it)
-
In theoryit is possible to compile using MSYS2 without Cygwinbut in practice I did not have any luck and kept encountering errors relating to missing packages or bad development environment. - I've also attempted to cross-compile from Ubuntu with MinGW (since the current build takes 30 minutes via Actions) with no success as Ubuntu's PPAs seem to be missing a number of required .dll packages.
- Cross compiling can be done on OpenSuSE with MinGW but GitHub does not offer this as a build runner platform.
If you've had success with either of these scenarios, please do get in touch by opening an issue or discussion to share your recipe!
Preface: Windows support is beta. This means it appears to be functional but there may still be unexpected bugs in less-traveled pathways, Feel free to open an issue or discussion if you think you've found one!
- gcc-core
- git
- make
- mingw64-x86_64-curl
- mingw64-x86_64-freeglut
- mingw64-x86_64-gcc-g++
- mingw64-x86_64-glew
- mingw64-x86_64-glib-2.0
- mingw64-x86_64-gtk3 (Recommended, but can be swapped out for SDL2 instead)
- mingw64-x86_64-libepoxy
- mingw64-x86_64-libusb1.0
- mingw64-x86_64-pixman
- mingw64-x86_64-pkg-config
- mingw64-x86_64-usbredir
- python3-setuptools
Note: This is with a fresh install of Cygwin and the same (minimal) set of packages used by the build runner. You may install more if you wish to use different or additional features, such as SDL. Note that gnutls may cause a "missing symbols" error relating to libidn2; if you encounter this you can disable it by providing the --disable-gnutls
argument to the configure
script.
-
Important: set
core.autocrlf
to FALSE if using a Windows git client; otherwise the build scripts will be checked out with CRLF line endings, and bash will be unhappy. - Check out a copy of the repository.
- Launch Cygwin and move to this directory.
- Execute the configuration:
./configure --cross-prefix=x86_64-w64-mingw32- --target-list=buddy-softmmu --enable-gtk --enable-libusb
(The--enable-
arguments are not strictly necessary but will yell at you if dependencies are missing as opposed to silently disabling the feature) - MinGW LD does not have a
-no-pie
argument, this is the default. Remove it from the configuration withsed -i 's/LDFLAGS_NOPIE=-no-pie/LDFLAGS_NOPIE=/g' build/config-host.mak
- Build with
make -j[#threads]
, e.gmake -j8
- Wait.
- Wait some more.
- ...
- Profit! (Your new binary, qemu-system-buddy[w].exe, will reside in the
build
folder. (The difference between the W and non-W version is purely whether a console (CMD) window is spawned if launched via double-click on an icon. - Copy the DLLs required for the executable to run:
for i in `ldd qemu-system-buddy.exe | grep \"not found\" | cut -f2 | cut -d\" \" -f1 | sort | uniq`; do echo Copying $i; cp /usr/x86_64-w64-mingw32/sys-root/mingw/bin/$i .; done
- Recursively copy any DLL dependencies required by the newly copied files:
while `ldd *.dll | grep -q \"not found\"`; do for i in `ldd *.dll | grep \"not found\" | cut -f2 | cut -d\" \" -f1 | sort | uniq`; do echo Copying $i; cp /usr/x86_64-w64-mingw32/sys-root/mingw/bin/$i .; done; sleep 2; done"
-
If you wish to relocate the build output, you will need the EXE, the DLLs, the
assets
folder, and an empty folder calledpc-bios
. in the new location. (Don't ask why - it's a hardcoded path, apparently and QEMU will hang on boot if it is absent) -
Launch your fresh build with your desired set of arguments:
qemu-system-buddy[w].exe -machine prusa-mini -kernel [filename.[bin|bbf]] [options...]