diff options
author | 2015-04-02 22:22:19 +1100 | |
---|---|---|
committer | 2015-04-02 22:26:35 +1100 | |
commit | a63bd12019fe1452ba6a6cac03281e15eb0eb685 (patch) | |
tree | 7ab83cf13a9c82ad40215c2b52fa33877e3351cd /scripts/genie.lua | |
parent | 126cac8f433044ad41b9ac58a741f3a48e528f83 (diff) |
Add back support for big endian targets including OSX-PPC
Diffstat (limited to 'scripts/genie.lua')
-rw-r--r-- | scripts/genie.lua | 88 |
1 files changed, 74 insertions, 14 deletions
diff --git a/scripts/genie.lua b/scripts/genie.lua index d8af3bfb852..56b43662d45 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -173,6 +173,15 @@ newoption { } newoption { + trigger = "BIGENDIAN", + description = "Build for big endian target", + allowed = { + { "0", "Little endian target" }, + { "1", "Big endian target" }, + }, +} + +newoption { trigger = "FORCE_DRC_C_BACKEND", description = "Force DRC C backend.", } @@ -193,6 +202,10 @@ newoption { local os_version = str_to_version(_OPTIONS["os_version"]) +if not _OPTIONS["BIGENDIAN"] then + _OPTIONS["BIGENDIAN"] = "0" +end + if not _OPTIONS["NOASM"] then if _OPTIONS["targetos"]=="emscripten" then _OPTIONS["NOASM"] = "1" @@ -384,10 +397,56 @@ else end --- define LSB_FIRST if we are a little-endian target -defines { - "LSB_FIRST", -} +if _OPTIONS["BIGENDIAN"]=="1" then + if _OPTIONS["targetos"]=="macosx" then + defines { + "OSX_PPC", + } + buildoptions { + "-Wno-unused-label", + } + if _OPTIONS["SYMBOLS"] then + buildoptions { + "-mlong-branch", + } + end + configuration { "x64" } + buildoptions { + "-arch ppc64", + } + linkoptions { + "-arch ppc64", + } + configuration { "x32" } + buildoptions { + "-arch ppc", + } + linkoptions { + "-arch ppc", + } + configuration { } + end +else + defines { + "LSB_FIRST", + } + if _OPTIONS["targetos"]=="macosx" then + configuration { "x64" } + buildoptions { + "-arch x86_64", + } + linkoptions { + "-arch x86_64", + } + configuration { "x32" } + buildoptions { + "-arch i386", + } + linkoptions { + "-arch i386", + } + end +end -- need to ensure FLAC functions are statically linked defines { @@ -400,17 +459,18 @@ if _OPTIONS["NOASM"]=="1" then } 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 { } + if _OPTIONS["BIGENDIAN"]~="1" then + configuration { "x64" } + defines { + "NATIVE_DRC=drcbe_x64", + } + configuration { "x32" } + defines { + "NATIVE_DRC=drcbe_x86", + } + configuration { } + end end -- define USE_SYSTEM_JPEGLIB if library shipped with MAME is not used |