Table of Contents
Cross-compiling MAME for Windows on Ubuntu 22.04
Specifically, I tested this with a build of all Mac emulators. Basically just following MAME's instructions for cross-compiling, but tweaked for Ubuntu.
Prerequisites
sudo apt install gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 gcc-mingw-w64-x86-64-posix
You also need to fix a version check in MAME's build system. Edit the file: scripts/genie.lua. Change “if version < 100300 then” to “if version < 100000 then”. For some reason even though the package identifies as 10.3 in the version provided in 22.04, the actual compiler doesn't say it's 10.3. It's safe to just disable the check.
Building
make TARGETOS=windows PTR64=1 OVERRIDE_CC=x86_64-w64-mingw32-gcc-posix OVERRIDE_CXX=x86_64-w64-mingw32-g++-posix OVERRIDE_LD=x86_64-w64-mingw32-ld MINGW64=/usr SUBTARGET=mac SOURCES=src/mame/apple REGENIE=1 -j 8
(Assuming an 8-core CPU). Note that I have seen my entire machine crash (multiple times) if I do -j $(nproc)
.
Random unrelated note: do setxkbmap -option srvrkeys:none
if you want to stop control-alt-F12 from actually switching VTs, so you can use it for command-control-powerkey.