summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2015-04-01 16:11:48 +1100
committer Vas Crabb <vas@vastheman.com>2015-04-01 16:12:03 +1100
commit19d52cef70b0ef0c373ddb8c49cefd179d309f37 (patch)
tree08bcd31f5ca3705aaa0141c2ac728f06e09be84f
parent2bd0eb2b0d39b7980750dbad0df400bad394762e (diff)
Bring back NOASM
-rw-r--r--makefile19
-rw-r--r--scripts/genie.lua160
-rw-r--r--scripts/src/osd/sdl.lua14
-rw-r--r--scripts/src/osd/windows.lua11
-rw-r--r--src/osd/eminline.h2
-rw-r--r--src/osd/sdl/sdlmain.c2
-rw-r--r--src/osd/sdl/sdlprefix.h2
7 files changed, 134 insertions, 76 deletions
diff --git a/makefile b/makefile
index a218974a994..c76b4e03514 100644
--- a/makefile
+++ b/makefile
@@ -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
diff --git a/scripts/genie.lua b/scripts/genie.lua
index 5ebbdd18873..dfcb17d08a7 100644
--- a/scripts/genie.lua
+++ b/scripts/genie.lua
@@ -164,6 +164,15 @@ newoption {
}
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
+-- 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
+defines {
+ "LSB_FIRST",
+}
- -- define LSB_FIRST if we are a little-endian target
+-- define USE_NETWORK if networking is enabled (not OS/2 and hasn't been disabled)
+if not _OPTIONS["targetos"]=="os2" then
defines {
- "LSB_FIRST",
+ "USE_NETWORK",
}
+end
+-- need to ensure FLAC functions are statically linked
+defines {
+ "FLAC__NO_DLL",
+}
- -- 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
+if _OPTIONS["NOASM"]=="1" then
defines {
- "FLAC__NO_DLL",
+ "MAME_NOASM"
}
+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
+-- 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)
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua
index 732442d70b9..96b171c0192 100644
--- a/scripts/src/osd/sdl.lua
+++ b/scripts/src/osd/sdl.lua
@@ -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",
diff --git a/scripts/src/osd/windows.lua b/scripts/src/osd/windows.lua
index 03d3948dd4f..8774c848eec 100644
--- a/scripts/src/osd/windows.lua
+++ b/scripts/src/osd/windows.lua
@@ -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
diff --git a/src/osd/eminline.h b/src/osd/eminline.h
index 0772d3eea98..3fca94af079 100644
--- a/src/osd/eminline.h
+++ b/src/osd/eminline.h
@@ -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__)
diff --git a/src/osd/sdl/sdlmain.c b/src/osd/sdl/sdlmain.c
index e2cfc5898f4..af9a6976ce9 100644
--- a/src/osd/sdl/sdlmain.c
+++ b/src/osd/sdl/sdlmain.c
@@ -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);
diff --git a/src/osd/sdl/sdlprefix.h b/src/osd/sdl/sdlprefix.h
index 69681043ef8..ed1b2e11204 100644
--- a/src/osd/sdl/sdlprefix.h
+++ b/src/osd/sdl/sdlprefix.h
@@ -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