From 8ffff5d2d3bcebbdbefec2508ddd2ecd264a399a Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 18 Feb 2019 21:13:44 +1100 Subject: (nw) misc stuff: * Document cross-compilation options * Use lowercase for some libraries that are lowercase in system32 on Windows anyway * Make USE_BUNDLED_LIB_SDL2=0 not use the bundled SDL --- docs/source/initialsetup/compilingmame.rst | 35 +++++++++++++++++++++++++++--- makefile | 2 ++ scripts/src/osd/sdl.lua | 16 +++++++------- scripts/src/tools.lua | 16 +++++++------- 4 files changed, 50 insertions(+), 19 deletions(-) diff --git a/docs/source/initialsetup/compilingmame.rst b/docs/source/initialsetup/compilingmame.rst index 1c102f66e63..44d416d3108 100644 --- a/docs/source/initialsetup/compilingmame.rst +++ b/docs/source/initialsetup/compilingmame.rst @@ -252,15 +252,27 @@ IGNORE_GIT revision description in the version string. Tool locations -~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~ OVERRIDE_CC - Set the C/Objective-C compiler command. + Set the C/Objective-C compiler command. (This sets the target C compiler + command when cross-compiling.) OVERRIDE_CXX - Set the C++/Objective-C++ compiler command. + Set the C++/Objective-C++ compiler command. (This sets the target C++ + compiler command when cross-compiling.) +OVERRIDE_LD + 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.) PYTHON_EXECUTABLE Set the Python interpreter command. You need Python 2.7 or Python 3 to build MAME. +CROSS_BUILD + 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 ~~~~~~~~~~~~~~~~~ @@ -439,6 +451,23 @@ variables. Unusual Build Configurations ---------------------------- +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: + +**make TARGETOS=windows PTR64=1 OVERRIDE_CC=x86_64-w64-mingw32-gcc OVERRIDE_CXX=x86_64-w64-mingw32-g++ OVERRIDE_LD=x86_64-w64-mingw32-ld MINGW64=/usr** + +(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 ~~~~~~~~~~~~~~~~~~~~~ diff --git a/makefile b/makefile index d5dc79988f3..1895eeffcfc 100644 --- a/makefile +++ b/makefile @@ -505,8 +505,10 @@ endif # reverse logic for this one ifdef USE_BUNDLED_LIB_SDL2 +ifneq '$(USE_BUNDLED_LIB_SDL2)' '0' PARAMS += --with-bundled-sdl2 endif +endif #------------------------------------------------- # distribution may change things diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index 28e126ecee3..c9a63dcb24e 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -52,16 +52,16 @@ function maintargetosdoptions(_target,_subtarget) configuration { "mingw*"} links { "SDL2", - "Imm32", - "Version", - "Ole32", - "OleAut32", + "imm32", + "version", + "ole32", + "oleaut32", } configuration { "vs*" } links { "SDL2", - "Imm32", - "Version", + "imm32", + "version", } configuration { } else @@ -74,8 +74,8 @@ function maintargetosdoptions(_target,_subtarget) configuration { "vs*" } links { "SDL2", - "Imm32", - "Version", + "imm32", + "version", } configuration { } else diff --git a/scripts/src/tools.lua b/scripts/src/tools.lua index 157cbde1e7e..25790c257ac 100644 --- a/scripts/src/tools.lua +++ b/scripts/src/tools.lua @@ -819,16 +819,16 @@ if (_OPTIONS["osd"] == "sdl") then configuration { "mingw*"} links { "SDL2", - "Imm32", - "Version", - "Ole32", - "OleAut32", + "imm32", + "version", + "ole32", + "oleaut32", } configuration { "vs*" } links { "SDL2", - "Imm32", - "Version", + "imm32", + "version", } configuration { } else @@ -841,8 +841,8 @@ if (_OPTIONS["osd"] == "sdl") then configuration { "vs*" } links { "SDL2", - "Imm32", - "Version", + "imm32", + "version", } configuration { } else -- cgit v1.2.3