- Mame on linux ubuntu
- Установка MAME в Ubuntu Linux
- Compiling MAME¶
- All Platforms¶
- Microsoft Windows¶
- Using a standard MSYS2 installation¶
- Building with Microsoft Visual Studio¶
- Some notes about the MSYS2 environment¶
- Fedora Linux¶
- Debian and Ubuntu (including Raspberry Pi and ODROID devices)¶
- Arch Linux¶
- Apple macOS¶
- Emscripten Javascript and HTML¶
- Compiling the Documentation¶
- Compiling the Documentation on Microsoft Windows¶
- Compiling the Documentation on Debian and Ubuntu¶
- Useful Options¶
- Overall build options¶
- Tool locations¶
- Optional features¶
- Compilation options¶
- Library/framework locations¶
- Known Issues¶
- Issues with specific compiler versions¶
- GNU C Library fortify source feature¶
- Unusual Build Configurations¶
- Linking using the LLVM linker¶
- Cross-compiling MAME¶
- Using libc++ on Linux¶
- Using a GCC/GNU libstdc++ installation in a non-standard location on Linux¶
Mame on linux ubuntu
MAME (Multiple Arcade Machine Emulator) — эмулятор, который позволяет запускать на современных компьютерах старые игры, которые когда-то были на аркадных игровых автоматах (эмулятор аркадных игровых автоматов). Под MAME существует несколько тысяч разных игр, которые можно скачать бесплатно.
Эмулятор MAME написан на языке программирования C.
Установка MAME в Ubuntu Linux
Установка MAME выполняется в несколько шагов. Сначала мы установим сам MAME и некоторые дополнительные компоненты, затем выполним конфигурацию MAME и установим игры. Все действия я выполнял в Ubuntu 12.10.
- Установим MAME и дополнительные компоненты. Выполните в терминале следующую команду:
- Теперь нам нужно сконфигурировать MAME. Выполните в терминале команду:
На экране должно появится сообщение: «No games found. Please check the rom path specified in the name.ini file. ». Это означает, что MAME не нашел игр. Игры для MAME нужно размещать в отдельной директории, она называется rom (а игры называют иногда ROMs).
Сначала нужно создать конфигурационный файл mame.ini. Для этого нужно перейти в директорию
/.mame и выполнить команду mame с параметром -cc. Для этого выполните в терминале команды:
/.mame должен появится файл mame.ini. В нем указаны различные пути до директорий, которые использует эмулятор. Я оставил все настройки по умолчанию. Если вы хотите что-то изменить, то просто отредактируйте этот файл в текстовом редакторе.
В файле mame.ini в, в частности в секции «CORE OUTPUT DIRECTORY OPTIONS», прописано несколько директорий. Их нужно создать. Для этого просто выполните команду:
На этом минимальная настройка (подготовка) MAME завершена, осталось установить игры.
Игры для MAME называют ромами — ROMs. На официальном сайте программы (http://mamedev.org/roms/) есть несколько игр, но их там единицы и они совсем простые. На сторонних сайтах (например, http://www.freeroms.com/mame.htm) можно скачать тысячи других игр для MAME.
Каждая игра упакована обычно в zip архив, который нужно распаковать в папку
/.mame/roms. Например, скачаем игру Hard Hat (Exidy, 1982) с официального сайта MAME: http://mamedev.org/roms/hardhat/ Чтобы скачать игру нажмите на странице синюю кнопку Donwload now (и поставьте под кнопкой галочку). Вы скачаете файл hardhat.zip. Распакуйте архив в директорию
/.mame/roms. Файлы игры должны находиться в итоге в директории
/.mame/roms/hardhat. Теперь запустите MAME, выполнив в терминале команду:
/.mame/roms, то она должна добавиться в главное меню — в список. Также обращаю ваше внимание на то, что не все игры работают, у меня, например, для некоторых игр MAME выдавал сообщение, что не хватает каких-то файлов.
Источник
Compiling MAME¶
All Platforms¶
To compile MAME, you need a C++17 compiler and runtime library. We support building with GCC version 7.2 or later and clang version 6 or later. MAME should run with GNU libstdc++ version 7.2 or later.
Whenever you are changing build parameters, (such as switching between a SDL-based build and a native Windows renderer one, or adding tools to the compile list) you need to run a make REGENIE=1 to allow the settings to be regenerated. Failure to do this will cause you very difficult to troubleshoot problems.
If you want to add various additional tools to the compile, such as chdman, add a TOOLS=1 to your make command, like make REGENIE=1 TOOLS=1
You can do driver specific builds by using SOURCES= in your make command. For instance, building Pac-Man by itself would be make SOURCES=src/mame/drivers/pacman.cpp REGENIE=1 including the necessary REGENIE for rebuilding the settings.
Speeding up the compilation can be done by using more cores from your CPU. This is done with the -j parameter. Note: a good number to start with is the total number of CPU cores in your system plus one. An excessive number of concurrent jobs may increase compilation time. The optimal number depends on many factors, including number of CPU cores, available RAM, disk and filesystem performance, and memory bandwidth. For instance, make -j5 is a good starting point on a system with a quad-core CPU.
Debugging information can be added to a compile using SYMBOLS=1 though most users will not want or need to use this. This increases compile time and disk space used.
Putting all of these together, we get a couple of examples:
Rebuilding MAME for just the Pac-Man driver, with tools, on a quad-core (e.g. i5 or i7) machine:
Rebuilding MAME on a dual-core (e.g. i3 or laptop i5) machine:
Microsoft Windows¶
MAME for Windows is built using the MSYS2 environment. You will need Windows 7 or later and a reasonably up-to-date MSYS2 installation. We strongly recommend building MAME on a 64-bit system. Instructions may need to be adjusted for 32-bit systems.
A pre-packaged MSYS2 installation including the prerequisites for building MAME can be downloaded from the MAME Build Tools page.
After initial installation, you can update the MSYS2 environment using the pacman (Arch package manage) command.
By default, MAME will be built using native Windows OS interfaces for window management, audio/video output, font rendering, etc. If you want to use the portable SDL (Simple DirectMedia Layer) interfaces instead, you can add OSD=sdl to the make options. The main emulator binary will have an sdl prefix prepended (e.g. sdlmame.exe ). You will need to install the MSYS2 packages for SDL 2 version 2.0.3 or later.
By default, MAME will include the native Windows debugger. To also include the portable Qt debugger, add USE_QTDEBUG=1 to the make options. You will need to install the MSYS2 packages for Qt 5.
Using a standard MSYS2 installation¶
You may also build MAME using a standard MSYS2 installation and adding the tools needed for building MAME. These instructions assume you have some familiarity with MSYS2 and the pacman package manager.
Install the MSYS2 environment from the MSYS2 homepage.
Download the latest version of the mame-essentials package from the MAME package repository and install it using the pacman command.
Add the mame repository to /etc/pacman.conf using /etc/pacman.d/mirrorlist.mame for locations.
Install packages necessary to build MAME. At the very least, you’ll need bash , git , make .
For 64-bit builds you’ll need mingw-w64-x86_64-gcc and mingw-w64-x86_64-python .
For 32-bit builds you’ll need mingw-w64-i686-gcc and mingw-w64-i686-python .
For debugging you may want to install gdb .
To link using the LLVM linker (generally much faster than the GNU linker), you’ll need mingw-w64-x86_64-lld and mingw-w64-x86_64-libc++ for 64-bit builds, or mingw-w64-i686-lld and mingw-w64-i686-libc++ for 32-bit builds.
To build against the portable SDL interfaces, you’ll need mingw-w64-x86_64-SDL2 and mingw-w64-x86_64-SDL2_ttf for 64-bit builds, or mingw-w64-i686-SDL2 and mingw-w64-i686-SDL2_ttf for 32-bit builds.
To build the Qt debugger, you’ll need mingw-w64-x86_64-qt5 for 64-bit builds, or mingw-w64-i686-qt5 for 32-bit builds.
To build the HTML user/developer documentation, you’ll need mingw-w64-x86_64-librsvg , mingw-w64-x86_64-python-sphinx , mingw-w64-x86_64-python-sphinx_rtd_theme and mingw-w64-x86_64-python-sphinxcontrib-svg2pdfconverter for a 64-bit MinGW environment (or alternatively mingw-w64-i686-librsvg , mingw-w64-i686-python-sphinx , mingw-w64-i686-python-sphinx_rtd_theme and mingw-w64-x86_64-python-sphinxcontrib-svg2pdfconverter a 32-bit MinGW environment).
To generate API documentation from source, you’ll need doxygen .
If you plan to rebuild bgfx shaders and you want to rebuild the GLSL parser, you’ll need bison .
For 64-bit builds, open MSYS2 MinGW 64-bit from the start menu, and set up the environment variables MINGW64 to /mingw64 and MINGW32 to an empty string (e.g. using the command export MINGW64=/mingw64 MINGW32= in the Bash shell).
For 32-bit builds, open MSYS2 MinGW 32-bit from the start menu, and set up the environment variables MINGW32 to /mingw32 and MINGW64 to an empty string (e.g. using the command export MINGW32=/mingw32 MINGW64= in the Bash shell).
For example you could use these commands to ensure you have the packages you need to compile MAME, omitting the ones for configurations you don’t plan to build for or combining multiple pacman commands to install more packages at once:
You could use these commands to install the current version of the mame-essentials package and add the MAME package repository to your pacman configuration:
Building with Microsoft Visual Studio¶
You can generate Visual Studio 2019 projects using make vs2019. The solution and project files will be created in build/projects/windows/mame/vs2019 by default (the name of the build folder can be changed using the BUILDDIR option). This will always regenerate the settings, so REGENIE=1 is not needed.
Adding MSBUILD=1 to the make options will build the solution using the Microsoft Build Engine after generating the project files. Note that this requires paths and environment variables to be configured so the correct Visual Studio tools can be located; please refer to the Microsoft-provided instructions on using the Microsoft C++ toolset from the command line. You may find it easier to not use MSBUILD=1 and load the project file into Visual Studio’s GUI for compilation.
The MSYS2 environment is still required to generate the project files, convert built-in layouts, compile UI translations, etc.
Some notes about the MSYS2 environment¶
MSYS2 uses the pacman tool from Arch Linux for package management. There is a page on the Arch Linux wiki with helpful information on using the pacman package management tool.
The MSYS2 environment includes two kinds of tools: MSYS2 tools designed to work in a UNIX-like environment on top of Windows, and MinGW tools designed to work in a more Windows-like environment. The MSYS2 tools are installed in /usr/bin while the MinGW tools are installed in /ming64/bin and/or /mingw32/bin (relative to the MSYS2 installation directory). MSYS2 tools work best in an MSYS2 terminal, while MinGW tools work best in a Microsoft command prompt.
The most obvious symptom of this is that arrow keys don’t work in interactive programs if you run them in the wrong kind of terminal. If you run MinGW gdb or python from an MSYS2 terminal window, command history won’t work and it may not be possible to interrupt an attached program with gdb. Similarly it may be very difficult to edit using MSYS2 vim in a Microsoft command prompt window.
MAME is built using the MinGW compilers, so the MinGW directories are included earlier in the PATH for the build environments. If you want to use an interactive MSYS2 program from an MSYS2 shell, you may need to type the absolute path to avoid using the MinGW equivalent instead.
MSYS2 gdb may have issues debugging MinGW programs like MAME. You may get better results by installing the MinGW version of gdb and running it from a Microsoft command prompt window to debug MAME.
GNU make supports both POSIX-style shells (e.g. bash) and the Microsoft cmd.exe shell. One issue to be aware of when using the cmd.exe shell is that the copy command doesn’t provide a useful exit status, so file copy tasks can fail silently.
It is not possible to cross-compile a 32-bit version of MAME using 64-bit MinGW tools on Windows, the 32-bit MinGW tools must be used. This causes issues due to the size of MAME. It is not possible to link a full 32-bit MAME build including the SDL OS-dependent layer and the Qt debugger. GNU ld and lld will both run out of memory, leaving an output file that doesn’t work. It’s also impossible to make a 32-bit build with full local variable symbols. GCC may run out of memory, and certain source files may exceed the limit of 32,768 sections imposed by the PE/COFF object file format.
Fedora Linux¶
You’ll need a few prerequisites from your Linux distribution. Make sure you get SDL2 2.0.4 or later as earlier versions are buggy:
Compilation is exactly as described above in All Platforms.
To build the HTML user/developer documentation, you’ll need Sphinx, as well as the theme and the SVG converter:
The HTML documentation can be built with this command:
Debian and Ubuntu (including Raspberry Pi and ODROID devices)¶
You’ll need a few prerequisites from your Linux distribution. Make sure you get SDL2 2.0.4 or later as earlier versions are buggy:
Compilation is exactly as described above in All Platforms. Note the Ubuntu Linux modifies GCC to enable the GNU C Library “fortify source” feature by default, which may cause issues compiling MAME (see Known Issues ).
Arch Linux¶
You’ll need a few prerequisites from your distro:
Compilation is exactly as described above in All Platforms.
Apple macOS¶
You’ll need a few prerequisites to get started. Make sure you’re on OS X 10.14 Mojave or later for Intel Macs or macOS 11.0 Big Sur for Apple Silicon. You will need SDL2 2.0.4 or later for Intel or SDL2 2.0.14 on Apple Silicon. You’ll also need to install Python 3.
Install Xcode from the Mac App Store or ADC (AppleID required).
To find the corresponding Xcode for your MacOS release please visit xcodereleases.com to find the latest version of Xcode available to you.
Launch Xcode. It will download a few additional prerequisites. Let this run through before proceeding.
Once that’s done, quit Xcode and open a Terminal window.
Type xcode-select —install to install additional tools necessary for MAME (also available as a package on ADC).
Next you’ll need to get SDL2 installed.
Go to this site and download the macOS .dmg file
If the .dmg doesn’t open automatically, open it
Click “Macintosh HD” (or whatever your Mac’s hard disk is named) in the left pane of a Finder window, then open the Library folder and drag the SDL2.framework folder from the SDL disk image into the Frameworks folder. You will have to authenticate with your user password.
Now get Python 3 set up:
Go to the official Python site and click the link to the download page for the current version (this was Python 3.10.0 at the time of writing).
Scroll down to the “Files” section, and download the macOS version (called “macOS 64-bit universal2 installer” or similar).
Once the package downloads, open it and follow the standard installation process.
Finally to begin compiling, use Terminal to navigate to where you have the MAME source tree (cd command) and follow the normal compilation instructions from above in All Platforms.
Emscripten Javascript and HTML¶
First, download and install Emscripten 1.37.29 or later by following the instructions at the official site.
Once Emscripten has been installed, it should be possible to compile MAME out-of-the-box using Emscripten’s emmake tool. Because a full MAME compile is too large to load into a web browser at once, you will want to use the SOURCES parameter to compile only a subset of the project, e.g. (in the MAME directory):
The SOURCES parameter should have the path to at least one driver .cpp file. The make process will attempt to locate and include all dependencies necessary to produce a complete build including the specified driver(s). However, sometimes it is necessary to manually specify additional files (using commas) if this process misses something. e.g.
The value of the SUBTARGET parameter serves only to differentiate multiple builds and need not be set to any specific value.
Emscripten supports compiling to WebAssembly with a JavaScript loader instead of all-JavaScript, and in later versions this is actually the default. To force WebAssembly on or off, add WEBASSEMBLY=1 or WEBASSEMBLY=0 to the make command line, respectively.
Other make parameters can also be used, e.g. -j for multithreaded compilation as described earlier.
When the compilation reaches the emcc phase, you may see a number of «unresolved symbol» warnings. At the moment, this is expected for OpenGL-related functions such as glPointSize. Any others may indicate that an additional dependency file needs to be specified in the SOURCES list. Unfortunately this process is not automated and you will need to search the source tree to locate the files supplying the missing symbols. You may also be able to get away with ignoring the warnings if the code path referencing them is not used at run-time.
If all goes well, a .js file will be output to the current directory. This file cannot be run by itself, but requires an HTML loader to provide it with a canvas to draw to and to pass in command-line parameters. The Emularity project provides such a loader.
There are example .html files in that repository which can be edited to point to your newly compiled MAME .js file and pass in whatever parameters you desire. You will then need to place all of the following on a web server:
The compiled MAME .js file
The compiled MAME .wasm file if using WebAssembly
The .js files from the Emularity package (loader.js, browserfs.js, etc.)
A .zip file with the ROMs for the MAME driver you would like to run (if any)
Any software files you would like to run with the MAME driver
An Emularity loader .html modified to point to all of the above
You need to use a web server instead of opening the local files directly due to security restrictions in modern web browsers.
If the result fails to run, you can open the Web Console in your browser to see any error output which may have been produced (e.g. missing or incorrect ROM files). A “ReferenceError: foo is not defined” error most likely indicates that a needed source file was omitted from the SOURCES list.
Compiling the Documentation¶
Compiling the documentation will require you to install several packages depending on your operating system.
Compiling the Documentation on Microsoft Windows¶
On Windows, you’ll need a couple of packages from the MSYS2 environment. You can install these packages with
Note that no LaTeX packages currently exist for MSYS2 so you will not be able to generate a PDF file without using external tools.
Compiling the Documentation on Debian and Ubuntu¶
On Debian/Ubuntu flavors of Linux, you’ll need python3-sphinx/python-sphinx and the python3-pip/python-pip packages:
On Debian, you’ll need to install the librsvg2-bin package:
If you intend to make a PDF via LaTeX, you’ll need to install a LaTeX distribution such as TeX Live:
From this point you can do make html or make latexpdf from the docs folder to generate the output of your choice. Typing make by itself will tell you all available formats. The output will be in the docs/build folder in a subfolder based on the type chosen (e.g. make html will create docs/build/html with the output.)
Useful Options¶
This section summarises some of the more useful options recognised by the main makefile. You use these options by appending them to the make command, setting them as environment variables, or adding them to your prefix makefile. Note that in order to apply many of these settings when rebuilding, you need to set REGENIE=1 the first time you build after changing the option(s). Also note that GENie does not automatically rebuild affected files when you change an option that affects compiler settings.
Overall build options¶
Name of a makefile to include for additional options if found (defaults to useroptions.mak). May be useful if you want to quickly switch between different build configurations.
Set to change the name of the subfolder used for project files, generated sources, object files, and intermediate libraries (defaults to build).
Set to 1 to force project files to be regenerated.
Set to 1 to show full commands when using GNU make as the build tool. This option applies immediately without needing regenerate project files.
Set to 1 to skip the working tree scan and not attempt to embed a git revision description in the version string.
Tool locations¶
Set the C/Objective-C compiler command. (This sets the target C compiler command when cross-compiling.)
Set the C++/Objective-C++ compiler command. (This sets the target C++ compiler command when cross-compiling.)
Set the linker command. This is often not necessary or useful because the C or C++ compiler command is used to invoke the linker. (This sets the target linker command when cross-compiling.)
Set the Python interpreter command. You need Python 3.2 or later to build MAME.
Set to 1 to use separate host and target compilers and linkers, as required for cross-compilation. In this case, OVERRIDE_CC, OVERRIDE_CXX and OVERRIDE_LD set the target C compiler, C++ compiler and linker commands, while CC, CXX and LD set the host C compiler, C++ compiler and linker commands.
Optional features¶
Set to 1 to build additional tools along with the emulator, including unidasm, chdman, romcmp, and srcclean.
Set to 1 to disable building the PortAudio sound output module.
Set to 1 to include the Qt debugger on platforms where it’s not built by default (e.g. Windows or macOS), or to 0 to disable it. You’ll need to install Qt development libraries and tools to build the Qt debugger. The process depends on the platform.
Compilation options¶
Set to 1 to disable treating compiler warnings as errors. This may be needed in marginally supported configurations.
Set to 0 to disable deprecation warnings (note that deprecation warnings are not treated as errors).
Set to 1 to enable runtime assertion checks and additional diagnostics. Note that this has a performance cost, and is most useful for developers.
Set optimisation level. The default is 3 to favour performance at the expense of larger executable size. Set to 0 to disable optimisation (can make debugging easier), 1 for basic optimisation that doesn’t have a space/speed trade-off and doesn’t have a large impact on compile time, 2 to enable most optimisation that improves performance and reduces size, or s to enable only optimisations that generally don’t increase executable size. The exact set of supported values depends on your compiler.
Set to 1 to include additional debugging symbols over the default for the target platform (many target platforms include function name symbols by default).
Numeric value that controls the level of detail in debugging symbols. Higher numbers make debugging easier at the cost of increased build time and executable size. The supported values depend on your compiler. For GCC and similar compilers, 1 includes line number tables and external variables, 2 also includes local variables, and 3 also includes macro definitions.
Additional command-line options to pass to the compiler and linker. This is useful for supplying code generation or ABI options, for example to enable support for optional CPU features.
Additional command-line options to pass to the compiler when compiling C source files.
Additional command-line options to pass to the compiler when compiling C++ source files.
Additional command-line options to pass to the compiler when compiling Objective-C source files.
Additional command-line options to pass to the compiler when compiling Objective-C++ source files.
Library/framework locations¶
SDL installation root directory for shared library style SDL.
Search path for SDL framework.
Set to 1 to use shared library style SDL on targets where framework is default.
Set to 1 to prefer the system installation of the Asio C++ asynchronous I/O library over the version provided with the MAME source.
Set to 1 to prefer the system installation of the Expat XML parser library over the version provided with the MAME source.
Set to 1 to prefer the system installation of the zlib data compression library over the version provided with the MAME source.
Set to 1 to prefer the system installation of the libjpeg image compression library over the version provided with the MAME source.
Set to 1 to prefer the system installation of the libFLAC audio compression library over the version provided with the MAME source.
Set to 1 to prefer the system installation of the embedded Lua interpreter over the version provided with the MAME source.
Set to 1 to prefer the system installation of the SQLITE embedded database engine over the version provided with the MAME source.
Set to 1 to prefer the system installation of the PortMidi library over the version provided with the MAME source.
Set to 1 to prefer the system installation of the PortAudio library over the version provided with the MAME source.
Set to 1 to prefer the version of SDL provided with the MAME source over the system installation. (This is enabled by default for Visual Studio and Android builds. For other configurations, the system installation of SDL is preferred.)
Set to 1 to prefer the system installation of the Julia utf8proc library over the version provided with the MAME source.
Set to 1 to prefer the system installation of the GLM OpenGL Mathematics library over the version provided with the MAME source.
Set to 1 to prefer the system installation of the Tencent RapidJSON library over the version provided with the MAME source.
Set to 1 to prefer the system installation of the pugixml library over the version provided with the MAME source.
Known Issues¶
Issues with specific compiler versions¶
GCC 7 for 32-bit x86 targets produces spurious out-of-bounds access warnings. Adding NOWERROR=1 to your build options works around this by not treating warnings as errors.
GNU C Library fortify source feature¶
The GNU C Library has options to perform additional compile- and run-time checks on string operations, enabled by defining the _FORTIFY_SOURCE preprocessor macro. This is intended to improve security at the cost of a small amount of overhead. MAME is not secure software, and we do not support building with _FORTIFY_SOURCE defined.
Some Linux distributions (including Gentoo and Ubuntu) have patched GCC to define _FORTIFY_SOURCE to 1 as a built-in macro. This is problematic for more projects than just MAME, as it makes it hard to disable the additional checks (e.g. if you don’t want the performance impact of the run-time checks), and it also makes it hard to define _FORTIFY_SOURCE to 2 if you want to enable stricter checks. You should really take it up with the distribution maintainers, and make it clear you don’t want non-standard GCC behaviour. It would be better if these distributions defined this macro by default in their packaging environments if they think it’s important, rather than trying to force it on everything compiled on their distributions. (This is what Red Hat does: the _FORTIFY_SOURCE macro is set in the RPM build environment, and not by distributing a modified version of GCC.)
If you get compilation errors in bits/string_fortified.h you should first ensure that the _FORTIY_SOURCE macro is defined via the environment (e.g. a CFLAGS or CXXFLAGS environment variable). You can check to see whether the _FORTIFY_SOURCE macro is a built-in macro with your version of GCC with a command like this:
gcc -dM -E — _FORTIFY_SOURCE is defined to a non-zero value by default, you can work around it by adding -U_FORTIFY_SOURCE to the compiler flags (e.g. by using the ARCHOPTS setting, or setting the CFLAGS and CXXFLAGS environment variables.
Unusual Build Configurations¶
Linking using the LLVM linker¶
The LLVM linker is generally faster than the GNU linker that GCC uses by default. This is more pronounced on systems with a high overhead for file system operations (e.g. Microsoft Windows, or when compiling on a disk mounted over a network). To use the LLVM linker with GCC, ensure the LLVM linker is installed and add -fuse-ld=lld to the linker options (e.g. in the LDFLAGS environment variable or in the ARCHOPTS setting).
Cross-compiling MAME¶
MAME’s build system has basic support for cross-compilation. Set CROSS_BUILD=1 to enable separate host and target compilers, set OVERRIDE_CC and OVERRIDE_CXX to the target C/C++ compiler commands, and if necessary set CC and CXX to the host C/C++ compiler commands. If the target OS is different to the host OS, set it with TARGETOS. For example it may be possible to build a MinGW32 x64 build on a Linux host using a command like this:
(The additional packages required for producing a standard MinGW32 x64 build on a Fedora Linux host are mingw64-gcc-c++ , mingw64-winpthreads-static and their dependencies. Non-standard builds may require additional packages.)
Using libc++ on Linux¶
MAME may be built using the LLVM project’s “libc++” C++ Standard Library. The prerequisites are a working clang/LLVM installation, and the libc++ development libraries. On Fedora Linux, the necessary packages are libcxx, libcxx-devel, libcxxabi and libcxxabi-devel. Set the C and C++ compiler commands to use clang, and add -stdlib=libc++ to the C++ compiler and linker options. You could use a command like this:
The options following the make command may be placed in a prefix makefile if you want to use this configuration regularly, but LDFLAGS needs to be be set in the environment.
Using a GCC/GNU libstdc++ installation in a non-standard location on Linux¶
GCC may be built and installed to a custom location, typically by supplying the —prefix= option to the configure command. This may be useful if you want to build MAME on a Linux distribution that still uses a version of GNU libstdC++ that predates C++17 support. To use an alternate GCC installation to, build MAME, set the C and C++ compilers to the full paths to the gcc and g++ commands, and add the library path to the run-time search path. If you installed GCC in /opt/local/gcc72, you might use a command like this:
You can add these options to a prefix makefile if you plan to use this configuration regularly.
Источник