Fix for backtick [qmc2](nw)

This commit is contained in:
Miodrag Milanovic 2015-04-02 19:04:09 +02:00
parent de6c5f38f5
commit 23de91ccde

View File

@ -6,7 +6,8 @@ local naclToolchain = ""
function backtick(cmd) function backtick(cmd)
return string.gsub(string.gsub(os.outputof(cmd), "\r?\n$", ""), "\r?\n", " ") result = string.gsub(string.gsub(os.outputof(cmd), "\r?\n$", ""), " $", "")
return result
end end
function str_to_version(str) function str_to_version(str)
@ -124,42 +125,42 @@ newoption {
newoption { newoption {
trigger = "PROFILE", trigger = "PROFILE",
description = "Enable profiling.", description = "Enable profiling.",
} }
newoption { newoption {
trigger = "SYMBOLS", trigger = "SYMBOLS",
description = "Enable symbols.", description = "Enable symbols.",
} }
newoption { newoption {
trigger = "SYMLEVEL", trigger = "SYMLEVEL",
description = "Symbols level.", description = "Symbols level.",
} }
newoption { newoption {
trigger = "PROFILER", trigger = "PROFILER",
description = "Include the internal profiler.", description = "Include the internal profiler.",
} }
newoption { newoption {
trigger = "OPTIMIZE", trigger = "OPTIMIZE",
description = "Optimization level.", description = "Optimization level.",
} }
newoption { newoption {
trigger = "ARCHOPTS", trigger = "ARCHOPTS",
description = "ARCHOPTS.", description = "ARCHOPTS.",
} }
newoption { newoption {
trigger = "LDOPTS", trigger = "LDOPTS",
description = "Additional linker options", description = "Additional linker options",
} }
newoption { newoption {
trigger = "MAP", trigger = "MAP",
description = "Generate a link map.", description = "Generate a link map.",
} }
newoption { newoption {
trigger = "NOASM", trigger = "NOASM",
@ -182,12 +183,12 @@ newoption {
newoption { newoption {
trigger = "FORCE_DRC_C_BACKEND", trigger = "FORCE_DRC_C_BACKEND",
description = "Force DRC C backend.", description = "Force DRC C backend.",
} }
newoption { newoption {
trigger = "NOWERROR", trigger = "NOWERROR",
description = "NOWERROR", description = "NOWERROR",
} }
newoption { newoption {
trigger = "USE_BGFX", trigger = "USE_BGFX",
@ -262,18 +263,18 @@ configuration { "vs*" }
"FatalWarnings", "FatalWarnings",
} }
end end
configuration { "Debug", "vs*" } configuration { "Debug", "vs*" }
flags { flags {
"Symbols", "Symbols",
} }
configuration {} configuration {}
--aftercompilefile ("\t$(SILENT) gawk -f ../../../../../scripts/depfilter.awk $(@:%.o=%.d) > $(@:%.o=%.dep)\n\t$(SILENT) mv $(@:%.o=%.dep) $(@:%.o=%.d)") --aftercompilefile ("\t$(SILENT) gawk -f ../../../../../scripts/depfilter.awk $(@:%.o=%.d) > $(@:%.o=%.dep)\n\t$(SILENT) mv $(@:%.o=%.dep) $(@:%.o=%.d)")
msgcompile ("Compiling $(subst ../,,$<)...") msgcompile ("Compiling $(subst ../,,$<)...")
msgcompile_objc ("Objective-C compiling $(subst ../,,$<)...") msgcompile_objc ("Objective-C compiling $(subst ../,,$<)...")
@ -307,19 +308,19 @@ configuration { "x64", "Debug" }
if _OPTIONS["PROFILE"] then if _OPTIONS["PROFILE"] then
targetsuffix "64dp" targetsuffix "64dp"
end end
configuration { "x32", "Release" } configuration { "x32", "Release" }
targetsuffix "" targetsuffix ""
if _OPTIONS["PROFILE"] then if _OPTIONS["PROFILE"] then
targetsuffix "p" targetsuffix "p"
end end
configuration { "x32", "Debug" } configuration { "x32", "Debug" }
targetsuffix "d" targetsuffix "d"
if _OPTIONS["PROFILE"] then if _OPTIONS["PROFILE"] then
targetsuffix "dp" targetsuffix "dp"
end end
configuration { "Native", "Release" } configuration { "Native", "Release" }
targetsuffix "" targetsuffix ""
if _OPTIONS["PROFILE"] then if _OPTIONS["PROFILE"] then
@ -470,7 +471,7 @@ if not _OPTIONS["FORCE_DRC_C_BACKEND"] then
configuration { } configuration { }
end end
end end
-- define USE_SYSTEM_JPEGLIB if library shipped with MAME is not used -- define USE_SYSTEM_JPEGLIB if library shipped with MAME is not used
--ifneq ($(BUILD_JPEGLIB),1) --ifneq ($(BUILD_JPEGLIB),1)
--DEFS += -DUSE_SYSTEM_JPEGLIB --DEFS += -DUSE_SYSTEM_JPEGLIB
@ -553,7 +554,7 @@ end
if _OPTIONS["SYMBOLS"]~=nil then if _OPTIONS["SYMBOLS"]~=nil then
flags { flags {
"Symbols", "Symbols",
} }
end end
--# add the optimization flag --# add the optimization flag
@ -573,9 +574,9 @@ end
--ifneq ($(),0) --ifneq ($(),0)
if _OPTIONS["OPTIMIZE"] then if _OPTIONS["OPTIMIZE"] then
buildoptions { buildoptions {
"-fno-strict-aliasing" "-fno-strict-aliasing"
} }
if _OPTIONS["ARCHOPTS"] then if _OPTIONS["ARCHOPTS"] then
buildoptions { buildoptions {
_OPTIONS["ARCHOPTS"] _OPTIONS["ARCHOPTS"]
} }
@ -611,7 +612,7 @@ if _OPTIONS["MAP"] then
"-Wl,-Map," .. "../../../../" .. _OPTIONS["target"] .. _OPTIONS["subtarget"] .. ".map" "-Wl,-Map," .. "../../../../" .. _OPTIONS["target"] .. _OPTIONS["subtarget"] .. ".map"
} }
end end
end end
buildoptions { buildoptions {
"-Wno-unknown-pragmas", "-Wno-unknown-pragmas",
@ -652,7 +653,7 @@ end
--endif --endif
local version = str_to_version(_OPTIONS["gcc_version"]) local version = str_to_version(_OPTIONS["gcc_version"])
if string.find(_OPTIONS["gcc"], "clang") then if string.find(_OPTIONS["gcc"], "clang") then
buildoptions { buildoptions {
@ -665,7 +666,7 @@ end
buildoptions { buildoptions {
"-Wno-unused-value", "-Wno-unused-value",
} }
end end
if (version >= 30400) then if (version >= 30400) then
buildoptions { buildoptions {
"-Wno-inline-new-delete", "-Wno-inline-new-delete",
@ -684,12 +685,12 @@ end
buildoptions { buildoptions {
"-Wno-cast-align" "-Wno-cast-align"
} }
end end
if (version >= 40400) then if (version >= 40400) then
buildoptions { buildoptions {
"-Wno-unused-result", "-Wno-unused-result",
} }
end end
if (version >= 40700) then if (version >= 40700) then
buildoptions { buildoptions {
@ -714,13 +715,13 @@ local subdir
if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then
subdir = _OPTIONS["osd"] .. "/" .. _OPTIONS["target"] subdir = _OPTIONS["osd"] .. "/" .. _OPTIONS["target"]
else else
subdir = _OPTIONS["osd"] .. "/" .. _OPTIONS["target"] .. _OPTIONS["subtarget"] subdir = _OPTIONS["osd"] .. "/" .. _OPTIONS["target"] .. _OPTIONS["subtarget"]
end end
if not toolchain(MAME_BUILD_DIR, subdir) then if not toolchain(MAME_BUILD_DIR, subdir) then
return -- no action specified return -- no action specified
end end
configuration { "asmjs" } configuration { "asmjs" }
buildoptions { buildoptions {
"-std=gnu89", "-std=gnu89",
@ -762,7 +763,7 @@ configuration { "linux-*" }
"dl", "dl",
} }
if _OPTIONS["distro"]=="debian-stable" then if _OPTIONS["distro"]=="debian-stable" then
defines defines
{ {
"NO_AFFINITY_NP", "NO_AFFINITY_NP",
} }
@ -890,7 +891,7 @@ configuration { "vs*" }
} }
if _OPTIONS["vs"]=="intel-15" then if _OPTIONS["vs"]=="intel-15" then
buildoptions { buildoptions {
"/Qwd9", "/Qwd9",
"/Qwd82", "/Qwd82",
"/Qwd111", "/Qwd111",
"/Qwd128", "/Qwd128",
@ -903,13 +904,13 @@ if _OPTIONS["vs"]=="intel-15" then
"/Qwd869", "/Qwd869",
"/Qwd2545", "/Qwd2545",
"/Qwd2553", "/Qwd2553",
"/Qwd2557", "/Qwd2557",
"/Qwd3280", "/Qwd3280",
"/Qwd170", "/Qwd170",
"/Qwd188", "/Qwd188",
"/Qwd63", "/Qwd63",
"/Qwd177", "/Qwd177",
"/Qwd186", "/Qwd186",
"/Qwd488", "/Qwd488",
@ -968,7 +969,7 @@ if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then
startproject (_OPTIONS["target"]) startproject (_OPTIONS["target"])
else else
startproject (_OPTIONS["target"] .. _OPTIONS["subtarget"]) startproject (_OPTIONS["target"] .. _OPTIONS["subtarget"])
end end
mainProject(_OPTIONS["target"],_OPTIONS["subtarget"]) mainProject(_OPTIONS["target"],_OPTIONS["subtarget"])
if _OPTIONS["with-tools"] then if _OPTIONS["with-tools"] then
@ -976,6 +977,6 @@ if _OPTIONS["with-tools"] then
dofile(path.join("src", "tools.lua")) dofile(path.join("src", "tools.lua"))
end end
if (_ACTION == "gmake" and _OPTIONS["gcc"]=='asmjs') then if (_ACTION == "gmake" and _OPTIONS["gcc"]=='asmjs') then
strip() strip()
end end