From 9ecc07d7a2647fd631f9c7967df6674ea1e552ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 20 Sep 2015 22:09:56 -0700 Subject: [PATCH] Added linux-mips-gcc toolchain configuration. --- scripts/toolchain.lua | 72 ++++++++++++++++++++++++++++--------------- 1 file changed, 48 insertions(+), 24 deletions(-) diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index bb30608..351ba20 100755 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -13,25 +13,27 @@ function toolchain(_buildDir, _libDir) value = "GCC", description = "Choose GCC flavor", allowed = { - { "android-arm", "Android - ARM" }, - { "android-mips", "Android - MIPS" }, - { "android-x86", "Android - x86" }, - { "asmjs", "Emscripten/asm.js" }, - { "freebsd", "FreeBSD" }, - { "linux-gcc", "Linux (GCC compiler)" }, - { "linux-gcc-5", "Linux (GCC-5 compiler)" }, - { "linux-clang", "Linux (Clang compiler)" }, - { "ios-arm", "iOS - ARM" }, - { "ios-simulator", "iOS - Simulator" }, - { "mingw-gcc", "MinGW" }, - { "mingw-clang", "MinGW (clang compiler)" }, - { "nacl", "Native Client" }, - { "nacl-arm", "Native Client - ARM" }, - { "osx", "OSX" }, - { "pnacl", "Native Client - PNaCl" }, - { "ps4", "PS4" }, - { "qnx-arm", "QNX/Blackberry - ARM" }, - { "rpi", "RaspberryPi" }, + { "android-arm", "Android - ARM" }, + { "android-mips", "Android - MIPS" }, + { "android-x86", "Android - x86" }, + { "asmjs", "Emscripten/asm.js" }, + { "freebsd", "FreeBSD" }, + { "linux-gcc", "Linux (GCC compiler)" }, + { "linux-gcc-5", "Linux (GCC-5 compiler)" }, + { "linux-clang", "Linux (Clang compiler)" }, + { "linux-mips-gcc", "Linux (MIPS, GCC compiler)" }, + { "linux-arm-gcc", "Linux (ARM, GCC compiler)" }, + { "ios-arm", "iOS - ARM" }, + { "ios-simulator", "iOS - Simulator" }, + { "mingw-gcc", "MinGW" }, + { "mingw-clang", "MinGW (clang compiler)" }, + { "nacl", "Native Client" }, + { "nacl-arm", "Native Client - ARM" }, + { "osx", "OSX" }, + { "pnacl", "Native Client - PNaCl" }, + { "ps4", "PS4" }, + { "qnx-arm", "QNX/Blackberry - ARM" }, + { "rpi", "RaspberryPi" }, }, } @@ -180,6 +182,12 @@ function toolchain(_buildDir, _libDir) premake.gcc.ar = "ar" location (path.join(_buildDir, "projects", _ACTION .. "-linux-clang")) + elseif "linux-mips-gcc" == _OPTIONS["gcc"] then + location (path.join(_buildDir, "projects", _ACTION .. "-linux-mips-gcc")) + + elseif "linux-arm-gcc" == _OPTIONS["gcc"] then + location (path.join(_buildDir, "projects", _ACTION .. "-linux-arm-gcc")) + elseif "mingw-gcc" == _OPTIONS["gcc"] then premake.gcc.cc = "$(MINGW)/bin/x86_64-w64-mingw32-gcc" premake.gcc.cxx = "$(MINGW)/bin/x86_64-w64-mingw32-g++" @@ -521,12 +529,12 @@ function toolchain(_buildDir, _libDir) -- "ubsan", } - configuration { "linux-g*" } + configuration { "linux-gcc" } buildoptions { - "-mfpmath=sse", -- force SSE to get 32-bit and 64-bit builds deterministic. + "-mfpmath=sse", } - configuration { "linux-*" } + configuration { "linux-gcc or linux-clang" } buildoptions { "-msse2", "-Wunused-value", @@ -543,7 +551,7 @@ function toolchain(_buildDir, _libDir) "-Wl,--gc-sections", } - configuration { "linux-g*", "x32" } + configuration { "linux-gcc*", "x32" } targetdir (path.join(_buildDir, "linux32_gcc/bin")) objdir (path.join(_buildDir, "linux32_gcc/obj")) libdirs { path.join(_libDir, "lib/linux32_gcc") } @@ -551,7 +559,7 @@ function toolchain(_buildDir, _libDir) "-m32", } - configuration { "linux-g*", "x64" } + configuration { "linux-gcc*", "x64" } targetdir (path.join(_buildDir, "linux64_gcc/bin")) objdir (path.join(_buildDir, "linux64_gcc/obj")) libdirs { path.join(_libDir, "lib/linux64_gcc") } @@ -575,6 +583,22 @@ function toolchain(_buildDir, _libDir) "-m64", } + configuration { "linux-mips-gcc" } + buildoptions { + "-Wunused-value", + "-Wundef", + } + buildoptions_cpp { + "-std=c++0x", + } + links { + "rt", + "dl", + } + linkoptions { + "-Wl,--gc-sections", + } + configuration { "android-*" } flags { "NoImportLib",