Bring back NOASM

This commit is contained in:
Vas Crabb 2015-04-01 16:11:48 +11:00
parent 2bd0eb2b0d
commit 19d52cef70
7 changed files with 136 additions and 78 deletions

View File

@ -132,6 +132,13 @@ endif
endif
ifeq ($(findstring arm,$(UNAME)),arm)
ifndef NOASM
NOASM := 1
endif
endif
PYTHON := $(SILENT)python
CC := $(SILENT)gcc
LD := $(SILENT)g++
@ -266,11 +273,19 @@ PARAMS += --ARCHOPTS='$(ARCHOPTS)'
endif
ifdef MAP
PARAMS += --MAP=$(MAP)
PARAMS += --MAP='$(MAP)'
endif
ifdef USE_BGFX
PARAMS += --USE_BGFX=$(USE_BGFX)
PARAMS += --USE_BGFX='$(USE_BGFX)'
endif
ifdef NOASM
PARAMS += --NOASM='$(NOASM)'
endif
ifdef FORCE_DRC_C_BACKEND
PARAMS += --FORCE_DRC_C_BACKEND='$(FORCE_DRC_C_BACKEND)'
endif
ifdef NOWERROR

View File

@ -163,6 +163,15 @@ newoption {
description = "Generate a link map.",
}
newoption {
trigger = "NOASM",
description = "Disable implementations based on assembler code",
allowed = {
{ "0", "Enable assembler code" },
{ "1", "Disable assembler code" },
},
}
newoption {
trigger = "FORCE_DRC_C_BACKEND",
description = "Force DRC C backend.",
@ -180,10 +189,22 @@ newoption {
{ "0", "Disabled" },
{ "1", "Enabled" },
}
}
}
local os_version = str_to_version(_OPTIONS["os_version"])
if not _OPTIONS["NOASM"] then
if _OPTIONS["targetos"]=="emscripten" then
_OPTIONS["NOASM"] = "1"
else
_OPTIONS["NOASM"] = "0"
end
end
if _OPTIONS["NOASM"]=="1" and not _OPTIONS["FORCE_DRC_C_BACKEND"] then
_OPTIONS["FORCE_DRC_C_BACKEND"] = "1"
end
USE_BGFX = 1
if (_OPTIONS["targetos"]=="macosx" and os_version < 100700) then
USE_BGFX = 0
@ -201,42 +222,44 @@ if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then
solution (_OPTIONS["target"])
else
solution (_OPTIONS["target"] .. _OPTIONS["subtarget"])
end
configurations {
"Debug",
"Release",
}
end
platforms {
"x32",
"x64",
"Native", -- for targets where bitness is not specified
}
configurations {
"Debug",
"Release",
}
language "C++"
platforms {
"x32",
"x64",
"Native", -- for targets where bitness is not specified
}
flags {
"StaticRuntime",
"Unicode",
"NoPCH",
}
configuration { "vs*" }
language "C++"
flags {
"StaticRuntime",
"Unicode",
"NoPCH",
}
configuration { "vs*" }
flags {
"ExtraWarnings",
}
if _OPTIONS["NOWERROR"]==nil then
flags{
"FatalWarnings",
}
if not _OPTIONS["NOWERROR"] then
flags{
"FatalWarnings",
}
end
configuration { "Debug", "vs*" }
flags {
"Symbols",
}
configuration {}
configuration { "Debug", "vs*" }
flags {
"Symbols",
}
configuration {}
--aftercompilefile ("\t$(SILENT) gawk -f ../../../../../scripts/depfilter.awk $(@:%.o=%.d) > $(@:%.o=%.dep)\n\t$(SILENT) mv $(@:%.o=%.dep) $(@:%.o=%.d)")
@ -305,11 +328,11 @@ dofile ("toolchain.lua")
if _OPTIONS["targetos"]=="windows" then
configuration { "x64" }
defines {
"X64_WINDOWS_ABI",
}
configuration { }
configuration { "x64" }
defines {
"X64_WINDOWS_ABI",
}
configuration { }
end
-- Avoid error when invoking genie --help.
@ -349,46 +372,53 @@ configuration { "Release" }
}
configuration { }
-- CR/LF setup: use both on win32/os2, CR only on everything else
if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="os2" then
defines {
"CRLF=3",
}
else
defines {
"CRLF=2",
}
end
-- define LSB_FIRST if we are a little-endian target
-- CR/LF setup: use both on win32/os2, CR only on everything else
if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="os2" then
defines {
"LSB_FIRST",
"CRLF=3",
}
-- define USE_NETWORK if networking is enabled (not OS/2 and hasn't been disabled)
if not _OPTIONS["targetos"]=="os2" then
defines {
"USE_NETWORK",
}
end
-- need to ensure FLAC functions are statically linked
else
defines {
"FLAC__NO_DLL",
"CRLF=2",
}
end
-- fixme -- need to make this work for other target architectures (PPC)
if _OPTIONS["FORCE_DRC_C_BACKEND"]==nil then
configuration { "x64" }
defines {
"NATIVE_DRC=drcbe_x64",
}
configuration { "x32" }
defines {
"NATIVE_DRC=drcbe_x86",
}
configuration { }
end
-- define LSB_FIRST if we are a little-endian target
defines {
"LSB_FIRST",
}
-- define USE_NETWORK if networking is enabled (not OS/2 and hasn't been disabled)
if not _OPTIONS["targetos"]=="os2" then
defines {
"USE_NETWORK",
}
end
-- need to ensure FLAC functions are statically linked
defines {
"FLAC__NO_DLL",
}
if _OPTIONS["NOASM"]=="1" then
defines {
"MAME_NOASM"
}
end
-- fixme -- need to make this work for other target architectures (PPC)
if not _OPTIONS["FORCE_DRC_C_BACKEND"] then
configuration { "x64" }
defines {
"NATIVE_DRC=drcbe_x64",
}
configuration { "x32" }
defines {
"NATIVE_DRC=drcbe_x86",
}
configuration { }
end
-- define USE_SYSTEM_JPEGLIB if library shipped with MAME is not used
--ifneq ($(BUILD_JPEGLIB),1)

View File

@ -382,12 +382,18 @@ project ("ocore_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/modules/osdmodule.c",
MAME_DIR .. "src/osd/modules/lib/osdlib_" .. SDLOS_TARGETOS .. ".c",
MAME_DIR .. "src/osd/modules/sync/sync_" .. SYNC_IMPLEMENTATION .. ".c",
--ifdef NOASM
--MAME_DIR .. "src/osd/modules/sync/work_mini.c",
--else
MAME_DIR .. "src/osd/modules/sync/work_osd.c",
}
if _OPTIONS["NOASM"]=="1" then
files {
MAME_DIR .. "src/osd/modules/sync/work_mini.c",
}
else
files {
MAME_DIR .. "src/osd/modules/sync/work_osd.c",
}
end
if _OPTIONS["targetos"]=="macosx" then
files {
MAME_DIR .. "src/osd/sdl/osxutils.m",

View File

@ -150,10 +150,19 @@ project ("ocore_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/windows/winsocket.c",
MAME_DIR .. "src/osd/windows/winptty.c",
MAME_DIR .. "src/osd/modules/osdmodule.c",
MAME_DIR .. "src/osd/modules/sync/work_osd.c",
MAME_DIR .. "src/osd/modules/lib/osdlib_win32.c",
}
if _OPTIONS["NOASM"]=="1" then
files {
MAME_DIR .. "src/osd/modules/sync/work_mini.c",
}
else
files {
MAME_DIR .. "src/osd/modules/sync/work_osd.c",
}
end
--------------------------------------------------
-- ledutil

View File

@ -13,7 +13,7 @@
#ifndef __EMINLINE__
#define __EMINLINE__
#if !defined(SDLMAME_NOASM)
#if !defined(MAME_NOASM)
/* we come with implementations for GCC x86 and PPC */
#if defined(__GNUC__)

View File

@ -389,13 +389,13 @@ static void defines_verbose(void)
MACRO_VERBOSE(SDLMAME_DARWIN);
MACRO_VERBOSE(SDLMAME_LINUX);
MACRO_VERBOSE(SDLMAME_SOLARIS);
MACRO_VERBOSE(SDLMAME_NOASM);
MACRO_VERBOSE(SDLMAME_IRIX);
MACRO_VERBOSE(SDLMAME_BSD);
osd_printf_verbose("\n");
osd_printf_verbose("Build defines 1: ");
MACRO_VERBOSE(LSB_FIRST);
MACRO_VERBOSE(PTR64);
MACRO_VERBOSE(MAME_NOASM);
MACRO_VERBOSE(MAME_DEBUG);
MACRO_VERBOSE(BIGENDIAN);
MACRO_VERBOSE(CPP_COMPILE);

View File

@ -72,8 +72,6 @@
#if defined(EMSCRIPTEN)
#define SDLMAME_EMSCRIPTEN 1
#define SDLMAME_NO64BITIO 1
#define NOASM 1
#define SDLMAME_NOASM 1
struct _IO_FILE {}; //_IO_FILE is an opaque type in the emscripten libc which makes clang cranky
#endif